Class InitialDeploymentSetBuilderImpl
- java.lang.Object
-
- org.jboss.as.controller.client.helpers.domain.impl.InitialDeploymentSetBuilderImpl
-
- All Implemented Interfaces:
DeploymentPlanBuilder
,InitialDeploymentSetBuilder
public class InitialDeploymentSetBuilderImpl extends Object implements InitialDeploymentSetBuilder
Variant of aDeploymentPlanBuilderImpl
that is meant to be used at the initial stages of the building process, when directives that pertain to the entireDeploymentSetPlan
can be applied.- Author:
- Brian Stansberry
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AddDeploymentPlanBuilder
add(File file)
Indicates the content of the specified file should be added to the default content repository.AddDeploymentPlanBuilder
add(String name)
Indicates a deployment that has already been added to the deployment content repository should be added to the server groups associated with the currentDeploymentSetPlan
.AddDeploymentPlanBuilder
add(String name, File file)
Indicates the content of the specified fileL should be added to the default content repository.AddDeploymentPlanBuilder
add(String name, InputStream stream)
Indicates the content readable from the specifiedInputStream
should be added to the default content repository.AddDeploymentPlanBuilder
add(String name, String commonName, InputStream stream)
Indicates the content readable from the specifiedInputStream
should be added to the content repository.AddDeploymentPlanBuilder
add(String name, URL url)
Indicates the content at the specified URL should be added to the default content repository.AddDeploymentPlanBuilder
add(URL url)
Indicates the content at the specified URL should be added to the default content repository.DeploymentPlan
build()
Creates the deployment plan.DeployDeploymentPlanBuilder
deploy(String key)
Indicates the specified deployment content should be deployed.DeploymentAction
getLastAction()
DeploymentPlanBuilder
redeploy(String deploymentName)
Indicates the specified deployment content should be redeployed (i.e.RemoveDeploymentPlanBuilder
remove(String key)
Indicates the specified deployment content should be removed from the content repository.RemoveDeploymentPlanBuilder
replace(File file)
Indicates the content of the specified file should be added to the content repository and replace existing content of the same name.RemoveDeploymentPlanBuilder
replace(String name, File file)
Indicates the content of the specified file should be added to the content repository and replace existing content of the same name.RemoveDeploymentPlanBuilder
replace(String name, InputStream stream)
Indicates the content readable from the specifiedInputStream
should be added to the content repository and replace existing content of the same name.ReplaceDeploymentPlanBuilder
replace(String replacement, String toReplace)
Indicates the specified deployment content should be deployed, replacing the specified existing deployment.RemoveDeploymentPlanBuilder
replace(String name, String commonName, InputStream stream)
Indicates the content readable from the specifiedInputStream
should be added to the content repository and replace existing content of the same name.RemoveDeploymentPlanBuilder
replace(String name, URL url)
Indicates the content at the specified URL should be added to the content repository and replace existing content of the same name.RemoveDeploymentPlanBuilder
replace(URL url)
Indicates the content at the specified URL should be added to the content repository and replace existing content of the same name.UndeployDeploymentPlanBuilder
undeploy(String key)
Indicates the specified deployment content should be undeployed.InitialDeploymentSetBuilder
withGracefulShutdown(long timeout, TimeUnit timeUnit)
Indicates actions specified subsequent to this call should be organized around a full graceful server shutdown and restart.InitialDeploymentSetBuilder
withoutSingleServerRollback()
Indicates that on a given server alldeploy
,undeploy
orreplace
operations associated with the deployment set should not be rolled back in case of a failure in any of them.InitialDeploymentSetBuilder
withShutdown()
Indicates actions specified subsequent to this call should be organized around a full server restart.InitialDeploymentSetBuilder
withSingleServerRollback()
Deprecated.
-
-
-
Method Detail
-
withGracefulShutdown
public InitialDeploymentSetBuilder withGracefulShutdown(long timeout, TimeUnit timeUnit)
Description copied from interface:InitialDeploymentSetBuilder
Indicates actions specified subsequent to this call should be organized around a full graceful server shutdown and restart. The server will attempt to shut itself down gracefully, waiting for in-process work to complete before shutting down. See the full JBoss AS documentation for details on what "waiting for in-process work to complete" means.For any
deploy
orreplace
actions, the new content will not be deployed until the server is restarted. For anyundeploy
orreplace
actions, the old content will be undeployed as part of normal server shutdown processing.- Specified by:
withGracefulShutdown
in interfaceInitialDeploymentSetBuilder
- Parameters:
timeout
- maximum amount of time the graceful shutdown should wait for existing work to complete before completing the shutdowntimeUnit
-TimeUnit
in whichtimeout
is expressed- Returns:
- a builder that can continue building the overall deployment plan
-
withShutdown
public InitialDeploymentSetBuilder withShutdown()
Description copied from interface:InitialDeploymentSetBuilder
Indicates actions specified subsequent to this call should be organized around a full server restart. For anydeploy
orreplace
actions, the new content will not be deployed until the server is restarted. For anyundeploy
orreplace
actions, the old content will be undeployed as part of normal server shutdown processing.- Specified by:
withShutdown
in interfaceInitialDeploymentSetBuilder
- Returns:
- a builder that can continue building the overall deployment plan
-
withSingleServerRollback
@Deprecated public InitialDeploymentSetBuilder withSingleServerRollback()
Deprecated.Description copied from interface:InitialDeploymentSetBuilder
Indicates that on a given server alldeploy
,undeploy
orreplace
operations associated with the deployment set should be rolled back in case of a failure in any of them.Note: This directive does not span across servers, i.e. a rollback on one server will not trigger rollback on others. Use
ServerGroupDeploymentPlanBuilder.withRollback()
to trigger rollback across servers.- Specified by:
withSingleServerRollback
in interfaceInitialDeploymentSetBuilder
- Returns:
- a builder that can continue building the overall deployment plan
-
withoutSingleServerRollback
public InitialDeploymentSetBuilder withoutSingleServerRollback()
Description copied from interface:InitialDeploymentSetBuilder
Indicates that on a given server alldeploy
,undeploy
orreplace
operations associated with the deployment set should not be rolled back in case of a failure in any of them.- Specified by:
withoutSingleServerRollback
in interfaceInitialDeploymentSetBuilder
- Returns:
- a builder that can continue building the overall deployment plan
-
add
public AddDeploymentPlanBuilder add(File file) throws IOException, DuplicateDeploymentNameException
Description copied from interface:DeploymentPlanBuilder
Indicates the content of the specified file should be added to the default content repository. The name of the deployment will be the value returned by
.file.getName()
Note that this operation does not indicate the content should be deployed into the runtime.
- Specified by:
add
in interfaceDeploymentPlanBuilder
- Parameters:
file
- file containing the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
DuplicateDeploymentNameException
- if the name of the deployment is the same as that of other deployment content already present in the domainIOException
-
add
public AddDeploymentPlanBuilder add(URL url) throws IOException, DuplicateDeploymentNameException
Description copied from interface:DeploymentPlanBuilder
Indicates the content at the specified URL should be added to the default content repository. The name of the deployment will be the last segment of the value returned by
.url.getPath()
Note that this operation does not indicate the content should be deployed into the runtime.
- Specified by:
add
in interfaceDeploymentPlanBuilder
- Parameters:
url
- URL pointing to the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
DuplicateDeploymentNameException
- if the name of the deployment is the same as that of other deployment content already present in the domainIOException
-
add
public AddDeploymentPlanBuilder add(String name, File file) throws IOException, DuplicateDeploymentNameException
Description copied from interface:DeploymentPlanBuilder
Indicates the content of the specified fileL should be added to the default content repository.Note that this operation does not indicate the content should be deployed into the runtime.
- Specified by:
add
in interfaceDeploymentPlanBuilder
- Parameters:
name
- name that should be given to the new contentfile
- file containing the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
DuplicateDeploymentNameException
- if the name of the deployment is the same as that of other deployment content already present in the domainIOException
-
add
public AddDeploymentPlanBuilder add(String name, URL url) throws IOException, DuplicateDeploymentNameException
Description copied from interface:DeploymentPlanBuilder
Indicates the content at the specified URL should be added to the default content repository.Note that this operation does not indicate the content should be deployed into the runtime.
- Specified by:
add
in interfaceDeploymentPlanBuilder
- Parameters:
name
- name that should be given to the new contenturl
- URL pointing to the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
DuplicateDeploymentNameException
- if the name of the deployment is the same as that of other deployment content already present in the domainIOException
-
add
public AddDeploymentPlanBuilder add(String name, InputStream stream) throws IOException, DuplicateDeploymentNameException
Description copied from interface:DeploymentPlanBuilder
Indicates the content readable from the specifiedInputStream
should be added to the default content repository.Note that this operation does not indicate the content should be deployed into the runtime.
- Specified by:
add
in interfaceDeploymentPlanBuilder
- Parameters:
name
- name that should be given to the new contentstream
-InputStream
from which the new content should be read This stream has to be closed by the caller.- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
DuplicateDeploymentNameException
- if the name of the deployment is the same as that of other deployment content already present in the domainIOException
-
add
public AddDeploymentPlanBuilder add(String name, String commonName, InputStream stream) throws IOException, DuplicateDeploymentNameException
Description copied from interface:DeploymentPlanBuilder
Indicates the content readable from the specifiedInputStream
should be added to the content repository.Note that this operation does not indicate the content should be deployed into the runtime.
- Specified by:
add
in interfaceDeploymentPlanBuilder
- Parameters:
name
- name that should be given to the new content to uniquely identify it within the domain's management system. Must be different from the name given to an other deployment content presently available on the servercommonName
- name by which the deployment should be known within a server's runtime. This would be equivalent to the file name of a deployment file, and would form the basis for such things as default Java Enterprise Edition application and module names. This would typically be the same asname
(in which caseDeploymentPlanBuilder.add(String, InputStream)
would normally be used, but in some cases users may wish to have two deployments with the same common name may (e.g. two versions of "foo.war" both available in the deployment content repository), in which case the deployments would need to have distinctname
values but would have the samecommonName
stream
-InputStream
from which the new content should be read This stream has to be closed by the caller.- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
DuplicateDeploymentNameException
- if thename
of the deployment is the same as that of other deployment content already present in the domainIOException
-
add
public AddDeploymentPlanBuilder add(String name) throws IOException
Description copied from interface:DeploymentPlanBuilder
Indicates a deployment that has already been added to the deployment content repository should be added to the server groups associated with the currentDeploymentSetPlan
. Typically this is used to add content that was added as part of a previously executed plan to one or more new server groups.- Specified by:
add
in interfaceDeploymentPlanBuilder
- Parameters:
name
- name that uniquely identifies the deployment within the domain's management system.- Throws:
IOException
-
deploy
public DeployDeploymentPlanBuilder deploy(String key)
Description copied from interface:DeploymentPlanBuilder
Indicates the specified deployment content should be deployed.- Specified by:
deploy
in interfaceDeploymentPlanBuilder
- Parameters:
key
- unique identifier of the deployment content- Returns:
- a builder that can continue building the overall deployment plan
-
undeploy
public UndeployDeploymentPlanBuilder undeploy(String key)
Description copied from interface:DeploymentPlanBuilder
Indicates the specified deployment content should be undeployed.- Specified by:
undeploy
in interfaceDeploymentPlanBuilder
- Parameters:
key
- unique identifier of the deployment content- Returns:
- a builder that can continue building the overall deployment plan
-
redeploy
public DeploymentPlanBuilder redeploy(String deploymentName)
Description copied from interface:DeploymentPlanBuilder
Indicates the specified deployment content should be redeployed (i.e. undeployed and then deployed again).- Specified by:
redeploy
in interfaceDeploymentPlanBuilder
- Parameters:
deploymentName
- unique identifier of the deployment content- Returns:
- a builder that can continue building the overall deployment plan
-
replace
public ReplaceDeploymentPlanBuilder replace(String replacement, String toReplace)
Description copied from interface:DeploymentPlanBuilder
Indicates the specified deployment content should be deployed, replacing the specified existing deployment.- Specified by:
replace
in interfaceDeploymentPlanBuilder
- Parameters:
replacement
- unique identifier of the content to deploytoReplace
- unique identifier of the currently deployed content to replace- Returns:
- a builder that can continue building the overall deployment plan
-
replace
public RemoveDeploymentPlanBuilder replace(File file) throws IOException
Description copied from interface:DeploymentPlanBuilder
Indicates the content of the specified file should be added to the content repository and replace existing content of the same name. The name of the deployment will be the value returned by
.file.getName()
Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.
- Specified by:
replace
in interfaceDeploymentPlanBuilder
- Parameters:
file
- file containing the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
replace
public RemoveDeploymentPlanBuilder replace(URL url) throws IOException
Description copied from interface:DeploymentPlanBuilder
Indicates the content at the specified URL should be added to the content repository and replace existing content of the same name. The name of the deployment will be the last segment of the value returned by
.url.getPath()
Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.
- Specified by:
replace
in interfaceDeploymentPlanBuilder
- Parameters:
url
- URL pointing to the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
replace
public RemoveDeploymentPlanBuilder replace(String name, File file) throws IOException
Description copied from interface:DeploymentPlanBuilder
Indicates the content of the specified file should be added to the content repository and replace existing content of the same name.Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.
- Specified by:
replace
in interfaceDeploymentPlanBuilder
- Parameters:
name
- name that should be given to the new contentfile
- file containing the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
replace
public RemoveDeploymentPlanBuilder replace(String name, URL url) throws IOException
Description copied from interface:DeploymentPlanBuilder
Indicates the content at the specified URL should be added to the content repository and replace existing content of the same name.Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.
- Specified by:
replace
in interfaceDeploymentPlanBuilder
- Parameters:
name
- name that should be given to the new contenturl
- URL pointing to the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
replace
public RemoveDeploymentPlanBuilder replace(String name, InputStream stream) throws IOException
Description copied from interface:DeploymentPlanBuilder
Indicates the content readable from the specifiedInputStream
should be added to the content repository and replace existing content of the same name.Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.
- Specified by:
replace
in interfaceDeploymentPlanBuilder
- Parameters:
name
- name that should be given to the new contentstream
-InputStream
from which the new content should be read This stream has to be closed by the caller.- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
replace
public RemoveDeploymentPlanBuilder replace(String name, String commonName, InputStream stream) throws IOException
Description copied from interface:DeploymentPlanBuilder
Indicates the content readable from the specifiedInputStream
should be added to the content repository and replace existing content of the same name.Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.
- Specified by:
replace
in interfaceDeploymentPlanBuilder
- Parameters:
name
- name that should be given to the new contentcommonName
- name by which the deployment should be known within the runtime. This would be equivalent to the file name of a deployment file, and would form the basis for such things as default Java Enterprise Edition application and module names. This would typically be the same asname
(in which caseDeploymentPlanBuilder.add(String, InputStream)
would normally be used, but in some cases users may wish to have two deployments with the same common name may (e.g. two versions of "foo.war" both available in the deployment content repository), in which case the deployments would need to have distinctname
values but would have the samecommonName
stream
-InputStream
from which the new content should be read This stream has to be closed by the caller.- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
remove
public RemoveDeploymentPlanBuilder remove(String key)
Description copied from interface:DeploymentPlanBuilder
Indicates the specified deployment content should be removed from the content repository.- Specified by:
remove
in interfaceDeploymentPlanBuilder
- Parameters:
key
- unique identifier of the deployment content- Returns:
- a builder that can continue building the overall deployment plan
-
getLastAction
public DeploymentAction getLastAction()
-
build
public DeploymentPlan build()
Creates the deployment plan.- Returns:
- the deployment plan
-
-