atg.svc.agent.environment
Class EnvironmentTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.svc.agent.environment.EnvironmentTools
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 EnvironmentTools
extends atg.nucleus.GenericService

This class provides the API for changing and accessing the agent's environment. The "environment" consist of several related objects that the agent interacts with while using the application. Whenever the objects are changed by something explicitly or implicitly done by the agent, this API is used to broadcast details of the change to the participating applications so they can react appropriately. For example, if the agent changes the current active customer, the framework will automatically ensure the ticket is updated or a new ticket provided (if the ticket owner cannot be changed).

Applications participate in this process by creating an EnvironmentMonitor component and adding it to this component's environmentMonitors property.

Each environment change is identified by a unique change key.


Field Summary
static java.lang.String AGENT_PROFILE_COMPONENT_PATH
          The agent profile component path
static java.lang.String CALL_STATE_COMPONENT_PATH
          The call state component path
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String DEFAULT_TICKET_CREATE_CHANNEL
          Creation channel used to create a new ticket when a channel isn't provided
static java.lang.String ENVIRONMENTTOOLS_PATH
          The path to the EnvironmentTools component
protected  java.lang.String mAgentApplicationName
           
protected  java.lang.String mAgentUserType
           
protected  EnvironmentMonitor[] mEnvironmentMonitors
           
protected  atg.svc.agent.events.EventTools mEventTools
          Used to record agent audit recoder events used for reporting and external integration hooks
protected  atg.repository.Repository mInternalProfileRepository
           
protected  atg.web.messaging.MessageTools mMessageTools
           
protected  atg.ticketing.TicketingManager mTicketingManager
           
protected  TicketingTools mTicketingTools
           
static java.lang.String VIEW_CUSTOMER_PROFILE_COMPONENT_PATH
          The view customer profile component path
static java.lang.String VIEW_TICKET_HOLDER_COMPONENT_PATH
          view ticket holder component path
 
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
EnvironmentTools()
           
 
Method Summary
 void addChangeActiveProfileDetail(java.lang.String pProfileId, EnvironmentChangeState pEnvironmentChangeState)
          Adds a EnvironmentChangeDetail to the EnvironmentChangeState that indicates a change to the active profile item.
 void addChangeActiveTicketDetail(java.lang.String pTicketId, EnvironmentChangeState pEnvironmentChangeState)
          Adds a EnvironmentChangeDetail to the EnvironmentChangeState that indicates a change to the active ticket item.
 void addNewActiveProfileDetail(java.lang.String pProfileId, EnvironmentChangeState pEnvironmentChangeState)
          Adds an EnvironmentChangeDetail for a new active customer profile change.
 void addNewActiveTicketDetail(EnvironmentChangeState pEnvironmentChangeState)
          Adds a EnvironmentChangeDetail to the EnvironmentChangeState that indicates a new ticket ticket item.
 void applyChanges(EnvironmentChangeState pEnvironmentChangeState)
          Calls each EnvironmentMonitor to apply the change details in the EnvironmentChangeState
 void changeActiveTicket(java.lang.String pApplicationName, java.lang.String pTicketId, TicketDispositionOptions pTicketDispositionOptions)
          Changes the environment's active ticket to the given ticket
 void changeNewActiveTicket(java.lang.String pApplicationName)
          Changes the environment's active ticket to a new ticket
 void changeUser(atg.repository.RepositoryItem pNewProfile, atg.userprofiling.Profile pCustomerProfile)
          This method loads a new customer profile into the customer profile object.
 void changeUser(java.lang.String pNewProfileId, atg.userprofiling.Profile pCustomerProfile)
          Loads a new profile into the customer profile object.
 EnvironmentChangeState createEnvironmentChangeState()
          Returns a new EnvironmentChangeState object
 void createWarningsForChangeEnvironment(EnvironmentChangeState pEnvironmentChangeState)
          Calls each EnvironmentMonitor to add warnings related to the EnvironmentChangeState related to the pending changes detailed in the state.
 boolean doesProfileExist(java.lang.String pProfileId)
          Determines if a profile exists with the given id
 void endCall(EnvironmentChangeState pEnvironmentChangeState)
          Ends the call in the the current call state and sends end call event.
 void generateChangeDetails(EnvironmentChangeState pEnvironmentChangeState)
          Generates the List of EnvironmentChangeDetails for the given environment change.
 atg.repository.RepositoryItem getActiveCustomerProfile()
          Returns the active customer profile item.
 atg.userprofiling.Profile getActiveCustomerProfileComponent()
          Returns the active customer profile component.
 atg.repository.RepositoryItem getActiveTicket()
          Returns the active ticket from the environment.
 java.lang.String getActiveTicketId()
          Returns the active ticket id
 java.lang.String getAgentApplicationName()
           
 atg.agent.events.AgentMessagingTools getAgentMessagingTools()
          Returns component for sending agent messages
 atg.userprofiling.Profile getAgentProfile()
          Returns the agent profile component.
 java.lang.String getAgentUserType()
          Defines the base item type for agent profiles
 CallState getCallState()
          returns the call state
 EnvironmentMonitor[] getEnvironmentMonitors()
          Returns the configured array of EnvironmentMonitor components.
 java.lang.Object getEnvironmentObject(java.lang.String pEnvironmentObjectName)
          Returns the environment object for the given name.
 atg.svc.agent.events.EventTools getEventTools()
           
static EnvironmentTools getInstance()
          Returns the global EnvironmentTools component by resolving it from the current request.
 atg.repository.Repository getInternalProfileRepository()
          The interna; profile repository
 atg.web.messaging.MessageTools getMessageTools()
          Returns the MessageTools component
 atg.repository.RepositoryItem getProfileFromDetail(EnvironmentChangeDetail pEnvironmentChangeDetail)
          Returns the profile repository item from the change detail.
 atg.userprofiling.ProfileTools getProfileTools()
          The ProfileTools component
 atg.ticketing.TicketingManager getTicketingManager()
           
 TicketingTools getTicketingTools()
           
 java.util.Locale getUserLocale()
          This method gets the current user Locale from the request.
 atg.repository.RepositoryItem getViewCustomerProfile()
          Returns the view customer profile
 atg.userprofiling.Profile getViewCustomerProfileComponent()
          Returns view customer profile component
 atg.repository.RepositoryItem getViewTicket()
          Returns the view ticket from the holder.
 EnvironmentChangeState initializeChange(java.lang.String pApplicationName, java.lang.String pEnvironmentChangeKey, java.util.Map pInputParameters, TicketDispositionOptions pTicketDispositionOptions, boolean pIncludeWarnings)
          Initializes a change to the environment and returns the assoicated state object.
 void initializeDefaultsForProfile(atg.repository.MutableRepositoryItem pProfile)
          Calls back to each EnvironmentMonitor to initialize the default values of a new profile.
 void initializeEnvironment()
          Initializes the environment
 void initializeEnvironmentChangeState(EnvironmentChangeState pEnvironmentChangeState, java.lang.String pApplicationName, java.lang.String pEnvironmentChangeKey, java.util.Map pInputParameters, TicketDispositionOptions pTicketDispositionOptions, boolean pIncludeWarnings)
          This method initializes the given EnvironmentChangeState for the given change key and input parameters.
 boolean isProcessDisposition(EnvironmentChangeState pEnvironmentChangeState)
          Determines if the ticket disposition handling is necessary for the given change by checking if the ticket is changing or the change is a logoff.
 boolean isTestRevert()
           
 boolean isTransactionMarkedAsRollBack()
          Returns true if the transaction associated with the current thread is marked for rollback.
 boolean loadNewAnonymousProfile(java.lang.String pProfileId)
          This method will sets up a new anonymous profile into the active customer profile.
 boolean loadNewAnonymousProfile(java.lang.String pProfileId, atg.userprofiling.Profile pProfile)
          This method will sets up a new anonymous profile item into the given profile object.
 boolean loadNewProfile(java.lang.String pProfileId, atg.userprofiling.Profile pProfile)
          Loads a profile item into the given profile.
 void loadViewProfile(java.lang.String pProfileId)
          Loads the given profile into the view profile component.
 boolean markTransactionForRollback()
          Returns true if the transaction has been marked for rollback, false if unable to access the transaction.
 void processTicketDisposition(atg.repository.RepositoryItem pTicket, TicketDispositionOptions pTicketDispositionOptions, java.lang.String pApplicationName)
          Processes the ticket according the disposition options.
 void setAgentApplicationName(java.lang.String pAgentApplicationName)
           
 void setAgentMessagingTools(atg.agent.events.AgentMessagingTools pAgentMessagingTools)
          Sets the component for sending agent messages
 void setAgentUserType(java.lang.String pAgentUserType)
           
 void setEnvironmentMonitors(EnvironmentMonitor[] pEnvironmentMonitors)
           
 void setEventTools(atg.svc.agent.events.EventTools pEventTools)
           
 void setInternalProfileRepository(atg.repository.Repository pInternalProfileRepository)
           
 void setMessageTools(atg.web.messaging.MessageTools pMessageTools)
           
 void setProfileTools(atg.userprofiling.ProfileTools pProfileTools)
          Sets the ProfileTools component
 void setTestRevert(boolean pTestRevert)
           
 void setTicketingManager(atg.ticketing.TicketingManager pTicketingManager)
          sets the configured TicketManager
 void setTicketingTools(TicketingTools pTicketingTools)
           
 void setViewCustomerProfile(atg.repository.RepositoryItem pProfile)
          Sets the view profile datasource to the given profile repository item.
 void setViewTicket(atg.repository.RepositoryItem pTicket)
          Sets the view ticket to the given ticket
 void startCall(EnvironmentChangeState pEnvironmentChangeState)
          Initializes the current call state object and sends the new call event
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, 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

ENVIRONMENTTOOLS_PATH

public static final java.lang.String ENVIRONMENTTOOLS_PATH
The path to the EnvironmentTools component

See Also:
Constant Field Values

DEFAULT_TICKET_CREATE_CHANNEL

public static final java.lang.String DEFAULT_TICKET_CREATE_CHANNEL
Creation channel used to create a new ticket when a channel isn't provided

See Also:
Constant Field Values

VIEW_TICKET_HOLDER_COMPONENT_PATH

public static final java.lang.String VIEW_TICKET_HOLDER_COMPONENT_PATH
view ticket holder component path

See Also:
Constant Field Values

VIEW_CUSTOMER_PROFILE_COMPONENT_PATH

public static final java.lang.String VIEW_CUSTOMER_PROFILE_COMPONENT_PATH
The view customer profile component path

See Also:
Constant Field Values

AGENT_PROFILE_COMPONENT_PATH

public static final java.lang.String AGENT_PROFILE_COMPONENT_PATH
The agent profile component path

See Also:
Constant Field Values

CALL_STATE_COMPONENT_PATH

public static final java.lang.String CALL_STATE_COMPONENT_PATH
The call state component path

See Also:
Constant Field Values

mMessageTools

protected atg.web.messaging.MessageTools mMessageTools

mAgentUserType

protected java.lang.String mAgentUserType

mInternalProfileRepository

protected atg.repository.Repository mInternalProfileRepository

mEventTools

protected atg.svc.agent.events.EventTools mEventTools
Used to record agent audit recoder events used for reporting and external integration hooks


mAgentApplicationName

protected java.lang.String mAgentApplicationName

mTicketingTools

protected TicketingTools mTicketingTools

mTicketingManager

protected atg.ticketing.TicketingManager mTicketingManager

mEnvironmentMonitors

protected EnvironmentMonitor[] mEnvironmentMonitors
Constructor Detail

EnvironmentTools

public EnvironmentTools()
Method Detail

getInstance

public static EnvironmentTools getInstance()
Returns the global EnvironmentTools component by resolving it from the current request.

Returns:
CSREnvironmentTools

getMessageTools

public atg.web.messaging.MessageTools getMessageTools()
Returns the MessageTools component

Returns:
MessageTools

setMessageTools

public void setMessageTools(atg.web.messaging.MessageTools pMessageTools)

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

getAgentUserType

public java.lang.String getAgentUserType()
Defines the base item type for agent profiles

Returns:
String

setAgentUserType

public void setAgentUserType(java.lang.String pAgentUserType)

getInternalProfileRepository

public atg.repository.Repository getInternalProfileRepository()
The interna; profile repository

Returns:
Repository

setInternalProfileRepository

public void setInternalProfileRepository(atg.repository.Repository pInternalProfileRepository)

getEventTools

public atg.svc.agent.events.EventTools getEventTools()

setEventTools

public void setEventTools(atg.svc.agent.events.EventTools pEventTools)

getAgentApplicationName

public java.lang.String getAgentApplicationName()
Returns:
the name of the agent application

setAgentApplicationName

public void setAgentApplicationName(java.lang.String pAgentApplicationName)

getTicketingTools

public TicketingTools getTicketingTools()

setTicketingTools

public void setTicketingTools(TicketingTools pTicketingTools)

setTicketingManager

public void setTicketingManager(atg.ticketing.TicketingManager pTicketingManager)
sets the configured TicketManager


getTicketingManager

public atg.ticketing.TicketingManager getTicketingManager()
Returns:
the configured TicketManager

getEnvironmentMonitors

public EnvironmentMonitor[] getEnvironmentMonitors()
Returns the configured array of EnvironmentMonitor components.

These components are called back for various changes made in the environment.

Returns:
array of moinitors.

setEnvironmentMonitors

public void setEnvironmentMonitors(EnvironmentMonitor[] pEnvironmentMonitors)

setProfileTools

public void setProfileTools(atg.userprofiling.ProfileTools pProfileTools)
Sets the ProfileTools component

Parameters:
pProfileTools - the ProfileTools component

getProfileTools

public atg.userprofiling.ProfileTools getProfileTools()
The ProfileTools component

Returns:
the ProfileTools component

generateChangeDetails

public void generateChangeDetails(EnvironmentChangeState pEnvironmentChangeState)
                           throws EnvironmentException
Generates the List of EnvironmentChangeDetails for the given environment change.

Each monitor is called to create and add their EnvironmentChangeDetail objects.

Parameters:
pEnvironmentChangeState -
Throws:
EnvironmentException
See Also:
EnvironmentMonitor.generateChangeDetails(EnvironmentChangeState, EnvironmentChangeDetail)

applyChanges

public void applyChanges(EnvironmentChangeState pEnvironmentChangeState)
                  throws EnvironmentException
Calls each EnvironmentMonitor to apply the change details in the EnvironmentChangeState

This process executes three methods on the monitor interface: preApplyChanges, applyChanges and postApplyChanges.

EnvironmentExceptions thrown by the monitors in the preApplyChanges method will result in the change being aborted.

EnvironmentExceptions thrown by the monitors in the applyChanges method will result in the transaction being marked for roll back and each monitor that was called to apply will be called to revert their change through the revertChanges interface.

EnvironmentExceptions thrown by the monitors in the postApplyChanges method will be logged but will not cause a revert of the change. Monitors should not execute code that could cause a transaction roll back in postApplyChanges as it could lead to an inconsistent state in the application.

Parameters:
pEnvironmentChangeState -
Throws:
EnvironmentException
See Also:
EnvironmentMonitor.preApplyChanges(EnvironmentChangeState), EnvironmentMonitor.applyChanges(EnvironmentChangeState), EnvironmentMonitor.postApplyChanges(EnvironmentChangeState), EnvironmentMonitor.revertChanges(EnvironmentChangeState)

createWarningsForChangeEnvironment

public void createWarningsForChangeEnvironment(EnvironmentChangeState pEnvironmentChangeState)
                                        throws EnvironmentException
Calls each EnvironmentMonitor to add warnings related to the EnvironmentChangeState related to the pending changes detailed in the state.

Parameters:
pEnvironmentChangeState -
Throws:
EnvironmentException

getActiveTicket

public atg.repository.RepositoryItem getActiveTicket()
Returns the active ticket from the environment.

Returns:
the active ticket from the environment.

getActiveTicketId

public java.lang.String getActiveTicketId()
Returns the active ticket id

Returns:
active ticket id

getViewTicket

public atg.repository.RepositoryItem getViewTicket()
Returns the view ticket from the holder.

Returns:
view ticket repository item

setViewTicket

public void setViewTicket(atg.repository.RepositoryItem pTicket)
                   throws EnvironmentException
Sets the view ticket to the given ticket

Throws:
EnvironmentException

getActiveCustomerProfileComponent

public atg.userprofiling.Profile getActiveCustomerProfileComponent()
Returns the active customer profile component.

Returns:
active customer profile component.

getActiveCustomerProfile

public atg.repository.RepositoryItem getActiveCustomerProfile()
Returns the active customer profile item.

Returns:
the active customer profile item.

getViewCustomerProfileComponent

public atg.userprofiling.Profile getViewCustomerProfileComponent()
Returns view customer profile component

Returns:
view customer profile component

getViewCustomerProfile

public atg.repository.RepositoryItem getViewCustomerProfile()
Returns the view customer profile

Returns:
the view customer profile

setViewCustomerProfile

public void setViewCustomerProfile(atg.repository.RepositoryItem pProfile)
                            throws EnvironmentException
Sets the view profile datasource to the given profile repository item.

Parameters:
pProfile - the profile repository item.
Throws:
EnvironmentException

getAgentProfile

public atg.userprofiling.Profile getAgentProfile()
Returns the agent profile component.

Returns:
the agent profile component.

getCallState

public CallState getCallState()
returns the call state

Returns:
CallState

initializeEnvironmentChangeState

public void initializeEnvironmentChangeState(EnvironmentChangeState pEnvironmentChangeState,
                                             java.lang.String pApplicationName,
                                             java.lang.String pEnvironmentChangeKey,
                                             java.util.Map pInputParameters,
                                             TicketDispositionOptions pTicketDispositionOptions,
                                             boolean pIncludeWarnings)
                                      throws EnvironmentException
This method initializes the given EnvironmentChangeState for the given change key and input parameters.

As part of this process the monitors are called to generate the change details and the property processActiveTicketDisposition is set based on the call to isProcessDisposition

If the ticket disposition option is not set, it is set based on whether the ticket is automatically discardable as determined by the ticket manager.

Parameters:
pEnvironmentChangeState -
pApplicationName - The application name initializing the state
pEnvironmentChangeKey -
pInputParameters -
pTicketDispositionOptions -
pIncludeWarnings -
Throws:
EnvironmentException
See Also:
generateChangeDetails(EnvironmentChangeState), isProcessDisposition(EnvironmentChangeState)

initializeChange

public EnvironmentChangeState initializeChange(java.lang.String pApplicationName,
                                               java.lang.String pEnvironmentChangeKey,
                                               java.util.Map pInputParameters,
                                               TicketDispositionOptions pTicketDispositionOptions,
                                               boolean pIncludeWarnings)
                                        throws EnvironmentException
Initializes a change to the environment and returns the assoicated state object.

Parameters:
pApplicationName - The application initializing the change
pEnvironmentChangeKey -
pInputParameters -
pTicketDispositionOptions -
pIncludeWarnings -
Returns:
EnvironmentChangeState
Throws:
EnvironmentException

createEnvironmentChangeState

public EnvironmentChangeState createEnvironmentChangeState()
Returns a new EnvironmentChangeState object

Returns:
EnvironmentChangeState

loadNewProfile

public boolean loadNewProfile(java.lang.String pProfileId,
                              atg.userprofiling.Profile pProfile)
Loads a profile item into the given profile.

Parameters:
pProfileId -
Returns:
true if the load was successful

loadNewAnonymousProfile

public boolean loadNewAnonymousProfile(java.lang.String pProfileId)
                                throws EnvironmentException
This method will sets up a new anonymous profile into the active customer profile.

Returns:
boolean indicating if a profile was successfully loaded
Throws:
atg.repository.RepositoryException
EnvironmentException
See Also:
loadNewAnonymousProfile(String, Profile)

loadNewAnonymousProfile

public boolean loadNewAnonymousProfile(java.lang.String pProfileId,
                                       atg.userprofiling.Profile pProfile)
                                throws EnvironmentException
This method will sets up a new anonymous profile item into the given profile object.

Parameters:
pProfileId - the profile to assign to the new item
pProfile - the profile object that will have its datasource set.
Returns:
boolean indicating if a profile was successfully loaded
Throws:
atg.repository.RepositoryException
EnvironmentException
See Also:
initializeDefaultsForProfile(MutableRepositoryItem)

changeUser

public void changeUser(atg.repository.RepositoryItem pNewProfile,
                       atg.userprofiling.Profile pCustomerProfile)
                throws EnvironmentException
This method loads a new customer profile into the customer profile object.

Parameters:
pNewProfile - the profile to load
pCustomerProfile - the profile object in which to load the new profile.
Throws:
atg.repository.RepositoryException
EnvironmentException

changeUser

public void changeUser(java.lang.String pNewProfileId,
                       atg.userprofiling.Profile pCustomerProfile)
                throws EnvironmentException
Loads a new profile into the customer profile object.

If the new profile id is null or cannot be found, a new anonymous profile is loaded into the profile object.

Parameters:
pNewProfileId -
pCustomerProfile -
Throws:
EnvironmentException

initializeDefaultsForProfile

public void initializeDefaultsForProfile(atg.repository.MutableRepositoryItem pProfile)
                                  throws EnvironmentException
Calls back to each EnvironmentMonitor to initialize the default values of a new profile.

Parameters:
pProfile - the new profile.
Throws:
EnvironmentException

doesProfileExist

public boolean doesProfileExist(java.lang.String pProfileId)
Determines if a profile exists with the given id

Parameters:
pProfileId -
Returns:
true if a profile exists with the given id

addNewActiveProfileDetail

public void addNewActiveProfileDetail(java.lang.String pProfileId,
                                      EnvironmentChangeState pEnvironmentChangeState)
                               throws atg.svc.agent.environment.EnvironmentChangeDetailConflict,
                                      EnvironmentException
Adds an EnvironmentChangeDetail for a new active customer profile change.

Parameters:
pProfileId - this parameter is optional. If specified, the new profile will have this id assigned to it.
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentChangeDetailConflict
EnvironmentException

addNewActiveTicketDetail

public void addNewActiveTicketDetail(EnvironmentChangeState pEnvironmentChangeState)
                              throws atg.svc.agent.environment.EnvironmentChangeDetailConflict,
                                     EnvironmentException
Adds a EnvironmentChangeDetail to the EnvironmentChangeState that indicates a new ticket ticket item. a change to create a new ticket item.

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentChangeDetailConflict
EnvironmentException

addChangeActiveTicketDetail

public void addChangeActiveTicketDetail(java.lang.String pTicketId,
                                        EnvironmentChangeState pEnvironmentChangeState)
                                 throws atg.svc.agent.environment.EnvironmentChangeDetailConflict,
                                        EnvironmentException
Adds a EnvironmentChangeDetail to the EnvironmentChangeState that indicates a change to the active ticket item. The new ticket is loaded from the repository and included in the EnvironmentChangeDetail.

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentChangeDetailConflict
EnvironmentException

addChangeActiveProfileDetail

public void addChangeActiveProfileDetail(java.lang.String pProfileId,
                                         EnvironmentChangeState pEnvironmentChangeState)
                                  throws atg.svc.agent.environment.EnvironmentChangeDetailConflict,
                                         EnvironmentException
Adds a EnvironmentChangeDetail to the EnvironmentChangeState that indicates a change to the active profile item. The new profile is loaded from the repository and included in the EnvironmentChangeDetail.

Parameters:
pEnvironmentChangeState -
Throws:
atg.svc.agent.environment.EnvironmentChangeDetailConflict
EnvironmentException

processTicketDisposition

public void processTicketDisposition(atg.repository.RepositoryItem pTicket,
                                     TicketDispositionOptions pTicketDispositionOptions,
                                     java.lang.String pApplicationName)
                              throws EnvironmentException
Processes the ticket according the disposition options.

Parameters:
pTicket -
pTicketDispositionOptions -
pApplicationName -
Throws:
EnvironmentException

initializeEnvironment

public void initializeEnvironment()
                           throws EnvironmentException
Initializes the environment

Throws:
EnvironmentException

changeActiveTicket

public void changeActiveTicket(java.lang.String pApplicationName,
                               java.lang.String pTicketId,
                               TicketDispositionOptions pTicketDispositionOptions)
                        throws EnvironmentException
Changes the environment's active ticket to the given ticket

Parameters:
pApplicationName -
pTicketId - id of the ticket to be loaded into the environment.
pTicketDispositionOptions - the options used to modify the disposition the currently active ticket before the change.
Throws:
EnvironmentException

changeNewActiveTicket

public void changeNewActiveTicket(java.lang.String pApplicationName)
                           throws EnvironmentException
Changes the environment's active ticket to a new ticket

Parameters:
pApplicationName -
Throws:
EnvironmentException

isProcessDisposition

public boolean isProcessDisposition(EnvironmentChangeState pEnvironmentChangeState)
Determines if the ticket disposition handling is necessary for the given change by checking if the ticket is changing or the change is a logoff.

Returns:
true if the ticket disposition is necessary

getEnvironmentObject

public java.lang.Object getEnvironmentObject(java.lang.String pEnvironmentObjectName)
Returns the environment object for the given name. The environment monitors are polled until one comes back with an object for the given name

Parameters:
pEnvironmentObjectName -
Returns:
environment object
Throws:
EnvironmentException

getProfileFromDetail

public atg.repository.RepositoryItem getProfileFromDetail(EnvironmentChangeDetail pEnvironmentChangeDetail)
                                                   throws EnvironmentException
Returns the profile repository item from the change detail.

If the detail is for a new profile, a new item is created and returned.

Parameters:
pEnvironmentChangeDetail -
Returns:
profile repository item
Throws:
EnvironmentException

loadViewProfile

public void loadViewProfile(java.lang.String pProfileId)
                     throws EnvironmentException
Loads the given profile into the view profile component.

If the profile doesn't exist in the Repository a new one will be created and loaded.

Parameters:
pProfileId -
Throws:
EnvironmentException
See Also:
loadNewProfile(String, Profile), loadNewAnonymousProfile(String, Profile)

startCall

public void startCall(EnvironmentChangeState pEnvironmentChangeState)
Initializes the current call state object and sends the new call event

Parameters:
pEnvironmentChangeState - the change state
See Also:
CallState.initializeNewCall()

endCall

public void endCall(EnvironmentChangeState pEnvironmentChangeState)
Ends the call in the the current call state and sends end call event.

Parameters:
pEnvironmentChangeState - the change state
See Also:
CallState.endCall()

isTransactionMarkedAsRollBack

public boolean isTransactionMarkedAsRollBack()
Returns true if the transaction associated with the current thread is marked for rollback.


markTransactionForRollback

public boolean markTransactionForRollback()
Returns true if the transaction has been marked for rollback, false if unable to access the transaction.


getUserLocale

public java.util.Locale getUserLocale()
This method gets the current user Locale from the request. If the request is null or no request locale exists, the JVM's default locale is returned.

Returns:
the current Locale

isTestRevert

public boolean isTestRevert()

setTestRevert

public void setTestRevert(boolean pTestRevert)