atg.projects.store.fluoroscope
Class SensorManagerFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.projects.store.fluoroscope.SensorManagerFormHandler
All Implemented Interfaces:
atg.droplet.DropletFormHandler, atg.naming.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class SensorManagerFormHandler
extends atg.droplet.GenericFormHandler

This form handler enables/disables sensor events in the CRS application. It also calculates collection of sensors to be displayed on the page.

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/Fluoroscope/src/atg/projects/store/fluoroscope/SensorManagerFormHandler.java#2 $$Change: 788983 $
Author:
ATG

Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
SensorManagerFormHandler()
           
 
Method Summary
 java.util.Collection<atg.service.fluoroscope.Sensor> getAvailableSensors()
          This method calculates a collection of sensors to be dislpayed on the UI.
 java.lang.String[] getDisplayedSensorNames()
          This property contains names of sensors to be displayed on the UI.
 atg.service.fluoroscope.SensorManagerService getSensorManager()
          This property contains a reference to a SensorManager Nucleus component.
 java.lang.String[] getSensors()
          This is an input property for the update process.
 java.lang.String getUpdateErrorURL()
          The user will be redirected to this URL when update process failed.
 java.lang.String getUpdateSuccessURL()
          The user will be redirected to this URL when update process successfully finished.
 boolean handleUpdate(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Implementation of the update process.
 void setDisplayedSensorNames(java.lang.String[] pSensorNames)
           
 void setSensorManager(atg.service.fluoroscope.SensorManagerService pSensorManager)
           
 void setSensors(java.lang.String[] pSensors)
           
 void setUpdateErrorURL(java.lang.String pUpdateErrorURL)
           
 void setUpdateSuccessURL(java.lang.String pUpdateSuccessURL)
           
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, afterSet, beforeSet, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

SensorManagerFormHandler

public SensorManagerFormHandler()
Method Detail

getSensorManager

public atg.service.fluoroscope.SensorManagerService getSensorManager()
This property contains a reference to a SensorManager Nucleus component. It's a central component for all Fluoroscope functionality.

Returns:
SensorManager instance.

setSensorManager

public void setSensorManager(atg.service.fluoroscope.SensorManagerService pSensorManager)

getDisplayedSensorNames

public java.lang.String[] getDisplayedSensorNames()
This property contains names of sensors to be displayed on the UI.

Returns:
array of displayed sensors names.

setDisplayedSensorNames

public void setDisplayedSensorNames(java.lang.String[] pSensorNames)

getUpdateSuccessURL

public java.lang.String getUpdateSuccessURL()
The user will be redirected to this URL when update process successfully finished.

Returns:
update success URL.

setUpdateSuccessURL

public void setUpdateSuccessURL(java.lang.String pUpdateSuccessURL)

getUpdateErrorURL

public java.lang.String getUpdateErrorURL()
The user will be redirected to this URL when update process failed.

Returns:
update failure URL.

setUpdateErrorURL

public void setUpdateErrorURL(java.lang.String pUpdateErrorURL)

getSensors

public java.lang.String[] getSensors()
This is an input property for the update process. Only sensors with names enlisted in this property will be enabled during update process execution.

Returns:
array of selected sensors names.

setSensors

public void setSensors(java.lang.String[] pSensors)

getAvailableSensors

public java.util.Collection<atg.service.fluoroscope.Sensor> getAvailableSensors()
This method calculates a collection of sensors to be dislpayed on the UI.

Returns:
Collection of sensors to be displayed on the UI.

handleUpdate

public boolean handleUpdate(atg.servlet.DynamoHttpServletRequest pRequest,
                            atg.servlet.DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Implementation of the update process. Current implementation iterates over all declared within SensorManager sensors and enables only sensors enlisted within the sensors property. Other sensors will be disabled.
If one or more sensors should be enabled, this process turns on all defined sensor listeners.

Parameters:
pRequest - current HTTP request.
pResponse - current HTTP response.
Returns:
false if redirect occurred, true otherwise.
Throws:
javax.servlet.ServletException - if something goes wrong.
java.io.IOException - if something goes wrong.