atg.svc.agent.environment
Class EnvironmentChangeState

java.lang.Object
  extended by atg.svc.agent.environment.EnvironmentChangeState

public class EnvironmentChangeState
extends java.lang.Object

This object contains state information related to a change in the agent's environment.

It provides the following:

Access to all the EnvironmentChangeDetails that detail the changes made to the environment.

API for adding new EnvironemtChangeDetails.

Access to the input parameters for the environment change.

Access to the disposition options used to process the active ticket before a change is applied.

There's also an api for storing and retrieving random objects related to the environment change.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.util.List mAllWarnings
           
protected  java.lang.String mApplicationName
           
protected  java.lang.Throwable mApplyException
           
protected  java.lang.String mChangeFormHandlerPath
           
protected  java.util.Map mEnvironmentChangeDetails
           
protected  java.lang.String mEnvironmentChangeKey
           
protected  java.util.Map mInputParameters
           
protected  boolean mProcessActiveTicketDisposition
           
protected  java.util.Map mStateData
           
protected  TicketDispositionOptions mTicketDispositionOptions
           
 
Constructor Summary
EnvironmentChangeState()
           
EnvironmentChangeState(java.lang.String pEnvironmentChangeKey)
           
 
Method Summary
 void addChangeDetail(EnvironmentChangeDetail pEnvironmentChangeDetail)
          Adds a new EnvironmentChangeDetail.
 void addStateData(java.lang.Object pStateDataKey, java.lang.Object pStateDataObject)
          Adds the extra data object keyed by the given object
 void addWarning(java.lang.String pWarning)
          Adds a new warning to the list of warnings in the state
 void addWarnings(java.util.List pWarnings)
          Adds a list of warnings to the warnings in the state
 EnvironmentChangeDetail getActiveCustomerDetail()
          returns the active customer EnvironmentChangeDetail, if there is one in the state.
 EnvironmentChangeDetail getActiveTicketDetail()
          returns the active ticket EnvironmentChangeDetail, if there is one in the state.
 java.util.List getAllWarnings()
          Returns the list of warnings in the state
 java.lang.String getApplicationName()
          The application name that initiated the change
 java.lang.Throwable getApplyException()
          Returns the exception that was thrown during the apply process
 java.lang.String getChangeFormHandlerPath()
          Returns the nucleus path of the EnvironmentChangeFormHandler that initiated the environment change.
 EnvironmentChangeDetail getEnvironmentChangeDetail(java.lang.String pEnvironmentObjectName)
           
 java.lang.String getEnvironmentChangeDetailNewId(java.lang.String pEnvironmentObjectName)
          Returns the newObjectId property for the EnvironmentChangeDetail object under the given name.
protected  java.util.Map getEnvironmentChangeDetails()
          Returns the map of EnvironmentChangeDetail objects that detail the changes to the environment.
 EnvironmentChangeFormHandler getEnvironmentChangeFormHandler()
          This property contains the original instance of the form handler that initiated the change
 java.lang.String getEnvironmentChangeKey()
           
 java.util.List getEnvironmentChanges()
          Returns a read only List view of the EnvironmentChangeDetails currently in the state.
 java.lang.Object getInputParameter(java.lang.String pParameterName)
          returns the input parameter with the given name.
 java.util.Map getInputParameters()
          Returns the change input parameter map
 java.lang.String getNewActiveCustomerId()
          Convenience method for returning the profile id of the new active customer that will be loaded as the part of this change.
 java.lang.String getNewActiveTicketId()
          Convenience method for returning the ticket id of the ticket that will be loaded as part of the change.
 java.lang.Object getStateData(java.lang.Object pStateDataKey)
          Returns the extra data object keyed by the given object
protected  java.util.Map getStateDataMap()
          Returns the extra data map.
 TicketDispositionOptions getTicketDispositionOptions()
          This method will lazily create an instance of TicketDispositionOptions if one doesn't already exist.
 void initialize(java.lang.String pApplicationName, java.lang.String pEnvironmentChangeKey, java.util.Map pInputParameters)
          Initializes the state with the given change key and input parameters.
 void initialize(java.lang.String pApplicationName, java.lang.String pEnvironmentChangeKey, java.util.Map pInputParameters, TicketDispositionOptions pTicketDispositionOptions)
          Initializes the state with the given change key,input parameters and ticket disposition options
 boolean isActiveCustomerChanging()
          Returns true in the state contains a change detail for the active customer.
 boolean isActiveTicketChanging()
          Returns true in the state contains a change detail for the active ticket.
 boolean isChangeDetail(java.lang.String pObjectName)
          returns true if there's a change detail for the given object name
 boolean isNewActiveCustomerDetail()
          Convenience method for determining if the environment change includes a brand new active customer.
 boolean isNewActiveTicketDetail()
          Convenience method for determining if the environment change includes a brand new ticket item.
 boolean isNewObjectEnvironmentChangeDetail(java.lang.String pEnvironmentObjectName)
          Determines if the EnvironmentChangeDetail object for the given object name has its newObjectRequired property set to true.
 boolean isProcessActiveTicketDisposition()
          This flag determines if the active ticket will be processed using the ticket disposition options before the change is applied.
 boolean isWarnings()
          Determines if there are warnings in the state
 void removeStateData(java.lang.Object pStateDataKey)
          Removes the extra data object keyed by the given object
 void setApplicationName(java.lang.String pApplicationName)
          Sets the application name that initiated the change
 void setApplyException(java.lang.Throwable pApplyException)
           
 void setChangeFormHandlerPath(java.lang.String pChangeFormHandlerPath)
           
 void setEnvironmentChangeFormHandler(EnvironmentChangeFormHandler pEnvironmentChangeFormHandler)
           
 void setEnvironmentChangeKey(java.lang.String pEnvironmentChangeKey)
           
 void setInputParameters(java.util.Map pInputParameters)
           
 void setProcessActiveTicketDisposition(boolean pProcessActiveTicketDisposition)
           
 void setTicketDispositionOptions(TicketDispositionOptions pTicketDispositionOptions)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

mApplicationName

protected java.lang.String mApplicationName

mStateData

protected java.util.Map mStateData

mInputParameters

protected java.util.Map mInputParameters

mEnvironmentChangeKey

protected java.lang.String mEnvironmentChangeKey

mEnvironmentChangeDetails

protected java.util.Map mEnvironmentChangeDetails

mChangeFormHandlerPath

protected java.lang.String mChangeFormHandlerPath

mAllWarnings

protected java.util.List mAllWarnings

mTicketDispositionOptions

protected TicketDispositionOptions mTicketDispositionOptions

mProcessActiveTicketDisposition

protected boolean mProcessActiveTicketDisposition

mApplyException

protected java.lang.Throwable mApplyException
Constructor Detail

EnvironmentChangeState

public EnvironmentChangeState()

EnvironmentChangeState

public EnvironmentChangeState(java.lang.String pEnvironmentChangeKey)
Method Detail

initialize

public void initialize(java.lang.String pApplicationName,
                       java.lang.String pEnvironmentChangeKey,
                       java.util.Map pInputParameters)
Initializes the state with the given change key and input parameters.

Parameters:
pApplicationName -

initialize

public void initialize(java.lang.String pApplicationName,
                       java.lang.String pEnvironmentChangeKey,
                       java.util.Map pInputParameters,
                       TicketDispositionOptions pTicketDispositionOptions)
Initializes the state with the given change key,input parameters and ticket disposition options


getApplicationName

public java.lang.String getApplicationName()
The application name that initiated the change

Returns:
The application name that initiated the change

setApplicationName

public void setApplicationName(java.lang.String pApplicationName)
Sets the application name that initiated the change


getStateDataMap

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

Returns:
Map

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 -

getInputParameters

public java.util.Map getInputParameters()
Returns the change input parameter map

Returns:
map of input parameters

setInputParameters

public void setInputParameters(java.util.Map pInputParameters)

getInputParameter

public java.lang.Object getInputParameter(java.lang.String pParameterName)
returns the input parameter with the given name.

Parameters:
pParameterName -
Returns:
parameter value

getEnvironmentChangeKey

public java.lang.String getEnvironmentChangeKey()

setEnvironmentChangeKey

public void setEnvironmentChangeKey(java.lang.String pEnvironmentChangeKey)

getEnvironmentChangeDetails

protected java.util.Map getEnvironmentChangeDetails()
Returns the map of EnvironmentChangeDetail objects that detail the changes to the environment.

Returns:
Map

addChangeDetail

public void addChangeDetail(EnvironmentChangeDetail pEnvironmentChangeDetail)
                     throws atg.svc.agent.environment.EnvironmentChangeDetailConflict,
                            EnvironmentException
Adds a new EnvironmentChangeDetail.

If a change detail alerady exists for its name and that detail is equal to the new one, the new one is ignored. If the the new detail conflicts with the existing detail, a EnvironmentChangeDetailConflict is thrown.

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

getEnvironmentChangeDetail

public EnvironmentChangeDetail getEnvironmentChangeDetail(java.lang.String pEnvironmentObjectName)
Parameters:
pEnvironmentObjectName - the name of the for which to return the change detail.
Returns:
EnvironmentChangeDetail for the given object name

getEnvironmentChanges

public java.util.List getEnvironmentChanges()
Returns a read only List view of the EnvironmentChangeDetails currently in the state.

Returns:
read only List of the current EnvironmentChangeDetails in the state

isNewObjectEnvironmentChangeDetail

public boolean isNewObjectEnvironmentChangeDetail(java.lang.String pEnvironmentObjectName)
Determines if the EnvironmentChangeDetail object for the given object name has its newObjectRequired property set to true.

If the detail object cannot be found for the given name, the return is false.

Parameters:
pEnvironmentObjectName -
Returns:
boolean

getEnvironmentChangeDetailNewId

public java.lang.String getEnvironmentChangeDetailNewId(java.lang.String pEnvironmentObjectName)
Returns the newObjectId property for the EnvironmentChangeDetail object under the given name.

Parameters:
pEnvironmentObjectName -
Returns:
String

getChangeFormHandlerPath

public java.lang.String getChangeFormHandlerPath()
Returns the nucleus path of the EnvironmentChangeFormHandler that initiated the environment change. This property is used on the confirmation page to gain access to the originating form handler.

Returns:
the nucleus path of the EnvironmentChangeFormHandler that initiated the environment change

setChangeFormHandlerPath

public void setChangeFormHandlerPath(java.lang.String pChangeFormHandlerPath)

getEnvironmentChangeFormHandler

public EnvironmentChangeFormHandler getEnvironmentChangeFormHandler()
This property contains the original instance of the form handler that initiated the change

Returns:
EnvironmentChangeFormHandler

setEnvironmentChangeFormHandler

public void setEnvironmentChangeFormHandler(EnvironmentChangeFormHandler pEnvironmentChangeFormHandler)

isNewActiveCustomerDetail

public boolean isNewActiveCustomerDetail()
Convenience method for determining if the environment change includes a brand new active customer.

Returns:
true if the environment change includes a brand new profile item.

getNewActiveCustomerId

public java.lang.String getNewActiveCustomerId()
Convenience method for returning the profile id of the new active customer that will be loaded as the part of this change.

Returns:
profile id of the profile that will be loaded as part of the change.

isNewActiveTicketDetail

public boolean isNewActiveTicketDetail()
Convenience method for determining if the environment change includes a brand new ticket item.

Returns:
true if the environment change includes a brand new ticket item.

getNewActiveTicketId

public java.lang.String getNewActiveTicketId()
Convenience method for returning the ticket id of the ticket that will be loaded as part of the change.

Returns:
ticket id of the ticket that will be loaded as part of the change.

isActiveTicketChanging

public boolean isActiveTicketChanging()
Returns true in the state contains a change detail for the active ticket.

Returns:
true if there's a change detail for the ticket.

getActiveTicketDetail

public EnvironmentChangeDetail getActiveTicketDetail()
returns the active ticket EnvironmentChangeDetail, if there is one in the state.

Returns:
EnvironmentChangeDetail

getActiveCustomerDetail

public EnvironmentChangeDetail getActiveCustomerDetail()
returns the active customer EnvironmentChangeDetail, if there is one in the state.

Returns:
EnvironmentChangeDetail

isChangeDetail

public boolean isChangeDetail(java.lang.String pObjectName)
returns true if there's a change detail for the given object name

Parameters:
pObjectName -
Returns:
true if the state contains a EnvironmentChangeDetail for the name.

isActiveCustomerChanging

public boolean isActiveCustomerChanging()
Returns true in the state contains a change detail for the active customer.

Returns:
true if there's a change detail for the active customer.

getAllWarnings

public java.util.List getAllWarnings()
Returns the list of warnings in the state

Returns:
List

addWarning

public void addWarning(java.lang.String pWarning)
Adds a new warning to the list of warnings in the state

Parameters:
pWarning -

addWarnings

public void addWarnings(java.util.List pWarnings)
Adds a list of warnings to the warnings in the state

Parameters:
pWarnings -

isWarnings

public boolean isWarnings()
Determines if there are warnings in the state

Returns:
true if warnings exist

getTicketDispositionOptions

public TicketDispositionOptions getTicketDispositionOptions()
This method will lazily create an instance of TicketDispositionOptions if one doesn't already exist.

Returns:
Returns the TicketDispositionOptions that holds the ticket disposition options.

setTicketDispositionOptions

public void setTicketDispositionOptions(TicketDispositionOptions pTicketDispositionOptions)
Parameters:
pTicketDispositionOptions - the TicketDispositionOptions holds the ticket disposition options.

isProcessActiveTicketDisposition

public boolean isProcessActiveTicketDisposition()
This flag determines if the active ticket will be processed using the ticket disposition options before the change is applied. The default is false.

Returns:
true if the active ticket disposition should be processed before the change is applied.

setProcessActiveTicketDisposition

public void setProcessActiveTicketDisposition(boolean pProcessActiveTicketDisposition)

getApplyException

public java.lang.Throwable getApplyException()
Returns the exception that was thrown during the apply process

Returns:
Throwable

setApplyException

public void setApplyException(java.lang.Throwable pApplyException)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object