|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.svc.agent.environment.EnvironmentTools
public class EnvironmentTools
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 |
---|
public static final java.lang.String CLASS_VERSION
public static final java.lang.String ENVIRONMENTTOOLS_PATH
public static final java.lang.String DEFAULT_TICKET_CREATE_CHANNEL
public static final java.lang.String VIEW_TICKET_HOLDER_COMPONENT_PATH
public static final java.lang.String VIEW_CUSTOMER_PROFILE_COMPONENT_PATH
public static final java.lang.String AGENT_PROFILE_COMPONENT_PATH
public static final java.lang.String CALL_STATE_COMPONENT_PATH
protected atg.web.messaging.MessageTools mMessageTools
protected java.lang.String mAgentUserType
protected atg.repository.Repository mInternalProfileRepository
protected atg.svc.agent.events.EventTools mEventTools
protected java.lang.String mAgentApplicationName
protected TicketingTools mTicketingTools
protected atg.ticketing.TicketingManager mTicketingManager
protected EnvironmentMonitor[] mEnvironmentMonitors
Constructor Detail |
---|
public EnvironmentTools()
Method Detail |
---|
public static EnvironmentTools getInstance()
public atg.web.messaging.MessageTools getMessageTools()
public void setMessageTools(atg.web.messaging.MessageTools pMessageTools)
public void setAgentMessagingTools(atg.agent.events.AgentMessagingTools pAgentMessagingTools)
pAgentMessagingTools
- public atg.agent.events.AgentMessagingTools getAgentMessagingTools()
public java.lang.String getAgentUserType()
public void setAgentUserType(java.lang.String pAgentUserType)
public atg.repository.Repository getInternalProfileRepository()
public void setInternalProfileRepository(atg.repository.Repository pInternalProfileRepository)
public atg.svc.agent.events.EventTools getEventTools()
public void setEventTools(atg.svc.agent.events.EventTools pEventTools)
public java.lang.String getAgentApplicationName()
public void setAgentApplicationName(java.lang.String pAgentApplicationName)
public TicketingTools getTicketingTools()
public void setTicketingTools(TicketingTools pTicketingTools)
public void setTicketingManager(atg.ticketing.TicketingManager pTicketingManager)
public atg.ticketing.TicketingManager getTicketingManager()
public EnvironmentMonitor[] getEnvironmentMonitors()
EnvironmentMonitor
components.
These components are called back for various changes made in the environment.
public void setEnvironmentMonitors(EnvironmentMonitor[] pEnvironmentMonitors)
public void setProfileTools(atg.userprofiling.ProfileTools pProfileTools)
pProfileTools
- the ProfileTools componentpublic atg.userprofiling.ProfileTools getProfileTools()
public void generateChangeDetails(EnvironmentChangeState pEnvironmentChangeState) throws EnvironmentException
Each monitor is called to create and add their EnvironmentChangeDetail
objects.
pEnvironmentChangeState
-
EnvironmentException
EnvironmentMonitor.generateChangeDetails(EnvironmentChangeState, EnvironmentChangeDetail)
public void applyChanges(EnvironmentChangeState pEnvironmentChangeState) throws EnvironmentException
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.
pEnvironmentChangeState
-
EnvironmentException
EnvironmentMonitor.preApplyChanges(EnvironmentChangeState)
,
EnvironmentMonitor.applyChanges(EnvironmentChangeState)
,
EnvironmentMonitor.postApplyChanges(EnvironmentChangeState)
,
EnvironmentMonitor.revertChanges(EnvironmentChangeState)
public void createWarningsForChangeEnvironment(EnvironmentChangeState pEnvironmentChangeState) throws EnvironmentException
EnvironmentChangeState
related to the pending changes
detailed in the state.
pEnvironmentChangeState
-
EnvironmentException
public atg.repository.RepositoryItem getActiveTicket()
public java.lang.String getActiveTicketId()
public atg.repository.RepositoryItem getViewTicket()
public void setViewTicket(atg.repository.RepositoryItem pTicket) throws EnvironmentException
EnvironmentException
public atg.userprofiling.Profile getActiveCustomerProfileComponent()
public atg.repository.RepositoryItem getActiveCustomerProfile()
public atg.userprofiling.Profile getViewCustomerProfileComponent()
public atg.repository.RepositoryItem getViewCustomerProfile()
public void setViewCustomerProfile(atg.repository.RepositoryItem pProfile) throws EnvironmentException
pProfile
- the profile repository item.
EnvironmentException
public atg.userprofiling.Profile getAgentProfile()
public CallState getCallState()
public void initializeEnvironmentChangeState(EnvironmentChangeState pEnvironmentChangeState, java.lang.String pApplicationName, java.lang.String pEnvironmentChangeKey, java.util.Map pInputParameters, TicketDispositionOptions pTicketDispositionOptions, boolean pIncludeWarnings) throws EnvironmentException
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
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.
processActiveTicketDisposition
is set based on the
call to isProcessDisposition
pEnvironmentChangeState
- pApplicationName
- The application name initializing the statepEnvironmentChangeKey
- pInputParameters
- pTicketDispositionOptions
- pIncludeWarnings
-
EnvironmentException
generateChangeDetails(EnvironmentChangeState)
,
isProcessDisposition(EnvironmentChangeState)
public EnvironmentChangeState initializeChange(java.lang.String pApplicationName, java.lang.String pEnvironmentChangeKey, java.util.Map pInputParameters, TicketDispositionOptions pTicketDispositionOptions, boolean pIncludeWarnings) throws EnvironmentException
pApplicationName
- The application initializing the changepEnvironmentChangeKey
- pInputParameters
- pTicketDispositionOptions
- pIncludeWarnings
-
EnvironmentException
public EnvironmentChangeState createEnvironmentChangeState()
EnvironmentChangeState
object
public boolean loadNewProfile(java.lang.String pProfileId, atg.userprofiling.Profile pProfile)
pProfileId
-
public boolean loadNewAnonymousProfile(java.lang.String pProfileId) throws EnvironmentException
atg.repository.RepositoryException
EnvironmentException
loadNewAnonymousProfile(String, Profile)
public boolean loadNewAnonymousProfile(java.lang.String pProfileId, atg.userprofiling.Profile pProfile) throws EnvironmentException
pProfileId
- the profile to assign to the new itempProfile
- the profile object that will have its datasource set.
atg.repository.RepositoryException
EnvironmentException
initializeDefaultsForProfile(MutableRepositoryItem)
public void changeUser(atg.repository.RepositoryItem pNewProfile, atg.userprofiling.Profile pCustomerProfile) throws EnvironmentException
pNewProfile
- the profile to loadpCustomerProfile
- the profile object in which to load the new profile.
atg.repository.RepositoryException
EnvironmentException
public void changeUser(java.lang.String pNewProfileId, atg.userprofiling.Profile pCustomerProfile) throws EnvironmentException
If the new profile id is null or cannot be found, a new anonymous profile is loaded into the profile object.
pNewProfileId
- pCustomerProfile
-
EnvironmentException
public void initializeDefaultsForProfile(atg.repository.MutableRepositoryItem pProfile) throws EnvironmentException
EnvironmentMonitor
to initialize the default values
of a new profile.
pProfile
- the new profile.
EnvironmentException
public boolean doesProfileExist(java.lang.String pProfileId)
pProfileId
-
public void addNewActiveProfileDetail(java.lang.String pProfileId, EnvironmentChangeState pEnvironmentChangeState) throws atg.svc.agent.environment.EnvironmentChangeDetailConflict, EnvironmentException
pProfileId
- this parameter is optional. If specified, the new profile will have this id assigned to it.pEnvironmentChangeState
-
atg.svc.agent.environment.EnvironmentChangeDetailConflict
EnvironmentException
public void addNewActiveTicketDetail(EnvironmentChangeState pEnvironmentChangeState) throws atg.svc.agent.environment.EnvironmentChangeDetailConflict, EnvironmentException
pEnvironmentChangeState
-
atg.svc.agent.environment.EnvironmentChangeDetailConflict
EnvironmentException
public void addChangeActiveTicketDetail(java.lang.String pTicketId, EnvironmentChangeState pEnvironmentChangeState) throws atg.svc.agent.environment.EnvironmentChangeDetailConflict, EnvironmentException
pEnvironmentChangeState
-
atg.svc.agent.environment.EnvironmentChangeDetailConflict
EnvironmentException
public void addChangeActiveProfileDetail(java.lang.String pProfileId, EnvironmentChangeState pEnvironmentChangeState) throws atg.svc.agent.environment.EnvironmentChangeDetailConflict, EnvironmentException
pEnvironmentChangeState
-
atg.svc.agent.environment.EnvironmentChangeDetailConflict
EnvironmentException
public void processTicketDisposition(atg.repository.RepositoryItem pTicket, TicketDispositionOptions pTicketDispositionOptions, java.lang.String pApplicationName) throws EnvironmentException
pTicket
- pTicketDispositionOptions
- pApplicationName
-
EnvironmentException
public void initializeEnvironment() throws EnvironmentException
EnvironmentException
public void changeActiveTicket(java.lang.String pApplicationName, java.lang.String pTicketId, TicketDispositionOptions pTicketDispositionOptions) throws EnvironmentException
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.
EnvironmentException
public void changeNewActiveTicket(java.lang.String pApplicationName) throws EnvironmentException
pApplicationName
-
EnvironmentException
public boolean isProcessDisposition(EnvironmentChangeState pEnvironmentChangeState)
public java.lang.Object getEnvironmentObject(java.lang.String pEnvironmentObjectName)
pEnvironmentObjectName
-
EnvironmentException
public atg.repository.RepositoryItem getProfileFromDetail(EnvironmentChangeDetail pEnvironmentChangeDetail) throws EnvironmentException
If the detail is for a new profile, a new item is created and returned.
pEnvironmentChangeDetail
-
EnvironmentException
public void loadViewProfile(java.lang.String pProfileId) throws EnvironmentException
If the profile doesn't exist in the Repository a new one will be created and loaded.
pProfileId
-
EnvironmentException
loadNewProfile(String, Profile)
,
loadNewAnonymousProfile(String, Profile)
public void startCall(EnvironmentChangeState pEnvironmentChangeState)
pEnvironmentChangeState
- the change stateCallState.initializeNewCall()
public void endCall(EnvironmentChangeState pEnvironmentChangeState)
pEnvironmentChangeState
- the change stateCallState.endCall()
public boolean isTransactionMarkedAsRollBack()
public boolean markTransactionForRollback()
public java.util.Locale getUserLocale()
public boolean isTestRevert()
public void setTestRevert(boolean pTestRevert)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |