Package org.craftercms.deployer.api
Class Deployment
- java.lang.Object
-
- org.craftercms.deployer.api.Deployment
-
public class Deployment extends Object
Represents a deployment. Contains every important status information of a particular deployment execution.- Author:
- avasquez
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Deployment.Mode
static class
Deployment.Status
-
Field Summary
Fields Modifier and Type Field Description protected ChangeSet
changeSet
protected ZonedDateTime
end
protected Lock
lock
protected Deployment.Mode
mode
protected Map<String,Object>
params
protected List<ProcessorExecution>
processorExecutions
protected ZonedDateTime
start
protected Deployment.Status
status
protected Target
target
-
Constructor Summary
Constructors Constructor Description Deployment(Target target)
Deployment(Target target, Map<String,Object> params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParam(String name, Object value)
Adds a param that can be used by processors during the deployment.void
addProcessorExecution(ProcessorExecution status)
Adds aProcessorExecution
to the list.void
end(Deployment.Status status)
Ends the deployment with the specified status.ChangeSet
getChangeSet()
Returns the change set of the deployment.Long
getDuration()
Returns the duration of the deployment.ZonedDateTime
getEnd()
Returns the end date of the deployment.Deployment.Mode
getMode()
Object
getParam(String name)
Returns a param that can be used by processors during the deployment.List<ProcessorExecution>
getProcessorExecutions()
Returns the list ofProcessorExecution
s.ZonedDateTime
getStart()
Returns the start date of the deployment.Deployment.Status
getStatus()
Returns the status of the deployment, either success or failure.Target
getTarget()
Returns theTarget
being deployed.boolean
isChangeSetEmpty()
Returns true if the change set is null or empty.boolean
isRunning()
Returns true if the deployment is still running.void
removeParam(String name)
Removes the specified paramvoid
setChangeSet(ChangeSet changeSet)
Sets the change set of the deployment.void
start()
Starts the deployment.String
toString()
-
-
-
Field Detail
-
target
protected Target target
-
start
protected volatile ZonedDateTime start
-
end
protected volatile ZonedDateTime end
-
status
protected volatile Deployment.Status status
-
changeSet
protected volatile ChangeSet changeSet
-
processorExecutions
protected List<ProcessorExecution> processorExecutions
-
lock
protected Lock lock
-
mode
protected Deployment.Mode mode
-
-
Method Detail
-
getStart
public ZonedDateTime getStart()
Returns the start date of the deployment.
-
getEnd
public ZonedDateTime getEnd()
Returns the end date of the deployment.
-
isRunning
public boolean isRunning()
Returns true if the deployment is still running.
-
getDuration
public Long getDuration()
Returns the duration of the deployment.
-
getStatus
public Deployment.Status getStatus()
Returns the status of the deployment, either success or failure.
-
getMode
public Deployment.Mode getMode()
-
getChangeSet
public ChangeSet getChangeSet()
Returns the change set of the deployment.
-
setChangeSet
public void setChangeSet(ChangeSet changeSet)
Sets the change set of the deployment.
-
isChangeSetEmpty
public boolean isChangeSetEmpty()
Returns true if the change set is null or empty.
-
start
public void start()
Starts the deployment.
-
end
public void end(Deployment.Status status)
Ends the deployment with the specified status.
-
getProcessorExecutions
public List<ProcessorExecution> getProcessorExecutions()
Returns the list ofProcessorExecution
s.
-
addProcessorExecution
public void addProcessorExecution(ProcessorExecution status)
Adds aProcessorExecution
to the list.
-
addParam
public void addParam(String name, Object value)
Adds a param that can be used by processors during the deployment.- Parameters:
name
- the name of the paramvalue
- the value of the param
-
getParam
public Object getParam(String name)
Returns a param that can be used by processors during the deployment.- Parameters:
name
- the name of the param- Returns:
- the value of the param
-
removeParam
public void removeParam(String name)
Removes the specified param- Parameters:
name
- the name of the param
-
-