|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.deployment.server.Target
public class Target
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:
Access to deployments associated with a target is available through several useful methods:
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:
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 |
---|
public static final java.lang.String TARGET_BRANCH_NAME_PREFIX
public static java.lang.String CLASS_VERSION
Method Detail |
---|
public java.lang.String getID()
public java.lang.String getName()
public java.lang.String getDescription()
public AgentRef[] getAgents()
public AgentRef[] getResponsibleAgents()
public void setClusterID(java.lang.String pClusterID)
pClusterID
- public java.lang.String getClusterID()
public java.lang.String toString()
toString
in class java.lang.Object
public Status[] initializeAgents()
public Status[] initializeAgents(boolean pOnlyResponsibles)
pOnlyResponsibles
- when set to true only agents with deployment responsibilities are initialized
public boolean isHalted() throws DeploymentException
Deployments can still be scheduled via deploy(), but no deployments will be executed automaticaly by the queue as long as the queue is halted.
DeploymentException
- if there is an error discerning whether or not the queue is halted (i.e. communication/repository errors)public void haltQueue() throws DeploymentException
Deployments can still be scheduled via deploy(), but no deployments will be executed automaticaly by the queue as long as the queue is halted.
DeploymentException
- if there is an error restarting the queue is halted (i.e. communication/repository errors)public void resumeQueue() throws DeploymentException
Deployments can still be scheduled via deploy(), but no deployments will be executed automaticaly by the queue as long as the queue is halted.
DeploymentException
- if there is an error restarting the queue is halted (i.e. communication/repository errors)public boolean isInitializing() throws DeploymentException
DeploymentException
- is anything goes wrong, reading the status from the databasepublic void setIsReverseDeployment(boolean pReverseDeployment)
public boolean isReverseDeployment()
public boolean isInitializationSource() throws DeploymentException
DeploymentException
- is anything goes wrong, reading the status from the databasepublic boolean isAccessible()
public boolean isDeployable()
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.
public boolean isIncrementallyDeployable() throws DeploymentException
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.
DeploymentException
- if a required agent is inaccessiblepublic Status getStatus()
public Status getCurrentStatus()
public Status[] getAgentStatuses()
public Deployment getCurrentDeployment() throws DeploymentException
DeploymentException
- if there is an error accessing the deployment repository - see the wrapped exceptionatg.deployment.DeploymentException
public Deployment getNextDeployment() throws DeploymentException
DeploymentException
public int getCountOfPendingDeployments() throws DeploymentException
DeploymentException
public Deployment[] getPendingDeployments(int pStartIndex, int pCount) throws DeploymentException
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.
DeploymentException
public int getCountOfQueuedDeployments() throws DeploymentException
DeploymentException
public Deployment[] getQueuedDeployments(int pStartIndex, int pCount) throws DeploymentException
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.
DeploymentException
public int getCountOfScheduledDeployments() throws DeploymentException
DeploymentException
public Deployment[] getScheduledDeployments(int pStartIndex, int pCount) throws DeploymentException
to get a list of all pending deployments use @link getPendingDeployments()
@see Status.WAITING_SCHEDULED
DeploymentException
public Project getLastDeployedProject() throws DeploymentException
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 targetpublic int getCountOfDeployedProjects() throws DeploymentException
DeploymentException
public Project[] getDeployedProjects(int pStartIndex, int pCount) throws DeploymentException
pStartIndex
- pCount
-
DeploymentException
public java.util.Map getDestinations() throws DeploymentException
DeploymentException
public Deployment deployInitial(boolean pForceDeployment, java.lang.String pInitiatorID) throws DeploymentException
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.
pForceDeployment
- true if a deployment should be performed, false if agents should be "flagged" as deployed topInitiatorID
- an identifying string of "who" is effectively performing this action
DeploymentException
Deployment
public Deployment deployProjects(java.lang.String[] pProjectIDs, boolean pForceFull, java.util.Calendar pDeployTime, java.lang.String pInitiatorID, int pStrictFileOps, int pStrictRepoOps) throws DeploymentException
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.
pProjectIDs
- the list of Project IDs (Project.getId()) for the Projects to deploy to the targetpForceFull
- whether or not to require the deployment to be a full deploymentpDeployTime
- a specific time to run the deployment, or NULL if run as soon as possiblepInitiatorID
- an identifying string of "who" is effectively performing this actionpStrictFileOps
- an override to the global setting in /atg/deployment/DeploymentManagerpStrictRepoOps
- an override to the global setting in /atg/deployment/DeploymentManager
DeploymentException
Deployment
public Deployment deployProjects(java.lang.String[] pProjectIDs, boolean pForceFull, java.util.Calendar pDeployTime, java.lang.String pInitiatorID) throws DeploymentException
deployProjects
. This method doesn't specify strict file
or repository update operations and will default to global settings in
/atg/deployment/DeploymentManager
.
pProjectIDs
- pForceFull
- pDeployTime
- pInitiatorID
-
DeploymentException
public Deployment deployPrevious(java.lang.String pProjectID, boolean pForceFull, java.util.Calendar pDeployTime, java.lang.String pInitiatorID, int pStrictFileOps, int pStrictRepoOps) throws DeploymentException
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.
pProjectIDs
- the list of Project IDs (Project.getId()) for the Projects to deploy to the targetpForceFull
- whether or not to require the deployment to be a full deploymentpDeployTime
- a specific time to run the deployment, or NULL if run as soon as possiblepInitiatorID
- an identifying string of "who" is effectively performing this actionpStrictFileOps
- an override to the global setting in /atg/deployment/DeploymentManagerpStrictRepoOps
- an override to the global setting in /atg/deployment/DeploymentManager
DeploymentException
Deployment
public Deployment deployPrevious(java.lang.String pProjectID, boolean pForceFull, java.util.Calendar pDeployTime, java.lang.String pInitiatorID) throws DeploymentException
deployPrevious
. This method doesn't specify strict file
or repository update operations and will default to global settings in
/atg/deployment/DeploymentManager
.
pProjectID
- pForceFull
- pDeployTime
- pInitiatorID
-
DeploymentException
public Deployment deployRevert(java.lang.String pProjectID, boolean pForceFull, java.util.Calendar pDeployTime, java.lang.String pInitiatorID) throws DeploymentException
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.
pProjectID
- Project.getId() from the Project to revert from the targetpForceFull
- whether or not to require the deployment to be a full deploymentpDeployTime
- a specific time to run the deployment, or NULL if run as soon as possiblepInitiatorID
- an identifying string of "who" is effectively performing this action
DeploymentException
Deployment
public void revert(java.lang.String pProjectID, java.lang.String pInitiatorID) throws DeploymentException
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.
pProjectID
- Project.getId() from the Project to revert from the targetpInitiatorID
- an identifying string of "who" is effectively performing this action
DeploymentException
Deployment
,
Project
public void criticalReset(java.lang.String pInitiatorID)
pInitiatorID
- an identifier of who is requesting the resetpublic java.lang.Long getDeployedSnapshotCreationTime() throws DeploymentException
DeploymentException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |