public class DeploymentOperation extends Object
A DeploymentOperation allows bundling multiple deployment steps into a composite operation that succeeds or fails atomically.
The DeploymentOperation is composed of a list of individual steps (
DeploymentOperationStep
). Each step may or may not install new
services into the container. If one of the steps fails, the operation makes
sure that
DeploymentOperationStep.cancelOperationStep(DeploymentOperation)
method.Modifier and Type | Class and Description |
---|---|
static class |
DeploymentOperation.DeploymentOperationBuilder |
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
attachments
a list of attachments allows to pass state from one operation to another
|
protected DeploymentOperationStep |
currentStep |
protected List<String> |
installedServices
the list of services installed by this operation.
|
protected boolean |
isRollbackOnFailure |
protected String |
name
the name of this composite operation
|
protected PlatformServiceContainer |
serviceContainer
the service container
|
protected List<DeploymentOperationStep> |
steps
the list of steps that make up this composite operation
|
protected List<DeploymentOperationStep> |
successfulSteps
a list of steps that completed successfully
|
Constructor and Description |
---|
DeploymentOperation(String name,
PlatformServiceContainer container,
List<DeploymentOperationStep> steps) |
Modifier and Type | Method and Description |
---|---|
void |
addAttachment(String name,
Object value) |
void |
addStep(DeploymentOperationStep step)
Add a new atomic step to the composite operation.
|
void |
execute() |
<S> S |
getAttachment(String name) |
List<String> |
getInstalledServices() |
PlatformServiceContainer |
getServiceContainer() |
protected void |
rollbackOperation() |
void |
serviceAdded(String serviceName) |
protected final String name
protected final PlatformServiceContainer serviceContainer
protected final List<DeploymentOperationStep> steps
protected final List<DeploymentOperationStep> successfulSteps
protected List<String> installedServices
rollbackOperation()
must make sure
all these services are removed if the operation fails.protected Map<String,Object> attachments
protected boolean isRollbackOnFailure
protected DeploymentOperationStep currentStep
public DeploymentOperation(String name, PlatformServiceContainer container, List<DeploymentOperationStep> steps)
public <S> S getAttachment(String name)
public void addStep(DeploymentOperationStep step)
public void serviceAdded(String serviceName)
public PlatformServiceContainer getServiceContainer()
public void execute()
protected void rollbackOperation()
Copyright © 2021. All rights reserved.