atg.deployment.server
Class Target

java.lang.Object
  extended by atg.deployment.server.Target

public class Target
extends java.lang.Object

A simple interface for managing a deployment target and deployments to that target.

Targets are generated when the deployment topology is initialized. Instances of Targets are obtained from the DeploymentServer via the getTargets(), getTargetByName(), and getTargetByID() methods.

Two lists of the agents that make up a target are provided. The method getAgents() returns all agents that make up the target. The method getResponsibleAgents() only returns those agents that have deployment responsibilities.

The Target class is the conceptual single entity formed by the group of agents that define the target. As a whole, the Target can be queried through the following methods:

A running deployment to a target is handled through the Deployment class. Since a physical target can only receive one deployment at a time, each target manages a separate schedule and queue of deployments. Deployments of new Projects are scheduled or queued via the deployProjects() method. Temporary "back deployments" to previous deployment states are scheduled or queued via the deployPrevious() method. And in some cases, deployInitial() can be used when a target is first created or to return a target to its primordial deployment state.

Access to deployments associated with a target is available through several useful methods:

Just as a running deployment is controled through the Deployment instance directly, deployments can be removed from the target's schedule or queue by calling Deployment.delete().

A Project can be deployed to a target before it has been checked in and rendered immutable. This is a handy way of viewing a Project's changes before making them final and visible to other users to build on. If such a Project must be removed from the target, there are two methods to do so, revert() and deployRevert(). Both of these methods disassociates the Project from the target.

Some utility methods are also available but should be used carefully or not at all, as they are not considered part of the standard deployment process:

Target instances should not be cached or held onto, as a call to DeploymentServer.reinitializeTopology() will render them defunct. The DeploymentServer should always be used as the source for obtaining the current instance of a target.

See Also:
DeploymentServer, Status, Deployment, AgentRef

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String TARGET_BRANCH_NAME_PREFIX
           
 
Method Summary
 void criticalReset(java.lang.String pInitiatorID)
          Does a "hard" reset of the target and the target agents.
 Deployment deployInitial(boolean pForceDeployment, java.lang.String pInitiatorID)
          Deploys the initial state of the target.
 Deployment deployPrevious(java.lang.String pProjectID, boolean pForceFull, java.util.Calendar pDeployTime, java.lang.String pInitiatorID)
          See deployPrevious.
 Deployment deployPrevious(java.lang.String pProjectID, boolean pForceFull, java.util.Calendar pDeployTime, java.lang.String pInitiatorID, int pStrictFileOps, int pStrictRepoOps)
          Performs a "back deployment" to the Target returning it to the state when the given Project was deployed and checked-in.
 Deployment deployProjects(java.lang.String[] pProjectIDs, boolean pForceFull, java.util.Calendar pDeployTime, java.lang.String pInitiatorID)
          See deployProjects.
 Deployment deployProjects(java.lang.String[] pProjectIDs, boolean pForceFull, java.util.Calendar pDeployTime, java.lang.String pInitiatorID, int pStrictFileOps, int pStrictRepoOps)
          Deploys the specified Projects to this target.
 Deployment deployRevert(java.lang.String pProjectID, boolean pForceFull, java.util.Calendar pDeployTime, java.lang.String pInitiatorID)
          Functions the same as deploy() except that revert() is called first and the result is deployed to the target.
 AgentRef[] getAgents()
          The list of all deployment agents that make up the target.
 Status[] getAgentStatuses()
          A convenience method that queries and returns the status of each agent in the target.
 java.lang.String getClusterID()
           
 int getCountOfDeployedProjects()
          Gets the count of projects merged to this target.
 int getCountOfPendingDeployments()
          Find the count of pending(Queued and Scheduled) deployments for this targets.
 int getCountOfQueuedDeployments()
          Find the count of queued deployments for this targets
 int getCountOfScheduledDeployments()
          Find the count of pending deployments for this targets
 Deployment getCurrentDeployment()
          The current deployment for this Target.
 Status getCurrentStatus()
          Returns the current status of this Target regardless of the current cluster.
 Project[] getDeployedProjects(int pStartIndex, int pCount)
          Gets the list of projects merged to this target.
 java.lang.Long getDeployedSnapshotCreationTime()
          Returns the creation time (as a Long ) of the last deployed snapshot.
 java.lang.String getDescription()
          A brief description of this target, any old information that is desired.
 java.util.Map getDestinations()
          Get a Map of destination repository path or host:port names, keyed by the source repository or VFS nucleus path.
 java.lang.String getID()
          The repository ID of this Target.
 Project getLastDeployedProject()
          Returns the Project that was last successfully deployed to this target.
 java.lang.String getName()
          The name given this target.
 Deployment getNextDeployment()
          A convenience method that returns the next logical deployment to run.
 Deployment[] getPendingDeployments(int pStartIndex, int pCount)
          Returns the list of pending Deployments as an array ordered by schedule of execution.
 Deployment[] getQueuedDeployments(int pStartIndex, int pCount)
          Returns the list of QUEUED Deployments as an array ordered by schedule of execution.
 AgentRef[] getResponsibleAgents()
          Deployment agents in this target that have deployment responsibilities.
 Deployment[] getScheduledDeployments(int pStartIndex, int pCount)
          Returns the list of SCHEDULED Deployments as an array ordered by schedule of execution.
 Status getStatus()
          Returns the status of this Target.
 void haltQueue()
          Halts handling of pending deployments on this target.
 Status[] initializeAgents()
          Runs through the list of agent statuses and tries once again to initialize any uninitialized agent transports.
 Status[] initializeAgents(boolean pOnlyResponsibles)
          Runs through the list of agent statuses and tries once again to initialize any uninitialized agent transports.
 boolean isAccessible()
          Whether or not this target is currently accessible.
 boolean isDeployable()
          Whether or not this target is capable of being deployed to.
 boolean isHalted()
          Whether or not this target's deployment queue is halted.
 boolean isIncrementallyDeployable()
          Whether or not this target is capable of receiving an incremental deployment or if a full deployment is necessary.
 boolean isInitializationSource()
          Returns whether or not this Target is currently being used as an initialization source for another Target.
 boolean isInitializing()
          Returns whether or not this Target is currently initializing due to a Topology change.
 boolean isReverseDeployment()
           
 void resumeQueue()
          Resumes handling of pending deployments on this target.
 void revert(java.lang.String pProjectID, java.lang.String pInitiatorID)
          Prepares the target to revert the prior deployment of an open Project.
 void setClusterID(java.lang.String pClusterID)
           
 void setIsReverseDeployment(boolean pReverseDeployment)
           
 java.lang.String toString()
          Returns this Target as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TARGET_BRANCH_NAME_PREFIX

public static final java.lang.String TARGET_BRANCH_NAME_PREFIX
See Also:
Constant Field Values

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Method Detail

getID

public java.lang.String getID()
The repository ID of this Target.


getName

public java.lang.String getName()
The name given this target.


getDescription

public java.lang.String getDescription()
A brief description of this target, any old information that is desired.


getAgents

public AgentRef[] getAgents()
The list of all deployment agents that make up the target. The topology rules insure this value to be non-null.


getResponsibleAgents

public AgentRef[] getResponsibleAgents()
Deployment agents in this target that have deployment responsibilities. The topology rules insure this value to be non-null.


setClusterID

public void setClusterID(java.lang.String pClusterID)
Parameters:
pClusterID -

getClusterID

public java.lang.String getClusterID()
Returns:

toString

public java.lang.String toString()
Returns this Target as a String. Specifically, the String form of this Target is its name.

Overrides:
toString in class java.lang.Object

initializeAgents

public Status[] initializeAgents()
Runs through the list of agent statuses and tries once again to initialize any uninitialized agent transports.

Returns:
Status[] array of Status objects returned from each agent in matching order to the array returned from getAgents()

initializeAgents

public Status[] initializeAgents(boolean pOnlyResponsibles)
Runs through the list of agent statuses and tries once again to initialize any uninitialized agent transports.

Parameters:
pOnlyResponsibles - when set to true only agents with deployment responsibilities are initialized
Returns:
Status[] array of Status objects returned from each agent in matching order to the array returned from getAgents()

isHalted

public boolean isHalted()
                 throws DeploymentException
Whether or not this target's deployment queue is halted.

Deployments can still be scheduled via deploy(), but no deployments will be executed automaticaly by the queue as long as the queue is halted.

Returns:
true if the target queue is halted
false if the target queue not halted
Throws:
DeploymentException - if there is an error discerning whether or not the queue is halted (i.e. communication/repository errors)

haltQueue

public void haltQueue()
               throws DeploymentException
Halts handling of pending deployments on this target.

Deployments can still be scheduled via deploy(), but no deployments will be executed automaticaly by the queue as long as the queue is halted.

Throws:
DeploymentException - if there is an error restarting the queue is halted (i.e. communication/repository errors)

resumeQueue

public void resumeQueue()
                 throws DeploymentException
Resumes handling of pending deployments on this target.

Deployments can still be scheduled via deploy(), but no deployments will be executed automaticaly by the queue as long as the queue is halted.

Throws:
DeploymentException - if there is an error restarting the queue is halted (i.e. communication/repository errors)

isInitializing

public boolean isInitializing()
                       throws DeploymentException
Returns whether or not this Target is currently initializing due to a Topology change. Targets cannot perform certain actions while initialization is occuring, such as execute deployments or perform reverts.

Returns:
boolean true if the Target is initializing
false if the Target is not initializing
Throws:
DeploymentException - is anything goes wrong, reading the status from the database

setIsReverseDeployment

public void setIsReverseDeployment(boolean pReverseDeployment)

isReverseDeployment

public boolean isReverseDeployment()

isInitializationSource

public boolean isInitializationSource()
                               throws DeploymentException
Returns whether or not this Target is currently being used as an initialization source for another Target. Targets cannot perform certain actions while initialization is occuring, such as execute deployments or perform reverts. This limitation includes when another Target is initializating from this Target.

Returns:
boolean true if the Target is acting as an intialization source for another Target
false otherwise
Throws:
DeploymentException - is anything goes wrong, reading the status from the database

isAccessible

public boolean isAccessible()
Whether or not this target is currently accessible. A target can become inaccessible if one or more of the target agents with deployment responsibilities reports a transport error.

Returns:
boolean true if the target is currently accessible
false if the target is currently unaccessible

isDeployable

public boolean isDeployable()
Whether or not this target is capable of being deployed to. Even if the local deployment server does not have a deployment for this target, the target still might not accept a deployment. Specifically, targets with inaccessible responsible agents or targets that are being deployed to by another server cannot be deployed to.

This method does not comment on whether or not a target can schedule or queue deployments, only whether or not a deployment can currently run against the target. Thus the usefulness of this method is limited.

Note: Calling this method will also call isAccessible() internally.

Returns:
boolean true if the target can be deployed to
false if the target cannot be deployed to

isIncrementallyDeployable

public boolean isIncrementallyDeployable()
                                  throws DeploymentException
Whether or not this target is capable of receiving an incremental deployment or if a full deployment is necessary.

NOTE: If a required agent is inaccessible, a deployment exception is thrown rather than making this method return a potentially false negative. Whether or not an agent is required depends on whether or not the agent has deployment responsibilities and whether or not allowMissingNonEssentialAgents is true on the DeploymentServer.

Returns:
boolean true if this target can be deployed to incrementally
false if this target must have a full deployment
Throws:
DeploymentException - if a required agent is inaccessible

getStatus

public Status getStatus()
Returns the status of this Target. Target status always comes from the responsible deployment agents that make up the target. With a Target being a group of agents, the "worst-case" status is returned. For example, if there are five agents that make up the target with four reporting idle and one reporting an error, the Target will return the error as the Target status.


getCurrentStatus

public Status getCurrentStatus()
Returns the current status of this Target regardless of the current cluster. Target status always comes from the responsible deployment agents that make up the target. With a Target being a group of agents, the "worst-case" status is returned. For example, if there are five agents that make up the target with four reporting idle and one reporting an error, the Target will return the error as the Target status.


getAgentStatuses

public Status[] getAgentStatuses()
A convenience method that queries and returns the status of each agent in the target.

Returns:
Status[] array of Status objects returned from each agent in matching order to the array returned from getAgents()

getCurrentDeployment

public Deployment getCurrentDeployment()
                                throws DeploymentException
The current deployment for this Target. Null if there is no deployment currently associated with the target.

Throws:
DeploymentException - if there is an error accessing the deployment repository - see the wrapped exception
See Also:
atg.deployment.DeploymentException

getNextDeployment

public Deployment getNextDeployment()
                             throws DeploymentException
A convenience method that returns the next logical deployment to run. Note that the next deployment to run may be waiting in the queue or scheduled for much later. Essentially, calling this method should be equivalent to calling getPendingDeployments(0, 1).

Returns:
Deployment the next deployment to run or null if there are no pending deployments
Throws:
DeploymentException

getCountOfPendingDeployments

public int getCountOfPendingDeployments()
                                 throws DeploymentException
Find the count of pending(Queued and Scheduled) deployments for this targets.

Throws:
DeploymentException

getPendingDeployments

public Deployment[] getPendingDeployments(int pStartIndex,
                                          int pCount)
                                   throws DeploymentException
Returns the list of pending Deployments as an array ordered by schedule of execution.

The list of pending Deployments includes scheduled Deployments whose scheduled execution time has not yet come to term as well as all Deployments that are queued for immediate execution. Each Deployment's Status indicates whether the Deployment is scheduled or waiting to run.

The list of pending Deployments does *NOT* include the current running Deployment nor any completed Deployments.

Throws:
DeploymentException

getCountOfQueuedDeployments

public int getCountOfQueuedDeployments()
                                throws DeploymentException
Find the count of queued deployments for this targets

Throws:
DeploymentException

getQueuedDeployments

public Deployment[] getQueuedDeployments(int pStartIndex,
                                         int pCount)
                                  throws DeploymentException
Returns the list of QUEUED Deployments as an array ordered by schedule of execution. Queued deployments are ones that are waiting for their turn to be executed on a target. Their deployTime has already occurred and they are possibly waiting for a deployment to finish which is ahead of them or for the target to be freed from a failed deployment.

to get a list of all pending deployments use @link getPendingDeployments()

The list of queued (@see Status.WAITING_QUEUED) deployments does *NOT* include the current running Deployment nor any completed Deployments.

Throws:
DeploymentException

getCountOfScheduledDeployments

public int getCountOfScheduledDeployments()
                                   throws DeploymentException
Find the count of pending deployments for this targets

Throws:
DeploymentException

getScheduledDeployments

public Deployment[] getScheduledDeployments(int pStartIndex,
                                            int pCount)
                                     throws DeploymentException
Returns the list of SCHEDULED Deployments as an array ordered by schedule of execution. Scheduled deployments are ones that are waiting for their turn to be executed on a target but their time of execution is in the future. Scheduled deployments become queued once the time for their execution arrives.

to get a list of all pending deployments use @link getPendingDeployments()

@see Status.WAITING_SCHEDULED

Throws:
DeploymentException

getLastDeployedProject

public Project getLastDeployedProject()
                               throws DeploymentException
Returns the Project that was last successfully deployed to this target. Null is returned if the target does not know which Project was deployed last.

Returns:
Project the last deployed Project or null
Throws:
DeploymentException - if the target cannot be accessed, if there is a mis-match between agents of which project was deployed last, or if there were problems finding the Project refered to by the target

getCountOfDeployedProjects

public int getCountOfDeployedProjects()
                               throws DeploymentException
Gets the count of projects merged to this target. Sorted by their merge time in descending order.

Throws:
DeploymentException

getDeployedProjects

public Project[] getDeployedProjects(int pStartIndex,
                                     int pCount)
                              throws DeploymentException
Gets the list of projects merged to this target. Sorted by their merge time in descending order.

Parameters:
pStartIndex -
pCount -
Throws:
DeploymentException

getDestinations

public java.util.Map getDestinations()
                              throws DeploymentException
Get a Map of destination repository path or host:port names, keyed by the source repository or VFS nucleus path. This is configured in the deployment UI, and is used by the DAF deployment system to configure the destination repository/VFS for a given source when creating DeploymentData objects.

Returns:
Map
Throws:
DeploymentException

deployInitial

public Deployment deployInitial(boolean pForceDeployment,
                                java.lang.String pInitiatorID)
                         throws DeploymentException
Deploys the initial state of the target.

When a target is first created it must be initialized properly. The method deployInitial() serves both as a means of performing this initialization as well re-deploying the targets initial state before any other deployments were made to the target.

deployInitial() is called automatically when the topology is initialized and a target is first created.

In the case where data has been exported from the target and imported into the publishing server, there may be little point in deploying the data back out to the target. Though this might be desirable just to insure that what is in the publishing server is exactly what is on the target, some may prefer another option. The parameter pForceDeployment when set to true will initialize the target on the server as normal and perform a full deployment of the data back to the target. When pForceDeployment is set to false, instead of deploying the data, the target will simply be flagged with the necessary information to appear as if a deployment had occured. This "flagging" of the target could save time by skipping an unnecessary full deployment and allowing incremental deployments as soon as the target is finished initializing.

NOTE: If this method is not called, or if the deployment scheduled by this method fails, any standard deployment of a project will also peform the necessary initializations. This method is simply provided in the case where target initializaton is desirable before any projects exist.

Parameters:
pForceDeployment - true if a deployment should be performed, false if agents should be "flagged" as deployed to
pInitiatorID - an identifying string of "who" is effectively performing this action
Returns:
Deployment a deployment object representing the new deployment
Throws:
DeploymentException
See Also:
Deployment

deployProjects

public Deployment deployProjects(java.lang.String[] pProjectIDs,
                                 boolean pForceFull,
                                 java.util.Calendar pDeployTime,
                                 java.lang.String pInitiatorID,
                                 int pStrictFileOps,
                                 int pStrictRepoOps)
                          throws DeploymentException
Deploys the specified Projects to this target.

Specifically, deployProjects() schedules or queues the deployment of a list of Projects. This deployment is considered a "standard" or "forward" deployment in that the Projects deployed should either be checked-in and never before deployed to this Target, not yet checked-in, or a mixture of the two. Projects that are not checked-in can be deployed and re-deployed without problem till they are checked-in. If this method is called with a project that has been checked-in and already deployed to this Target then a DeploymentException will be thrown (see deployPrevious()).

NOTE: if this method is called twice with the same valid Project, two separate deployments will be scheduled. This is okay. If the first deployment succeeds then the second one will be ignored when its deploy time is reached. This is because the deployment system knows that the second deployment was intended as a forward deployment, a forward deployment that has already occured.

If pForceFull is true, a full deployment will be forced, otherwise an incremental deployment will be used if possible.

If a deploy time is specified, the deployment will be scheduled for execution at the specified time. If no deploy time is provided, the deployment will either run immediately or be queued behind any deployments already queued to run immediately. As scheduled deployments become ready to run, they get queued behind existing deployments that are already queued to run immediately.

Use the Deployment.runNext() method to push any deployment to the head of the list of pending deployments, thus making it the next deployment to run. Any currently running deployment will be allowed to finish (or can be stopped). Calling runNext() on a scheduled deployment will supercede the scheduling request.

An optional string may be passed in to identify the initiator of this new deployment. The information is associated with the deployment history entry for this action and is mainly meant as a convenience for UIs. If calling code does not have a "user" then an identifying tag for the call would be appropriate.

Parameters:
pProjectIDs - the list of Project IDs (Project.getId()) for the Projects to deploy to the target
pForceFull - whether or not to require the deployment to be a full deployment
pDeployTime - a specific time to run the deployment, or NULL if run as soon as possible
pInitiatorID - an identifying string of "who" is effectively performing this action
pStrictFileOps - an override to the global setting in /atg/deployment/DeploymentManager
pStrictRepoOps - an override to the global setting in /atg/deployment/DeploymentManager
Returns:
Deployment a deployment object representing the new deployment
Throws:
DeploymentException
See Also:
Deployment

deployProjects

public Deployment deployProjects(java.lang.String[] pProjectIDs,
                                 boolean pForceFull,
                                 java.util.Calendar pDeployTime,
                                 java.lang.String pInitiatorID)
                          throws DeploymentException
See deployProjects. This method doesn't specify strict file or repository update operations and will default to global settings in /atg/deployment/DeploymentManager.

Parameters:
pProjectIDs -
pForceFull -
pDeployTime -
pInitiatorID -
Returns:
Throws:
DeploymentException

deployPrevious

public Deployment deployPrevious(java.lang.String pProjectID,
                                 boolean pForceFull,
                                 java.util.Calendar pDeployTime,
                                 java.lang.String pInitiatorID,
                                 int pStrictFileOps,
                                 int pStrictRepoOps)
                          throws DeploymentException
Performs a "back deployment" to the Target returning it to the state when the given Project was deployed and checked-in.

The deployment of Projects to a Target produces a timeline for the Target. The list of deployed Projects serves as a series of markers indicating what content appeared on the Target and when. The deployPrevious() method is used with a Project from the list of deployed Projects to temporarily return a Target to the state when the Project was previously deployed. This is a useful feature if a target must be quickly reverted to some arbitrary point in its history until some emergency change can be prepared and deployed.

Back deploying a Target does not delete any of the Projects that were deployed after the Project back-deployed to. Such Projects continue to exist in the Publishing server, are still associated with the Target in the order they were deployed, but have merely been temporarily removed from the Target. Think of a back deployment simply as a quick re-winding of a tape cassette. Once back-deployed, the next new Project deployed to the Target will re-deploy all the "rewound" Projects. Calling deployPrevious() effectivly winds the deployment tape cassette to any point in its deployment history using the ordered list of previously deployed Projects.

If pForceFull is true, a full deployment will be forced, otherwise an incremental deployment will be used if possible.

If a deploy time is specified, the deployment will be scheduled for execution at the specified time. If no deploy time is provided, the deployment will either run immediately or be queued behind any deployments already queued to run immediately. As scheduled deployments become ready to run, they get queued behind existing deployments that are already queued to run immediately.

Use the Deployment.runNext() method to push any deployment to the head of the list of pending deployments, thus making it the next deployment to run. Any currently running deployment will be allowed to finish (or can be stopped). Calling runNext() on a scheduled deployment will supercede the scheduling request.

An optional string may be passed in to identify the initiator of this new deployment. The information is associated with the deployment history entry for this action and is mainly meant as a convenience for UIs. If calling code does not have a "user" then an identifying tag for the call would be appropriate.

Parameters:
pProjectIDs - the list of Project IDs (Project.getId()) for the Projects to deploy to the target
pForceFull - whether or not to require the deployment to be a full deployment
pDeployTime - a specific time to run the deployment, or NULL if run as soon as possible
pInitiatorID - an identifying string of "who" is effectively performing this action
pStrictFileOps - an override to the global setting in /atg/deployment/DeploymentManager
pStrictRepoOps - an override to the global setting in /atg/deployment/DeploymentManager
Returns:
Deployment a deployment object representing the new deployment
Throws:
DeploymentException
See Also:
Deployment

deployPrevious

public Deployment deployPrevious(java.lang.String pProjectID,
                                 boolean pForceFull,
                                 java.util.Calendar pDeployTime,
                                 java.lang.String pInitiatorID)
                          throws DeploymentException
See deployPrevious. This method doesn't specify strict file or repository update operations and will default to global settings in /atg/deployment/DeploymentManager.

Parameters:
pProjectID -
pForceFull -
pDeployTime -
pInitiatorID -
Returns:
Throws:
DeploymentException

deployRevert

public Deployment deployRevert(java.lang.String pProjectID,
                               boolean pForceFull,
                               java.util.Calendar pDeployTime,
                               java.lang.String pInitiatorID)
                        throws DeploymentException
Functions the same as deploy() except that revert() is called first and the result is deployed to the target.

Projects that have been checked-in cannot be reverted from a target. Passing such a Project into this method will result in a DeploymentException.

An optional string may be passed in to identify the initiator of this revert. The information is associated with the deployment history entry for this action and is mainly meant as a convenience for UIs. If calling code does not have a "user" then an identifying tag for the call would be appropriate.

Parameters:
pProjectID - Project.getId() from the Project to revert from the target
pForceFull - whether or not to require the deployment to be a full deployment
pDeployTime - a specific time to run the deployment, or NULL if run as soon as possible
pInitiatorID - an identifying string of "who" is effectively performing this action
Returns:
Deployment a deployment object representing the new deployment
Throws:
DeploymentException
See Also:
Deployment

revert

public void revert(java.lang.String pProjectID,
                   java.lang.String pInitiatorID)
            throws DeploymentException
Prepares the target to revert the prior deployment of an open Project.

The parent versions of assets modified in the Project are re-associated with the target rather than the modified versions of the assets. No deployment is performed, only the necessary work to revert the target. The revert of the Project *cannot* be deployed at this point, but will be picked up with the future deployment of any previously undeployed Project. (Confusing, isn't it.) This methodology is useful when a Project *must* release asset locks but cannot schedule and wait for a deployment of the reverted project to complete.

Calling Target.deploy() with the reverted project will simply re-deploy the modified assets of the Project to the Target. To revert *and* deploy a Project the deployRevert() method must be called.

Projects that have been checked-in cannot be reverted from a target. Passing such a Project into this method will result in a DeploymentException.

NOTE: Calling this method will not release any asset locks directly. To attempt asset lock release, Project.releaseAssetLocks() must be called after Target.revert(). This is equivalent, more or less, to calling Project.revertDeployments().

An optional string may be passed in to identify the initiator of this revert. The information is associated with the deployment history entry for this action and is mainly meant as a convenience for UIs. If calling code does not have a "user" then an identifying tag for the call would be appropriate.

Parameters:
pProjectID - Project.getId() from the Project to revert from the target
pInitiatorID - an identifying string of "who" is effectively performing this action
Throws:
DeploymentException
See Also:
Deployment, Project

criticalReset

public void criticalReset(java.lang.String pInitiatorID)
Does a "hard" reset of the target and the target agents. This is a dangerous method but is provided for managing a target that is having stateful problems. It should only be used as a last resort when rebooting is not an option.

Parameters:
pInitiatorID - an identifier of who is requesting the reset

getDeployedSnapshotCreationTime

public java.lang.Long getDeployedSnapshotCreationTime()
                                               throws DeploymentException
Returns the creation time (as a Long ) of the last deployed snapshot. The time known to the version manager. This is an expensive operation since it causes the target to

Returns:
the time as long
Throws:
DeploymentException