atg.deployment.server
Class Deployment

java.lang.Object
  extended by atg.deployment.server.Deployment
All Implemented Interfaces:
atg.deployment.common.Constants, atg.deployment.DeploymentConstants, ApplicationLogging, atg.nucleus.logging.TraceApplicationLogging, java.lang.Runnable

public class Deployment
extends java.lang.Object
implements atg.deployment.common.Constants, java.lang.Runnable, atg.nucleus.logging.TraceApplicationLogging

A stateful representation of a Deployment. This class contains the deployment process and is used to monitor and control that process.

Deployment objects are created by scheduling or queueuing a new deployment through a Target instance and are only ever associated with a single target. All deployments initially go into the specific target's schedule or queue and therefore cannot be started directly. The target's queue will eventually start the deployment.

The progression of a deployment can be monitored by calling getStatus(). Alternatively, a DeploymentEventListener could be written and registered with the DeploymentServer. Such a listener will begin receiving events for a deployment once begin() is called on the deployment by the target queue.

A scheduled or queued deployment can have its deploy time changed with a simple call to setDeployTime(). Alternatively, any scheduled or queued deployment can be moved to the head of the deployment queue by calling runNext(). This is the extent of queue and schedule manipulation allowed.

Once a deployment has started successfully, the entire process will run in a separate thread. If the deployment fails or the caller needs to interrupt the deployment, stop() can be called to stop and/or reset the deployment. Likewise, any stopped deployment or any deployment that is waiting in the queue or schedule can be deleted by calling delete().

If a deployment fails, rather than stopping the deployment, either resume() or rollback() can be called to resume the deployment or roll back the target to the data set that was active before the deployment began. For example, if an agent dies but is immediately rebooted during a deployment, the process is interrupted with a network error, most likely a returned Status.ERROR_TRANSPORT. In such a situation, the calling code could wait until the Target becomes fully accessible again and then call resume() on the deployment, as in the following example:

 // Monitors the deployment till it is finished or errored on a //
 non-network error. In the case of a network error, the // deployment will be
 resumed as soon as the target is accessible. public void monitorDeployment
 (Target pTarget) throws DeploymentException { // Get the current deployment
 and monitor it till either it // completes or encounters an error. Deployment
 deployment = pTarget.getCurrentDeployment(); Status status =
 deployment.getStatus(); while (status.isStateError() == false &&
 status.getState() != Status.DEPLOYMENT_COMPLETE) { // Sleep for a while using
 your favorite method // for making a thread take a nap.
  // Reaquire the deployment status to check it // once again for completion
 or error. status = deployment.getStatus(); } // The monitoring loop has been
 broken. Check to see if the // monitoring loop was broken by an error. if
 (status.isStateError()) { // Deployments do not exactly reflect that a
 network error // occurred but rather tell you in what phase of the //
 deployment an error occurred. So although there is a // window where a
 network error could disappear, we'll look // to the target to find out if one
 caused our error. status = pTarget.getStatus(); if (status.getState() ==
 Status.ERROR_TRANSPORT || status.getState() ==
 Status.ERROR_TRANSPORT_UNINSTANTIATED) { // Yup, network error occurred (or
 something). Wait until // the target is accessible again and then try and
 resume // the deployment. while (pTarget.isAccessible() == false) { // Sleep
 for a while using your favorite method // for making a thread take a nap. } //
 Now that the target is reporting as accessible, try to // resume the
 deployment and continue to monitor it. deployment.resume(); // Hey look,
 uncontrolled recursion! (That's bad.) monitorDeployment(pTarget); } } }
 
 
For special situations, if the target's deployment queue is halted Deployment.begin() can be called directly on a scheduled or queued deployment to run immediately. If there is alread a deployment occupying the role of current deployment, that deployment must be delt with before any other deployment can run, specifically it must either be allowed to finish or stopped and deleted. E.g.:
 // Halt the target's deployment queue. Target t =
 deploymentServer.getTarget("mySpecialTarget"); t.haltQueue(); // NOTE: If
 there is a running deployment we would have to decide // how we want to deal
 with it here. (I.e. delete it or let it // it complete.) if
 (t.isDeployable()) { String[] ids = { "projID-0001" }; Deployment d =
 t.deployProjects(ids, false, // do not force a full deploy null, // no
 schedule "my-login-name"); d.begin(); }
 
 

See Also:
DeploymentServer, Target, DeploymentEventListener

Nested Class Summary
 class Deployment.VersionContainerIncludeCheckerImpl
           
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String FULL_DEP_SNAPSHOT_NAME_PREFIX
           
 
Fields inherited from interface atg.deployment.common.Constants
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_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
 
Fields inherited from interface atg.deployment.DeploymentConstants
DEPLOYABLE_ATTRIBUTE_NAME, DEPLOYMENT_SYSTEM_VERSION, JAR_ATTR_MAN_FILE, JAR_ATTR_MAN_ID, JAR_ATTR_VERSION, MODE_ONLINE, MODE_SWITCH, PM_DEP, REFERENCES_ATTRIBUTE_NAME, TYPE_FULL, TYPE_INCREMENTAL
 
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
 
Method Summary
 void activateDeployment(boolean pRefreshAffectedRepositoryCaches)
          Tells each agent to activate the deployment.
 void agentException(int pNewCode, Status pStatus, AgentRef pAgent)
          Create an exception and update the deployment status based off the passed in agent information.
 void begin()
          Begins the deployment process.
protected  void calculateDeploymentSnapshots()
          Calculate deployment "TO" and "FROM" snapshots based on projects included in this deployment and the type of this deployment.
protected  void checkForNoop()
          Checks to make sure if this deployment is supposed to do transfer any data, if not a special DeploymentException is thrown.
protected  void createPrerequisiteSnapshots()
          For any projects which have become orphan since the last deployment or are part of input deployment projects, this method creates snapshots on projects that don't have one.
 void delete(java.lang.String pDeleteInitiator)
          Deletes the this deployment from the target's list of pending deployments.
 void forceStatus(int pDeploymentStatus)
          Perform all preparatory tasks necessary prior to starting a DAF deployment.
static java.lang.String getAbsoluteFullDeploymentSnapshotName(Target pTarget, java.lang.String pDeploymentID)
           
 AgentRef[] getAccessibleAgents()
          The list of deployment agents that were last known to be accessible.
 java.util.Collection getActiveWorkspaces()
          Find workspace corresponding to deployment projects which have not been checked in yet.
 long getBeginTimestamp()
          System milliseconds when the deployment began (or began again).
 java.lang.String getCreateInitiator()
          A generic identifier denoting who or what created/started this deployment.
 java.util.Collection getDeploymentAssetStates(atg.versionmanager.impl.VersionContainerIncludeChecker pIncludeChecker)
           
 Snapshot getDeploymentFromSnapshot()
          Return the deployment snapshot.
 java.lang.String getDeploymentID()
          A generated identifier to distinguish this deployment from others.
 atg.deployment.common.DeploymentMetaData getDeploymentMetaData()
          Information about
 DeploymentServer getDeploymentServer()
          The server which manages this deployment.
 Snapshot getDeploymentToSnapshot()
          Return the deployment snapshot.
 java.util.Calendar getDeployTime()
          The scheduled time this deployment should begin.
 AgentRef[] getInaccessibleAgents()
          The deployment agents in this target that are currently inaccessible.
 int getMode()
          The mode to be used when deploying this object, either MODE_ONLINE or MODE_SWITCH.
 java.lang.String getPercentageComplete()
          Find percentage complete for this deployment.
 java.lang.String[] getProjectIDs()
          The list of project IDs being deployed to the target.
 atg.deployment.sci.SelectiveCacheInvalidationServerService getSCIServerService()
          The selective cache invalidation service.
 Status getStatus()
          The current status of the deployment.
 Status getStatusForUpdate()
          Returns the Deployment's reference to Status so that it can be updated outside of this class.
 java.lang.String getStopInitiator()
          A generic identifier for who or what stopped the deployment.
 java.util.List getSwitchableDataSources()
          Returns a list of the SwitchableDataSources configured for the target repositories.
 Target getTarget()
          The target receiving the deployment.
 Snapshot getTargetInstalledSnapshot()
          Return the target snapshot.
 java.lang.String getTargetLiveDataStoreName()
          Get the deployment target's live datastore name.
 java.lang.String getTransferId()
          Returns the ID of the data transfer as used by the DataTransferAdapter.
 int getType()
          The deployment type represented by this object, either TYPE_FULL or TYPE_INCREMENTAL.
 atg.versionmanager.impl.VersionContainerIncludeChecker getVersionContainerIncludesChecker(boolean pExcludeFiles, boolean pExcludeRepositories)
           
protected  void initializeDataTransferAdapters()
          Initialize a DataTransferAdapter for this deployments
 void invalidateDestinationRepositoryCaches()
          Invalidates the caches on the destination repositories post 1st pass for an ONLINE deployment, and post 2nd pass for a SWITCH deployment.
 boolean isLoggingDebug()
          This method returns whether or not an debug log event should be broadcast.
 boolean isLoggingError()
          This method returns whether or not an error log event should be broadcast.
 boolean isLoggingInfo()
          This method returns whether or not an info log event should be broadcast.
 boolean isLoggingTrace()
           
 boolean isLoggingWarning()
          This method returns whether or not an warning log event should be broadcast.
 boolean isPercentCompleteAvailable()
           
 boolean isRemovable()
          Returns true if Target.removeDeployment() can be called for this deployment.
 boolean isResumable()
          Returns true if resume() can be called on this deployment.
 boolean isResume()
          Returns true if this is a resumed deployment.
 boolean isRevertDeployment()
          Whether or not this is a deployment reverting a project off of a target.
 boolean isRollbackable()
          Returns true if Deployment.rollback() can be called on this deployment.
 boolean isRunning()
          If this deploymnent thread is currently running.
 boolean isStop()
          Returns the deployment stop flag.
 boolean isStoppable()
          Returns true if stop() can be called on this deployment.
 java.lang.Boolean isStrictFileOps()
           
 java.lang.Boolean isStrictRepoOps()
           
 void logDebug(java.lang.String pMessage)
          Logs an debug event with the specified message
 void logDebug(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an debug event with the specified message and Throwable
 void logDebug(java.lang.Throwable pThrowable)
          Logs an debug event with the specified Throwable
 void logError(java.lang.String pMessage)
          Logs an error event with the specified message
 void logError(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an error event with the specified message and Throwable
 void logError(java.lang.Throwable pThrowable)
          Logs an error event with the specified Throwable
 void logInfo(java.lang.String pMessage)
          Logs an info event with the specified message
 void logInfo(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an info event with the specified message and Throwable
 void logInfo(java.lang.Throwable pThrowable)
          Logs an info event with the specified Throwable
 void logTrace(java.lang.String pMessage)
           
 void logTrace(java.lang.String pMessage, java.lang.Throwable pThrowable)
           
 void logTrace(java.lang.Throwable pThrowable)
           
 void logWarning(java.lang.String pMessage)
          Logs an warning event with the specified message
 void logWarning(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Logs an warning event with the specified message and Throwable
 void logWarning(java.lang.Throwable pThrowable)
          Logs an warning event with the specified Throwable
 void remove()
          Called when current deployment is being removed from the target.
 void resume()
          Attempts to resume/retry/restart the deployment, picking up where the deployment left off, for the most part.
 void rollback(java.lang.String pRollbackInitiator)
          Attempts to start a rollback deployment for this failed deployment.
 void run()
          Implementation of run() from the Runnable interface.
 void runNext()
          Moves this deployment to the head of the deployment queue.
 void setAgentStatus(java.util.Map pToStatus)
          Set the DeploymentAgent Status remotely from the Publishing server to the specified Status
 void setAgentStatus(java.util.Map pToStatus, boolean pUpdateSCIEvents)
          Set the DeploymentAgent Status remotely from the Publishing server to the specified Status
 void setAgentStatus(java.util.Map pToStatus, int status)
          Set the DeploymentAgent Status remotely from the Publishing server to the specified Status
 void setDeploymentCommitted()
          Sets the deployment as committed on both the pub and the agent servers.
 void setDeploymentCommitted(boolean pCommitted)
          Sets the deployment as committed or not on both the pub and the agent servers.
 void setDeployTime(java.util.Calendar pDeployTime)
          The scheduled time this deployment should begin.
 void setLoggingDebug(boolean pLogging)
          Sets whether or not error log events should be logged.
 void setLoggingError(boolean pLogging)
          Sets whether or not error log events should be logged.
 void setLoggingInfo(boolean pLogging)
          Sets whether or not info log events should be logged.
 void setLoggingTrace(boolean pLogging)
           
 void setLoggingWarning(boolean pLogging)
          Sets whether or not warning log events should be logged.
 void setStrictFileOps(java.lang.Boolean pStrictFileOps)
           
 void setStrictRepoOps(java.lang.Boolean pStrictRepoOps)
           
 boolean skipNonEssentialAgent(AgentRef pAgent, Status pAgentStatus)
          Checks to see if this agent can be skipped or not.
 void stop(java.lang.String pStopInitiator)
          Stops the running deployment.
 void switchLocalDataSources(boolean pShouldSwitch, boolean pShouldVerify)
          Switch and verify all switchable datasources on the CA instance.
protected  boolean verifyIncrementalAllowed()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


FULL_DEP_SNAPSHOT_NAME_PREFIX

public static final java.lang.String FULL_DEP_SNAPSHOT_NAME_PREFIX
See Also:
Constant Field Values
Method Detail

initializeDataTransferAdapters

protected void initializeDataTransferAdapters()
                                       throws atg.deployment.common.DeploymentException
Initialize a DataTransferAdapter for this deployments

Throws:
atg.deployment.common.DeploymentException

getType

public int getType()
The deployment type represented by this object, either TYPE_FULL or TYPE_INCREMENTAL.

Returns:
int

getMode

public int getMode()
The mode to be used when deploying this object, either MODE_ONLINE or MODE_SWITCH.

Returns:
int

getDeploymentID

public java.lang.String getDeploymentID()
A generated identifier to distinguish this deployment from others.

Returns:
String

getDeploymentServer

public DeploymentServer getDeploymentServer()
The server which manages this deployment.

Returns:

getSCIServerService

public atg.deployment.sci.SelectiveCacheInvalidationServerService getSCIServerService()
The selective cache invalidation service.

Returns:

getTarget

public Target getTarget()
The target receiving the deployment.

Returns:
Target

getProjectIDs

public java.lang.String[] getProjectIDs()
The list of project IDs being deployed to the target.

Returns:
String[]

setDeployTime

public void setDeployTime(java.util.Calendar pDeployTime)
                   throws atg.deployment.common.DeploymentException
The scheduled time this deployment should begin. If this deployment was not scheduled for a specific time, NULL is returned.

Parameters:
pDeployTime - new value to set
Throws:
atg.deployment.common.DeploymentException

getDeployTime

public java.util.Calendar getDeployTime()
The scheduled time this deployment should begin. If this deployment was not scheduled for a specific time, NULL is returned.

Returns:
Calendar

isRevertDeployment

public boolean isRevertDeployment()
Whether or not this is a deployment reverting a project off of a target. Revert deployments are created via Target.deployRevert().

Returns:
boolean true if this is a revert deployment
false if this is not a revert deployment

getStatus

public Status getStatus()
The current status of the deployment.

Returns:
Status

getStatusForUpdate

public Status getStatusForUpdate()
Returns the Deployment's reference to Status so that it can be updated outside of this class.


getBeginTimestamp

public long getBeginTimestamp()
System milliseconds when the deployment began (or began again).

Returns:
long

getCreateInitiator

public java.lang.String getCreateInitiator()
A generic identifier denoting who or what created/started this deployment.

Returns:
String

getStopInitiator

public java.lang.String getStopInitiator()
A generic identifier for who or what stopped the deployment. Null if the deployment is not stopped.

Returns:
String

getAccessibleAgents

public AgentRef[] getAccessibleAgents()
The list of deployment agents that were last known to be accessible.

Returns:
AgentRef[]

getInaccessibleAgents

public AgentRef[] getInaccessibleAgents()
The deployment agents in this target that are currently inaccessible. NOTE: An agent with deployment responsibilities is never allowed to be inaccessible.

Returns:
AgentRef[]

getTargetInstalledSnapshot

public Snapshot getTargetInstalledSnapshot()
Return the target snapshot.


getDeploymentToSnapshot

public Snapshot getDeploymentToSnapshot()
Return the deployment snapshot.


getDeploymentFromSnapshot

public Snapshot getDeploymentFromSnapshot()
Return the deployment snapshot.


isStrictFileOps

public java.lang.Boolean isStrictFileOps()

setStrictFileOps

public void setStrictFileOps(java.lang.Boolean pStrictFileOps)

isStrictRepoOps

public java.lang.Boolean isStrictRepoOps()

setStrictRepoOps

public void setStrictRepoOps(java.lang.Boolean pStrictRepoOps)

isResume

public boolean isResume()
Returns true if this is a resumed deployment.


isStop

public boolean isStop()
Returns the deployment stop flag.


isStoppable

public boolean isStoppable()
Returns true if stop() can be called on this deployment.

This method is mainly for UIs that may or may not want to display buttons based on allowable functions due to the state of the deployment.


isResumable

public boolean isResumable()
Returns true if resume() can be called on this deployment. This method is mainly for UIs that may or may not want to display buttons based on allowable functions due to the state of the deployment.


isRunning

public boolean isRunning()
If this deploymnent thread is currently running.


isRollbackable

public boolean isRollbackable()
Returns true if Deployment.rollback() can be called on this deployment.

This method is mainly for UIs that may or may not want to display buttons based on allowable functions due to the state of the deployment.


isRemovable

public boolean isRemovable()
Returns true if Target.removeDeployment() can be called for this deployment. This method is mainly for UIs that may or may not want to display buttons based on allowable functions due to the state of the deployment.


begin

public void begin()
           throws atg.deployment.common.DeploymentException
Begins the deployment process.

begin() does some basic checks such as parameter validation, making sure no other servers are deploying to the target and then backgrounds the deployment process to another thread. begin() returns as soon as this is done. If the target cannot be locked or deployment parameters are invalid, a DeploymentException is thrown.

After begin() returns successfully, callers can only know the status of the deployment by calling Deployment.getStatus() or by registering a DeploymentEventListener with the server and listening for events for this specific deployment.

NOTE: only the target's deployment queue can call begin() on a deployment, unless the queue is halted for a special situation. Deployment thread priority can be modifed by setting the server property 'deploymentThreadPriorityDelta'.

Throws:
atg.deployment.common.DeploymentException - if there is a problem starting the deployment

runNext

public void runNext()
             throws atg.deployment.common.DeploymentException
Moves this deployment to the head of the deployment queue. This method can be called on any scheduled or queued deployment, i.e. any Deployment whose Status returns a state of Status.WAITING_SCHEDULED or Status.WAITING_QUEUED. After this method is called this deployment will be the one considered for deployment next by the server.

Throws:
atg.deployment.common.DeploymentException - if the deployment cannot be moved in the queue

stop

public void stop(java.lang.String pStopInitiator)
          throws atg.deployment.common.DeploymentException
Stops the running deployment. A stop deployment message is sent to all agents freeing them from the deployment.

The stop might not be immediate, as a flag must be sent to the deploying thread which will be checked on the next operation, i.e. this is not like performing an OS interrupt.

Parameters:
pStopInitiator - an identifier for who or what is stopping the deployment
Throws:
atg.deployment.common.DeploymentException - if the deployment cannot be stopped or an error is encountered stopping the deployment

getPercentageComplete

public java.lang.String getPercentageComplete()
Find percentage complete for this deployment.

Returns:

resume

public void resume()
            throws atg.deployment.common.DeploymentException
Attempts to resume/retry/restart the deployment, picking up where the deployment left off, for the most part.

Throws:
atg.deployment.common.DeploymentException - if the deployment cannot be resumed or an error is encountered restarting the deployment

rollback

public void rollback(java.lang.String pRollbackInitiator)
              throws atg.deployment.common.DeploymentException
Attempts to start a rollback deployment for this failed deployment. Rollback is only applicable for incremental deployments that have committed deployment data. Before deployment data is committed, any deployment can merely be stopped (or fail) without affecting the integrity of the data on the target.

For incremental deployments that have committed deployment data, a rollback deployment is created and applied; the rollback deployment contains the operations needed to revert the target back to the pre-deployment data set.

Full deployments are too catastrophic for rollback, since all items in all data stores get deleted before data application begins. Rolling back a full deployment would essentially be doing a full deployment anyway.

Parameters:
pRollbackInitiator - an identifier for who or what is rolling back the deployment
Throws:
atg.deployment.common.DeploymentException - if the deployment cannot be rolled back or an error is encountered starting the rollback deployment

delete

public void delete(java.lang.String pDeleteInitiator)
            throws atg.deployment.common.DeploymentException
Deletes the this deployment from the target's list of pending deployments. If this is the current deployment, it is deletable only if Deployment.isRemovable() is true.

Parameters:
pDeleteInitiator - an identifier for who or what is deleting the deployment
Throws:
atg.deployment.common.DeploymentException - if the deployment cannot be deleted

remove

public void remove()
            throws atg.deployment.common.DeploymentException
Called when current deployment is being removed from the target. Deployments that are currently running or are otherwise not safe for removal will cause a DeploymentException to be thrown.

Throws:
atg.deployment.common.DeploymentException - if the deployment cannot be removed

run

public void run()
Implementation of run() from the Runnable interface. Called when the Deployment thread is started for backgrounding the deployment process. This method should not be called directly. It should only be called internally by the deployment system.

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable

getDeploymentMetaData

public atg.deployment.common.DeploymentMetaData getDeploymentMetaData()
                                                               throws atg.deployment.common.DeploymentException
Information about

Returns:
A DeploymentMetaData object with information about what has changed during a deployment.
Throws:
atg.deployment.common.DeploymentException

forceStatus

public void forceStatus(int pDeploymentStatus)
                 throws atg.deployment.common.DeploymentException
Perform all preparatory tasks necessary prior to starting a DAF deployment.

Parameters:
pDeploymentStatus - The deployment status
Throws:
atg.deployment.common.DeploymentException

createPrerequisiteSnapshots

protected void createPrerequisiteSnapshots()
                                    throws atg.deployment.common.DeploymentException
For any projects which have become orphan since the last deployment or are part of input deployment projects, this method creates snapshots on projects that don't have one. All these projects should be marked as deployment at the end of successfull completion of this deployment. The snapshots created here become the basis of calculation of "to" and "from" snapshots later. Note that this method only does any substantial work when this deployment is a standard forward deployment, otherwise there is nothing much to do.

Throws:
atg.deployment.common.DeploymentException

switchLocalDataSources

public void switchLocalDataSources(boolean pShouldSwitch,
                                   boolean pShouldVerify)
                            throws atg.deployment.common.DeploymentException
Switch and verify all switchable datasources on the CA instance.

Parameters:
pShouldSwitch -
pShouldVerify -
Throws:
atg.deployment.common.DeploymentException

invalidateDestinationRepositoryCaches

public void invalidateDestinationRepositoryCaches()
Invalidates the caches on the destination repositories post 1st pass for an ONLINE deployment, and post 2nd pass for a SWITCH deployment. This is required in case post-deployment processing occurs by the target server on its repositories(i.e. Catalog Maintenance Service). The local repositories' caches will need to be invalidated to see those results.


getTargetLiveDataStoreName

public java.lang.String getTargetLiveDataStoreName()
                                            throws atg.deployment.common.DeploymentException
Get the deployment target's live datastore name.

Returns:
The deployment target's live datastore name
Throws:
atg.deployment.common.DeploymentException

getSwitchableDataSources

public java.util.List getSwitchableDataSources()
                                        throws atg.deployment.common.DeploymentException
Returns a list of the SwitchableDataSources configured for the target repositories.

Throws:
atg.deployment.common.DeploymentException

verifyIncrementalAllowed

protected boolean verifyIncrementalAllowed()
                                    throws atg.deployment.common.DeploymentException
Throws:
atg.deployment.common.DeploymentException

calculateDeploymentSnapshots

protected void calculateDeploymentSnapshots()
                                     throws atg.deployment.common.DeploymentException,
                                            javax.ejb.FinderException
Calculate deployment "TO" and "FROM" snapshots based on projects included in this deployment and the type of this deployment.

Throws:
atg.deployment.common.DeploymentException
javax.ejb.FinderException

checkForNoop

protected void checkForNoop()
                     throws atg.deployment.common.DeploymentException
Checks to make sure if this deployment is supposed to do transfer any data, if not a special DeploymentException is thrown.

Throws:
atg.deployment.common.DeploymentException

skipNonEssentialAgent

public boolean skipNonEssentialAgent(AgentRef pAgent,
                                     Status pAgentStatus)
Checks to see if this agent can be skipped or not. That is, if this agent has no deployment responsibilities and encountered a transport error, it can be skipped. This method will also tell the Target to remove it from the accessible agent list.


agentException

public void agentException(int pNewCode,
                           Status pStatus,
                           AgentRef pAgent)
                    throws atg.deployment.common.DeploymentException
Create an exception and update the deployment status based off the passed in agent information.

Throws:
atg.deployment.common.DeploymentException

setAgentStatus

public void setAgentStatus(java.util.Map pToStatus)
                    throws atg.deployment.common.DeploymentException
Set the DeploymentAgent Status remotely from the Publishing server to the specified Status

Throws:
atg.deployment.common.DeploymentException

setAgentStatus

public void setAgentStatus(java.util.Map pToStatus,
                           boolean pUpdateSCIEvents)
                    throws atg.deployment.common.DeploymentException
Set the DeploymentAgent Status remotely from the Publishing server to the specified Status

Throws:
atg.deployment.common.DeploymentException

setAgentStatus

public void setAgentStatus(java.util.Map pToStatus,
                           int status)
                    throws atg.deployment.common.DeploymentException
Set the DeploymentAgent Status remotely from the Publishing server to the specified Status

Throws:
atg.deployment.common.DeploymentException

activateDeployment

public void activateDeployment(boolean pRefreshAffectedRepositoryCaches)
                        throws atg.deployment.common.DeploymentException
Tells each agent to activate the deployment. After activation each agent's state should be IDLE.

Parameters:
pRefreshAffectedRepositoryCaches - If this is set to true, then deployment will notify the DeploymentAgent to refresh the caches of all affected repositories on the agent server. Otherwise, the agent server repository caches will use the default cache invalidation algorithm.
Throws:
atg.deployment.common.DeploymentException

getVersionContainerIncludesChecker

public atg.versionmanager.impl.VersionContainerIncludeChecker getVersionContainerIncludesChecker(boolean pExcludeFiles,
                                                                                                 boolean pExcludeRepositories)
                                                                                          throws atg.deployment.common.DeploymentException
Throws:
atg.deployment.common.DeploymentException

getTransferId

public java.lang.String getTransferId()
Returns the ID of the data transfer as used by the DataTransferAdapter. This is used in the Deployment UI to update the progress bar.

Returns:
the ID used by the DataTransferAdapter

isPercentCompleteAvailable

public boolean isPercentCompleteAvailable()

getActiveWorkspaces

public java.util.Collection getActiveWorkspaces()
                                         throws atg.deployment.common.DeploymentException
Find workspace corresponding to deployment projects which have not been checked in yet.

Returns:
Throws:
atg.deployment.common.DeploymentException

getAbsoluteFullDeploymentSnapshotName

public static java.lang.String getAbsoluteFullDeploymentSnapshotName(Target pTarget,
                                                                     java.lang.String pDeploymentID)

isLoggingDebug

public boolean isLoggingDebug()
Description copied from interface: ApplicationLogging
This method returns whether or not an debug log event should be broadcast.

Specified by:
isLoggingDebug in interface ApplicationLogging
Returns:
boolean true if debug log events should be logged
false if debug log events should not be logged

isLoggingError

public boolean isLoggingError()
Description copied from interface: ApplicationLogging
This method returns whether or not an error log event should be broadcast.

Specified by:
isLoggingError in interface ApplicationLogging
Returns:
boolean true if error log events should be logged
false if error log events should not be logged

isLoggingInfo

public boolean isLoggingInfo()
Description copied from interface: ApplicationLogging
This method returns whether or not an info log event should be broadcast.

Specified by:
isLoggingInfo in interface ApplicationLogging
Returns:
boolean true if info log events should be logged
false if info log events should not be logged

isLoggingWarning

public boolean isLoggingWarning()
Description copied from interface: ApplicationLogging
This method returns whether or not an warning log event should be broadcast.

Specified by:
isLoggingWarning in interface ApplicationLogging
Returns:
boolean true if warning log events should be logged
false if warning log events should not be logged

logDebug

public void logDebug(java.lang.Throwable pThrowable)
Description copied from interface: ApplicationLogging
Logs an debug event with the specified Throwable

Specified by:
logDebug in interface ApplicationLogging

logError

public void logError(java.lang.String pMessage)
Description copied from interface: ApplicationLogging
Logs an error event with the specified message

Specified by:
logError in interface ApplicationLogging

logError

public void logError(java.lang.Throwable pThrowable)
Description copied from interface: ApplicationLogging
Logs an error event with the specified Throwable

Specified by:
logError in interface ApplicationLogging

logError

public void logError(java.lang.String pMessage,
                     java.lang.Throwable pThrowable)
Description copied from interface: ApplicationLogging
Logs an error event with the specified message and Throwable

Specified by:
logError in interface ApplicationLogging

logInfo

public void logInfo(java.lang.String pMessage)
Description copied from interface: ApplicationLogging
Logs an info event with the specified message

Specified by:
logInfo in interface ApplicationLogging

logInfo

public void logInfo(java.lang.Throwable pThrowable)
Description copied from interface: ApplicationLogging
Logs an info event with the specified Throwable

Specified by:
logInfo in interface ApplicationLogging

logInfo

public void logInfo(java.lang.String pMessage,
                    java.lang.Throwable pThrowable)
Description copied from interface: ApplicationLogging
Logs an info event with the specified message and Throwable

Specified by:
logInfo in interface ApplicationLogging

logWarning

public void logWarning(java.lang.String pMessage)
Description copied from interface: ApplicationLogging
Logs an warning event with the specified message

Specified by:
logWarning in interface ApplicationLogging

logWarning

public void logWarning(java.lang.Throwable pThrowable)
Description copied from interface: ApplicationLogging
Logs an warning event with the specified Throwable

Specified by:
logWarning in interface ApplicationLogging

logWarning

public void logWarning(java.lang.String pMessage,
                       java.lang.Throwable pThrowable)
Description copied from interface: ApplicationLogging
Logs an warning event with the specified message and Throwable

Specified by:
logWarning in interface ApplicationLogging

isLoggingTrace

public boolean isLoggingTrace()
Specified by:
isLoggingTrace in interface atg.nucleus.logging.TraceApplicationLogging

logTrace

public void logTrace(java.lang.String pMessage)
Specified by:
logTrace in interface atg.nucleus.logging.TraceApplicationLogging

logTrace

public void logTrace(java.lang.Throwable pThrowable)
Specified by:
logTrace in interface atg.nucleus.logging.TraceApplicationLogging

logTrace

public void logTrace(java.lang.String pMessage,
                     java.lang.Throwable pThrowable)
Specified by:
logTrace in interface atg.nucleus.logging.TraceApplicationLogging

logDebug

public void logDebug(java.lang.String pMessage)
Description copied from interface: ApplicationLogging
Logs an debug event with the specified message

Specified by:
logDebug in interface ApplicationLogging

logDebug

public void logDebug(java.lang.String pMessage,
                     java.lang.Throwable pThrowable)
Description copied from interface: ApplicationLogging
Logs an debug event with the specified message and Throwable

Specified by:
logDebug in interface ApplicationLogging

setLoggingDebug

public void setLoggingDebug(boolean pLogging)
Description copied from interface: ApplicationLogging
Sets whether or not error log events should be logged.

Specified by:
setLoggingDebug in interface ApplicationLogging

setLoggingError

public void setLoggingError(boolean pLogging)
Description copied from interface: ApplicationLogging
Sets whether or not error log events should be logged.

Specified by:
setLoggingError in interface ApplicationLogging

setLoggingInfo

public void setLoggingInfo(boolean pLogging)
Description copied from interface: ApplicationLogging
Sets whether or not info log events should be logged.

Specified by:
setLoggingInfo in interface ApplicationLogging

setLoggingWarning

public void setLoggingWarning(boolean pLogging)
Description copied from interface: ApplicationLogging
Sets whether or not warning log events should be logged.

Specified by:
setLoggingWarning in interface ApplicationLogging

setLoggingTrace

public void setLoggingTrace(boolean pLogging)
Specified by:
setLoggingTrace in interface atg.nucleus.logging.TraceApplicationLogging

getDeploymentAssetStates

public java.util.Collection getDeploymentAssetStates(atg.versionmanager.impl.VersionContainerIncludeChecker pIncludeChecker)
                                              throws atg.deployment.common.DeploymentException,
                                                     VersionException
Throws:
atg.deployment.common.DeploymentException
VersionException

setDeploymentCommitted

public void setDeploymentCommitted()
                            throws atg.deployment.common.DeploymentException
Sets the deployment as committed on both the pub and the agent servers.

Throws:
atg.deployment.DistributedDeploymentException
atg.deployment.common.DeploymentException

setDeploymentCommitted

public void setDeploymentCommitted(boolean pCommitted)
                            throws atg.deployment.common.DeploymentException
Sets the deployment as committed or not on both the pub and the agent servers.

Throws:
atg.deployment.DistributedDeploymentException
atg.deployment.common.DeploymentException