public class DeploymentEvent
extends java.lang.Object
implements atg.deployment.common.Constants
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
Modifier and Type | Field and Description |
---|---|
static int |
ACTIVE_ACTIVATE |
static int |
ACTIVE_APPLY
begin applying the deployment data to target databases
|
static int |
ACTIVE_APPLY_COMMITTED
Deployment system has committed the first batch of asset operations.
|
static int |
ACTIVE_CREATE
-- Create Phase States --
Assets which need to get deployed are calculated and data structures required to be
passed to deployment adapter are created.
|
static int |
ACTIVE_INSTALL
-- Install Phase States --
These states are not used any more.
|
static int |
ACTIVE_LOAD
-- Load Phase States --
These states are not used any more.
|
static int |
ACTIVE_LOCK
-- Lock Phase States --
All the agents in a site must be locked for a deployment to proceed futher.
|
static int |
ACTIVE_PREPARE
-- Prepare Phase States -- PREPARE phase can mean a variety of things depending on
the type of deployment.
|
static int |
ACTIVE_STOP |
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 java.lang.String |
CLASS_VERSION
Class version string
|
static int |
DEPLOYMENT_COMPLETE
Deployment has finished successfully but has not been deleted yet.
|
static int |
DEPLOYMENT_DELETED
A deployment has either been canceled or it has
finished successfully and now has a been deleted so that next deployment in
the queue can proceed.
|
static int |
DONE_ACTIVATE |
static int |
DONE_APPLY
This phase signals that application of data has finished successfully.
|
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
Deployment is in an error state.
|
static int |
ERROR_ACTIVATE |
static int |
ERROR_APPLY
There was an error applying data.
|
static int |
ERROR_APPLY_COMMITTED
An error has occurred during apply phase after some data was 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
A deployment event has caused the deployment to halt.
|
static int |
IDLE |
ACCEPTED_FOR_TARGET, APPLY_TRANSACTION_SIZE, APPROVED_FOR_TARGET, DEPLOYED_TO_TARGET, DEPLOYMENT_PROTOCOL_VERSION, DEPLOYMENT_TYPE_BACK_DEPLOY, DEPLOYMENT_TYPE_DEPLOY_TO_INITIAL, DEPLOYMENT_TYPE_INIT_TARGET, DEPLOYMENT_TYPE_ONE_OFF_DEPLOY, DEPLOYMENT_TYPE_REVERT_DEPLOY, DEPLOYMENT_TYPE_STANDARD_DEPLOY, DPLY_CMD_ACTIVE_APPLY_COMMITTED, DPLY_CMD_AFFECTED_TYPES, DPLY_CMD_ASSET_DESTINATIONS, DPLY_CMD_CLUSTER_ID, DPLY_CMD_COMMAND, DPLY_CMD_DATASTORES_TO_SWITCH, DPLY_CMD_DEPLOYMENT_END_TIME, DPLY_CMD_DEPLOYMENT_ID, DPLY_CMD_DEPLOYMENT_START_TIME, DPLY_CMD_EXCLUDE_ASSET, DPLY_CMD_FIRST_APPLY, DPLY_CMD_FROM_SNAPSHOT, DPLY_CMD_INCLUDE_ASSET, DPLY_CMD_INSTALL_BYTES, DPLY_CMD_INSTALL_NUM_BYTES, DPLY_CMD_MODE, DPLY_CMD_ONEOFF, DPLY_CMD_PRINCIPAL, DPLY_CMD_PROJECTS, DPLY_CMD_PROTOCOL_VERSION, DPLY_CMD_RECOVERING, DPLY_CMD_REFRESH_REPOSITORIES, DPLY_CMD_RESUME, DPLY_CMD_ROLLBACK, DPLY_CMD_SCIEVENTS, DPLY_CMD_SERVER_NAME, DPLY_CMD_SET_AGENT_STATUS, DPLY_CMD_SWITCH_FIRST, DPLY_CMD_SWITCH_LIVE, DPLY_CMD_TO_SNAPSHOT, DPLY_CMD_TYPE, DPLY_CMD_USER_ID, DPLY_CMD_VERIFY_FILE_CHECKSUM, DPLY_CMD_VERIFY_FILE_COMPONENT_PATH, DPLY_CMD_VERIFY_FILE_LAST_MODIFIED, DPLY_CMD_VERIFY_FILE_PATH, DPLY_CMD_VERIFY_FILE_SIZE, DPLY_CMD_VFS_ORDER, HIDDEN_FROM_TARGET, INIT_BRANCH_LOCK_NAME, ONE_OFF, REMOTE_DYNAMIC_RELOAD_EXCEPTION, REMOTE_DYNAMIC_RELOAD_SUCCESS, REMOTE_SWITCH_EXCEPTION, REMOTE_SWITCH_SUCCESS, RENOUNCED_FOR_TARGET, ROLLBACK_DEPLOYMENT_FAILURE, STRICT_OP_DEFAULT, STRICT_OP_OVERRIDE_FALSE, STRICT_OP_OVERRIDE_TRUE, TARGET_INITIAL_STATE_PROJECT_ID, TOPOLOGY_AGENT_PRINCIPAL_ALL, TOPOLOGY_AGENT_PRINCIPAL_NONE, TOPOLOGY_AGENT_PRINCIPAL_REPOSITORY, TOPOLOGY_AGENT_PRINCIPAL_VFS, TOPOLOGY_DEPLOY_TYPE_ONE_OFF, TOPOLOGY_DEPLOY_TYPE_WORKFLOW, TOPOLOGY_TRANSPORT_JNDI, TOPOLOGY_TRANSPORT_RMI, WORKFLOW
DEPLOYABLE_ATTRIBUTE_NAME, DEPLOYMENT_SYSTEM_VERSION, EXPORT_ATTRIBUTE_NAME, IMPORT_ATTRIBUTE_NAME, JAR_ATTR_MAN_FILE, JAR_ATTR_MAN_ID, JAR_ATTR_VERSION, MODE_ONLINE, MODE_SWITCH, PM_DEP, REFERENCES_ATTRIBUTE_NAME, TYPE_FULL, TYPE_INCREMENTAL
Constructor and Description |
---|
DeploymentEvent(DeploymentEventSender pSender,
ApplicationLogging pLog)
Constructs an uninitialized event.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map |
getAffectedItemTypes() |
java.util.Set |
getAffectedRepositories() |
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.Boolean |
getFirstApply()
Get property firstApply
|
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.
|
boolean |
isSwitchFirstApply()
Whether or not the first apply of a switch deployment.
|
void |
prepareForFiring()
Prepares the event for firing.
|
void |
setAffectedItemTypes(java.util.Map pAffectedItemTypes) |
void |
setAffectedRepositories(java.util.Set pAffectedRepositories) |
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 |
setFirstApply(java.lang.Boolean pFirstApply)
Whether or not the first apply of a switch deployment.
|
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.
|
java.lang.String |
toString() |
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 ACTIVE_LOCK
public static final int BEGIN_LOCK
public static final int DONE_LOCK
public static final int ERROR_LOCK
public static final int ACTIVE_PREPARE
public static final int BEGIN_PREPARE
public static final int DONE_PREPARE
public static final int ERROR_PREPARE
public static final int ACTIVE_CREATE
public static final int BEGIN_CREATE
public static final int DONE_CREATE
public static final int ERROR_CREATE
public static final int ACTIVE_INSTALL
public static final int BEGIN_INSTALL
public static final int DONE_INSTALL
public static final int ERROR_INSTALL
public static final int ACTIVE_LOAD
public static final int BEGIN_LOAD
public static final int DONE_LOAD
public static final int ERROR_LOAD
public static final int ACTIVE_APPLY
public static final int BEGIN_APPLY
public static final int ACTIVE_APPLY_COMMITTED
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 ACTIVE_ACTIVATE
public static final int DONE_ACTIVATE
public static final int ERROR_ACTIVATE
public static final int ACTIVE_STOP
public static final int DONE_STOP
public static final int ERROR_STOP
public DeploymentEvent(DeploymentEventSender pSender, ApplicationLogging pLog)
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 setFirstApply(java.lang.Boolean pFirstApply)
pFirstApply
- Whether or not the first apply of a switch deployment.public java.lang.Boolean getFirstApply()
public boolean isSwitchFirstApply()
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 setAffectedRepositories(java.util.Set pAffectedRepositories)
public java.util.Set getAffectedRepositories()
public java.lang.String toString()
toString
in class java.lang.Object
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 interruptedpublic static java.lang.String stateToString(int pStateCode)
pStateCode
- one of the constant state codes in DeploymentEventpublic static int stringToState(java.lang.String pStateString)
pStateString
- one of the constant state codes in DeploymentEvent