|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.deployment.common.event.DeploymentEvent
public class DeploymentEvent
A deployment event denoting the change in state of a deployment or a deployment agent.
Deployment events are generic in structure and are keyed off of a set of state codes defined as constants in the event. Each time a deployment or deployment agent changes state, a deployment event is fired with relevant information.
DeploymentEvents also provide the ability to interrupt the deployment process. If a DeploymentEventListener receives a deployment event and needs to halt the deployment process, the listener can call interrupt() on the deployment event. Interrupted deployments are treated the same as if an error occurred during the deployment process.
DeploymentEventSender
,
DeploymentEventListener
Field Summary | |
---|---|
static int |
BEGIN_ACTIVATE
|
static int |
BEGIN_APPLY
|
static int |
BEGIN_APPLY_COMMITTED
|
static int |
BEGIN_CREATE
|
static int |
BEGIN_INSTALL
|
static int |
BEGIN_LOAD
|
static int |
BEGIN_LOCK
|
static int |
BEGIN_PREPARE
|
static int |
BEGIN_STOP
|
static java.lang.String |
CLASS_VERSION
Class version string |
static int |
DEPLOYMENT_COMPLETE
|
static int |
DEPLOYMENT_DELETED
|
static int |
DONE_ACTIVATE
|
static int |
DONE_APPLY
|
static int |
DONE_CREATE
|
static int |
DONE_INSTALL
|
static int |
DONE_LOAD
|
static int |
DONE_LOCK
|
static int |
DONE_PREPARE
|
static int |
DONE_STOP
|
static int |
ERROR
|
static int |
ERROR_ACTIVATE
|
static int |
ERROR_APPLY
|
static int |
ERROR_APPLY_COMMITTED
|
static int |
ERROR_CREATE
|
static int |
ERROR_INSTALL
|
static int |
ERROR_LOAD
|
static int |
ERROR_LOCK
|
static int |
ERROR_PREPARE
|
static int |
ERROR_STOP
|
static int |
EVENT_INTERRUPT
|
static int |
IDLE
|
Constructor Summary | |
---|---|
DeploymentEvent(DeploymentEventSender pSender,
ApplicationLogging pLog)
Constructs an uninitialized event. |
Method Summary | |
---|---|
java.util.Map |
getAffectedItemTypes()
|
long |
getDeploymentBeginTimestamp()
System milliseconds when the deployment was first started. |
java.lang.String |
getDeploymentCreateInitiator()
A generic identifier denoting who or what created/started the deployment. |
java.lang.String |
getDeploymentDeleteInitiator()
A generic identifier denoting who or what deleted the deployment. |
java.lang.String |
getDeploymentID()
The ID of the current deployment, if there is a current deployment. |
long |
getDeploymentLastBeginTimestamp()
System milliseconds when the deployment was last started. |
long |
getDeploymentLastExecutionTime()
The time in milliseconds the deployment has spent running since it was last started. |
int |
getDeploymentMode()
The deployment mode, either Constants.MODE_ONLINE or Constants.MODE_SWITCH. |
java.lang.String[] |
getDeploymentProjectIDs()
The project IDs being deployed to the target or agent. |
java.lang.String |
getDeploymentServer()
Name of the deployment server performing the current deployment. |
java.lang.String |
getDeploymentStopInitiator()
A generic identifier denoting who or what stopped/interrupted the deployment. |
int |
getDeploymentStrictFileOps()
|
int |
getDeploymentStrictRepoOps()
|
long |
getDeploymentTotalExecutionTime()
The time in milliseconds the deployment has spent running. |
int |
getDeploymentType()
The deployment type, either Constants.TYPE_INCREMENTAL or Constants.TYPE_FULL. |
java.lang.Throwable |
getErrorCausedByException()
The Exception that caused the error state, if an Exception did so. |
java.lang.String |
getErrorMessage()
A textual description of what caused the error status, if the state is an error state. |
java.lang.String |
getErrorMessage(java.util.Locale pLocale)
A textual description of what caused the error status, if the status is an error state. |
java.lang.Object[] |
getErrorMsgResourceArguments()
Resource string arguments used to fill in and create the error message. |
java.lang.String |
getErrorMsgResourceKey()
The resource look-up key for the error message. |
java.lang.String |
getInterruptCaller()
Who is interrupting this event, if it is interrupted. |
java.lang.String |
getInterruptReason()
Why this event is being interrupted, if it is being interrupted. |
int |
getNewState()
The new state that caused this event to fire. |
long |
getNewStateTimestamp()
System milliseconds when the new state was set. |
int |
getOldState()
The old state before this event was fired. |
java.lang.String |
getTarget()
The logical target associated with the event, either a deployment target or an individual target agent. |
boolean |
interrupt(java.lang.String pCaller,
java.lang.String pReason)
Deployment events get sent on every state change during deployment. |
boolean |
isDeploymentRevert()
Returns property deploymentRevert. |
boolean |
isDeploymentRollback()
Whether or not the deployment has been flagged for rollback. |
boolean |
isDeploymentScheduled()
Whether or not this deployment was kicked off automatically from a schedule. |
boolean |
isInterruptable()
Whether or not the new state causing this event can be interrupted. |
boolean |
isInterrupted()
Whether or not this event has been interrupted. |
void |
prepareForFiring()
Prepares the event for firing. |
void |
setAffectedItemTypes(java.util.Map pAffectedItemTypes)
|
void |
setDeploymentBeginTimestamp(long pDeploymentBeginTimestamp)
System milliseconds when the deployment was first started. |
void |
setDeploymentCreateInitiator(java.lang.String pDeploymentCreateInitiator)
A generic identifier denoting who or what created/started the deployment. |
void |
setDeploymentDeleteInitiator(java.lang.String pDeploymentDeleteInitiator)
A generic identifier denoting who or what deleted the deployment. |
void |
setDeploymentID(java.lang.String pDeploymentID)
The ID of the current deployment, if there is a current deployment. |
void |
setDeploymentLastBeginTimestamp(long pDeploymentLastBeginTimestamp)
System milliseconds when the deployment was last started. |
void |
setDeploymentLastExecutionTime(long pDeploymentLastExecutionTime)
The time in milliseconds the deployment has spent running since it was last started. |
void |
setDeploymentMode(int pDeploymentMode)
The deployment mode, either Constants.MODE_ONLINE or Constants.MODE_SWITCH. |
void |
setDeploymentProjectIDs(java.lang.String[] pDeploymentProjectIDs)
The project IDs being deployed to the target or agent. |
void |
setDeploymentRevert(boolean pDeploymentRevert)
Sets property deploymentRevert. |
void |
setDeploymentRollback(boolean pDeploymentRollback)
Whether or not the deployment has been flagged for rollback. |
void |
setDeploymentScheduled(boolean pDeploymentScheduled)
Whether or not this deployment was kicked off automatically from a schedule. |
void |
setDeploymentServer(java.lang.String pDeploymentServer)
Name of the deployment server performing the current deployment. |
void |
setDeploymentStopInitiator(java.lang.String pDeploymentStopInitiator)
A generic identifier denoting who or what stopped/interrupted the deployment. |
void |
setDeploymentStrictFileOps(int pDeploymentStrictFileOps)
|
void |
setDeploymentStrictRepoOps(int pDeploymentStrictRepoOps)
|
void |
setDeploymentTotalExecutionTime(long pDeploymentTotalExecutionTime)
The time in milliseconds the deployment has spent running. |
void |
setDeploymentType(int pDeploymentType)
The deployment type, either Constants.TYPE_INCREMENTAL or Constants.TYPE_FULL. |
void |
setErrorCausedByException(java.lang.Throwable pErrorCausedByException)
The Exception that caused the error state, if an Exception did so. |
void |
setErrorMsgResourceArguments(java.lang.Object[] pErrorMsgResourceArguments)
Resource string arguments used to fill in and create the error message. |
void |
setErrorMsgResourceKey(java.lang.String pErrorMsgResourceKey)
The resource look-up key for the error message. |
void |
setInterruptable(boolean pInterruptable)
Whether or not the new state causing this event can be interrupted. |
void |
setInterruptCaller(java.lang.String pInterruptCaller)
Who is interrupting this event, if it is interrupted. |
void |
setInterrupted(boolean pInterrupted)
Whether or not this event has been interrupted. |
void |
setInterruptReason(java.lang.String pInterruptReason)
Why this event is being interrupted, if it is being interrupted. |
void |
setNewState(int pNewState)
The new state that caused this event to fire. |
void |
setNewStateTimestamp(long pNewStateTimestamp)
System milliseconds when the new state was set. |
void |
setOldState(int pOldState)
The old state before this event was fired. |
void |
setTarget(java.lang.String pTarget)
The logical target associated with the event, either a deployment target or an individual target agent. |
static java.lang.String |
stateToString(int pStateCode)
Returns a string form of the state code, useful for listeners who may want to turn the event into a customized, readable format. |
static int |
stringToState(java.lang.String pStateString)
Returns a int form of the state string, useful for listeners who may want to take a string input instead of an integer which can be easily misconfigured. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
public static final int IDLE
public static final int DEPLOYMENT_COMPLETE
public static final int DEPLOYMENT_DELETED
public static final int EVENT_INTERRUPT
public static final int ERROR
public static final int BEGIN_LOCK
public static final int DONE_LOCK
public static final int ERROR_LOCK
public static final int BEGIN_PREPARE
public static final int DONE_PREPARE
public static final int ERROR_PREPARE
public static final int BEGIN_CREATE
public static final int DONE_CREATE
public static final int ERROR_CREATE
public static final int BEGIN_INSTALL
public static final int DONE_INSTALL
public static final int ERROR_INSTALL
public static final int BEGIN_LOAD
public static final int DONE_LOAD
public static final int ERROR_LOAD
public static final int BEGIN_APPLY
public static final int BEGIN_APPLY_COMMITTED
public static final int DONE_APPLY
public static final int ERROR_APPLY
public static final int ERROR_APPLY_COMMITTED
public static final int BEGIN_ACTIVATE
public static final int DONE_ACTIVATE
public static final int ERROR_ACTIVATE
public static final int BEGIN_STOP
public static final int DONE_STOP
public static final int ERROR_STOP
Constructor Detail |
---|
public DeploymentEvent(DeploymentEventSender pSender, ApplicationLogging pLog)
Method Detail |
---|
public void setOldState(int pOldState)
public int getOldState()
public void setNewState(int pNewState)
public int getNewState()
public void setNewStateTimestamp(long pNewStateTimestamp)
public long getNewStateTimestamp()
public java.lang.String getErrorMessage()
public java.lang.String getErrorMessage(java.util.Locale pLocale)
public void setErrorMsgResourceKey(java.lang.String pErrorMsgResourceKey)
All of deployment uses the same ResouceBundle and so no bundle is ever specified here.
public java.lang.String getErrorMsgResourceKey()
All of deployment uses the same ResouceBundle and so no bundle is ever specified here.
public void setErrorMsgResourceArguments(java.lang.Object[] pErrorMsgResourceArguments)
public java.lang.Object[] getErrorMsgResourceArguments()
public void setErrorCausedByException(java.lang.Throwable pErrorCausedByException)
public java.lang.Throwable getErrorCausedByException()
public void setInterruptable(boolean pInterruptable)
public boolean isInterruptable()
public void setInterrupted(boolean pInterrupted)
public boolean isInterrupted()
public void setInterruptCaller(java.lang.String pInterruptCaller)
public java.lang.String getInterruptCaller()
public void setInterruptReason(java.lang.String pInterruptReason)
public java.lang.String getInterruptReason()
public void setTarget(java.lang.String pTarget)
public java.lang.String getTarget()
public void setDeploymentID(java.lang.String pDeploymentID)
public java.lang.String getDeploymentID()
public void setDeploymentBeginTimestamp(long pDeploymentBeginTimestamp)
public long getDeploymentBeginTimestamp()
public void setDeploymentLastBeginTimestamp(long pDeploymentLastBeginTimestamp)
pDeploymentLastBeginTimestamp
- new value to setpublic long getDeploymentLastBeginTimestamp()
public void setDeploymentLastExecutionTime(long pDeploymentLastExecutionTime)
pDeploymentLastExecutionTime
- new value to setpublic long getDeploymentLastExecutionTime()
public void setDeploymentTotalExecutionTime(long pDeploymentTotalExecutionTime)
pDeploymentTotalExecutionTime
- new value to setpublic long getDeploymentTotalExecutionTime()
public void setDeploymentProjectIDs(java.lang.String[] pDeploymentProjectIDs)
public java.lang.String[] getDeploymentProjectIDs()
public void setDeploymentType(int pDeploymentType)
public int getDeploymentType()
public void setDeploymentMode(int pDeploymentMode)
public int getDeploymentMode()
public void setDeploymentRevert(boolean pDeploymentRevert)
public boolean isDeploymentRevert()
public void setDeploymentRollback(boolean pDeploymentRollback)
public boolean isDeploymentRollback()
public void setDeploymentServer(java.lang.String pDeploymentServer)
public java.lang.String getDeploymentServer()
public void setDeploymentScheduled(boolean pDeploymentScheduled)
public boolean isDeploymentScheduled()
public void setDeploymentCreateInitiator(java.lang.String pDeploymentCreateInitiator)
public java.lang.String getDeploymentCreateInitiator()
public void setDeploymentStopInitiator(java.lang.String pDeploymentStopInitiator)
public java.lang.String getDeploymentStopInitiator()
public void setDeploymentDeleteInitiator(java.lang.String pDeploymentDeleteInitiator)
public java.lang.String getDeploymentDeleteInitiator()
public int getDeploymentStrictFileOps()
public void setDeploymentStrictFileOps(int pDeploymentStrictFileOps)
public int getDeploymentStrictRepoOps()
public void setDeploymentStrictRepoOps(int pDeploymentStrictRepoOps)
public java.util.Map getAffectedItemTypes()
public void setAffectedItemTypes(java.util.Map pAffectedItemTypes)
public void prepareForFiring()
Fired events are shared amongst event listeners and are therefore made immutable so that listeners cannot change the information the events hold.
public boolean interrupt(java.lang.String pCaller, java.lang.String pReason)
However, the deployment cannot be interrupted if either the deployment has advanced past the point of interruption or is entering an uninterruptable state, such as an error state. The property 'isInterruptable' can be checked to see if the current event can interrupt the deployment. Calling interrupt() when isInterruptable() returns false will result in no interrupt and the interrupt() method returning false.
pCaller
- an identifier for who is interrupting the deploymentpReason
- a description of why the deployment is being interrupted
public static java.lang.String stateToString(int pStateCode)
pStateCode
- one of the constant state codes in DeploymentEvent
public static int stringToState(java.lang.String pStateString)
pStateString
- one of the constant state codes in DeploymentEvent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |