atg.svc.agent.environment
Class CallState

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.svc.agent.environment.CallState
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, 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 CallState
extends atg.nucleus.GenericService

Maintains state information for an agent's current active call.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  boolean mCallActive
           
protected  java.util.Map mStateData
           
 
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
CallState()
           
 
Method Summary
 void addStateData(java.lang.Object pStateDataKey, java.lang.Object pStateDataObject)
          Adds the extra data object keyed by the given object
 void doStopService()
           
 void endCall()
          Sets the appropriate state when a call is ended.
 java.lang.String generateCallId()
          Generates unique call id for each request
 atg.agent.events.AgentMessagingTools getAgentMessagingTools()
          Returns component for sending agent messages
 EnvironmentTools getEnvironmentTools()
          Returns EnvironmentTools
 java.lang.String getGeneratedCallId()
          Returns generated call Id
 atg.service.idgen.IdGenerator getIdGenerator()
          Returns idGenerator
 java.lang.String getIdSpaceName()
          Gets property idSpaceName
 java.util.Date getStartTime()
          Returns start time of the call
 java.lang.Object getStateData(java.lang.Object pStateDataKey)
          Returns the extra data object keyed by the given object
 java.util.Map getStateDataMap()
          Returns the extra data map.
 void initializeNewCall()
          Reinitializes the state for a new call.
 boolean isCallActive()
          Returns if a call has been started.
 void removeStateData(java.lang.Object pStateDataKey)
          Removes the extra data object keyed by the given object
 void setAgentMessagingTools(atg.agent.events.AgentMessagingTools pAgentMessagingTools)
          Sets the component for sending agent messages
 void setCallActive(boolean pCallActive)
          Sets if a call has been started.
 void setEnvironmentTools(EnvironmentTools pEnvironmentTools)
          Sets EnvironmentTools
 void setGeneratedCallId(java.lang.String pGeneratedCallId)
          Sets generated call Id
 void setIdGenerator(atg.service.idgen.IdGenerator pIdGenerator)
          Sets idGenerator
 void setIdSpaceName(java.lang.String pIdSpaceName)
          Sets property idSpaceName
 void setStartTime(java.util.Date startTime)
          Sets start time of the call
 void setStateDataMap(java.util.Map pStateData)
           
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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 final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

mCallActive

protected boolean mCallActive

mStateData

protected java.util.Map mStateData
Constructor Detail

CallState

public CallState()
Method Detail

setCallActive

public void setCallActive(boolean pCallActive)
Sets if a call has been started.


isCallActive

public boolean isCallActive()
Returns if a call has been started.


setAgentMessagingTools

public void setAgentMessagingTools(atg.agent.events.AgentMessagingTools pAgentMessagingTools)
Sets the component for sending agent messages

Parameters:
pAgentMessagingTools -

getAgentMessagingTools

public atg.agent.events.AgentMessagingTools getAgentMessagingTools()
Returns component for sending agent messages

Returns:
AgentMessagingTools

setEnvironmentTools

public void setEnvironmentTools(EnvironmentTools pEnvironmentTools)
Sets EnvironmentTools

Parameters:
pEnvironmentTools -

getEnvironmentTools

public EnvironmentTools getEnvironmentTools()
Returns EnvironmentTools

Returns:
environment tools

setGeneratedCallId

public void setGeneratedCallId(java.lang.String pGeneratedCallId)
Sets generated call Id

Parameters:
pGeneratedCallId -

getGeneratedCallId

public java.lang.String getGeneratedCallId()
Returns generated call Id

Returns:
generated call Id

getIdGenerator

public atg.service.idgen.IdGenerator getIdGenerator()
Returns idGenerator

Returns:
idGenerator

setIdGenerator

public void setIdGenerator(atg.service.idgen.IdGenerator pIdGenerator)
Sets idGenerator

Parameters:
pIdGenerator -

getIdSpaceName

public java.lang.String getIdSpaceName()
Gets property idSpaceName

Returns:
idSpaceName

setIdSpaceName

public void setIdSpaceName(java.lang.String pIdSpaceName)
Sets property idSpaceName

Parameters:
pIdSpaceName - idSpaceName

getStartTime

public java.util.Date getStartTime()
Returns start time of the call

Returns:
start time of the call

setStartTime

public void setStartTime(java.util.Date startTime)
Sets start time of the call

Parameters:
startTime -

getStateDataMap

public java.util.Map getStateDataMap()
Returns the extra data map. This map can be used by applications to store application specific state information.

Returns:
Map

setStateDataMap

public void setStateDataMap(java.util.Map pStateData)

getStateData

public java.lang.Object getStateData(java.lang.Object pStateDataKey)
Returns the extra data object keyed by the given object

Parameters:
pStateDataKey -
Returns:
extra data object

addStateData

public void addStateData(java.lang.Object pStateDataKey,
                         java.lang.Object pStateDataObject)
Adds the extra data object keyed by the given object

Parameters:
pStateDataKey -
pStateDataObject -

removeStateData

public void removeStateData(java.lang.Object pStateDataKey)
Removes the extra data object keyed by the given object

Parameters:
pStateDataKey -

initializeNewCall

public void initializeNewCall()
Reinitializes the state for a new call.

The call active flag is set to true and the state data is reinitialized


endCall

public void endCall()
Sets the appropriate state when a call is ended.


generateCallId

public java.lang.String generateCallId()
Generates unique call id for each request

Returns:
call id

doStopService

public void doStopService()
                   throws atg.nucleus.ServiceException
Overrides:
doStopService in class atg.nucleus.GenericService
Throws:
atg.nucleus.ServiceException