Interface DeploymentPlanBuilder
-
- All Known Subinterfaces:
AddDeploymentPlanBuilder
,InitialDeploymentPlanBuilder
,ReplaceDeploymentPlanBuilder
,UndeployDeploymentPlanBuilder
public interface DeploymentPlanBuilder
Builder capable of creating aDeploymentPlan
. This interface defines the core set of builder operations; various subinterfaces define additional operations that become available as a result of executing the methods in this interface.a- Author:
- Brian Stansberry
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AddDeploymentPlanBuilder
add(File file)
Indicates the content of the specified file should be added to the content repository.AddDeploymentPlanBuilder
add(String name, File file)
Indicates the content of the specified file should be added to the content repository.AddDeploymentPlanBuilder
add(String name, InputStream stream)
Indicates the content readable from the specifiedInputStream
should be added to the 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 content repository.AddDeploymentPlanBuilder
add(URL url)
Indicates the content at the specified URL should be added to the content repository.DeploymentPlanBuilder
addContentFileToDeployment(String deploymentName, Map<String,Path> files)
Indicates the content readable from the specifiedPath
should be added to the content repository.DeploymentPlanBuilder
addContentToDeployment(String deploymentName, Map<String,InputStream> contents)
Indicates the content readable from the specifiedInputStream
should be added to the content repository.DeploymentPlan
build()
Creates the deployment plan.DeploymentPlanBuilder
deploy(String deploymentName)
Indicates the specified deployment content should be deployed.DeploymentPlanBuilder
explodeDeployment(String deploymentName)
Indicates the deployment to be exploded.DeploymentPlanBuilder
explodeDeploymentContent(String deploymentName, String path)
Indicates the deployment content to be exploded.List<DeploymentAction>
getDeploymentActions()
Gets the list ofDeploymentAction
s created as a recent of builder operations, in order of when they were created.long
getGracefulShutdownTimeout()
Gets the maximum period, in ms, the builder will configure the deployment plan to wait for potentially long-running in-process work ito complete before shutdown proceeds.DeploymentAction
getLastAction()
Gets theDeploymentAction
most recently created as a result of builder operations.boolean
isGlobalRollback()
Gets whether alldeploy
,undeploy
,replace
orremove
operations associated with the deployment plan should be rolled back in case of a failure in any of them.boolean
isGracefulShutdown()
Gets whether the builder will create a deployment plan organized around a graceful shutdown of the server, where potentially long-running in-process work is given time to complete before shutdown proceeds.boolean
isShutdown()
Gets whether the builder will create a deployment plan organized around a shutdown of the server.DeploymentPlanBuilder
redeploy(String deploymentName)
Indicates the specified deployment content should be redeployed (i.e.DeploymentPlanBuilder
remove(String deploymentName)
Indicates the specified deployment content should be removed from the content repository.DeploymentPlanBuilder
removeContenFromDeployment(String deploymentName, List<String> paths)
Indicates the content readable from the specified targetPath should be removed from the deployment with the specified name.DeploymentPlanBuilder
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.DeploymentPlanBuilder
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.DeploymentPlanBuilder
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 replacementDeploymentName, String toReplaceDeploymentName)
Indicates the specified deployment content should be deployed, replacing the specified existing deployment.DeploymentPlanBuilder
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.DeploymentPlanBuilder
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.DeploymentPlanBuilder
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 deploymentName)
Indicates the specified deployment content should be undeployed.
-
-
-
Method Detail
-
getLastAction
DeploymentAction getLastAction()
Gets theDeploymentAction
most recently created as a result of builder operations.- Returns:
- the last action or
null
if there have been no actions.
-
getDeploymentActions
List<DeploymentAction> getDeploymentActions()
Gets the list ofDeploymentAction
s created as a recent of builder operations, in order of when they were created.- Returns:
- the actions. Will not be
null
-
isGlobalRollback
boolean isGlobalRollback()
Gets whether alldeploy
,undeploy
,replace
orremove
operations associated with the deployment plan should be rolled back in case of a failure in any of them.- Returns:
true
if all operations should be rolled back if any of them fail
-
isShutdown
boolean isShutdown()
Gets whether the builder will create a deployment plan organized around a shutdown of the server.- Returns:
true
if the plan will be organized around a shutdown,false
otherwise
-
isGracefulShutdown
boolean isGracefulShutdown()
Gets whether the builder will create a deployment plan organized around a graceful shutdown of the server, where potentially long-running in-process work is given time to complete before shutdown proceeds.- Returns:
true
if the plan will be organized around a graceful shutdown,false
otherwise
-
getGracefulShutdownTimeout
long getGracefulShutdownTimeout()
Gets the maximum period, in ms, the builder will configure the deployment plan to wait for potentially long-running in-process work ito complete before shutdown proceeds.- Returns:
- the period in ms, or
-1
ifisGracefulShutdown()
would returntrue
-
add
AddDeploymentPlanBuilder add(File file) throws IOException
Indicates the content of the specified file should be added to the 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. See
AddDeploymentPlanBuilder.andDeploy()
.- Parameters:
file
- file containing the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
add
AddDeploymentPlanBuilder add(URL url) throws IOException
Indicates the content at the specified URL should be added to the 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. See
AddDeploymentPlanBuilder.andDeploy()
.- Parameters:
url
- URL pointing to the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
add
AddDeploymentPlanBuilder add(String name, File file) throws IOException
Indicates the content of the specified file should be added to the content repository.Note that this operation does not indicate the content should be deployed into the runtime. See
AddDeploymentPlanBuilder.andDeploy()
.- Parameters:
name
- name that should be given to the new content to uniquely identify it within the server's management system. Must be different from the name given to an other deployment content presently available on the serverfile
- file containing the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
add
AddDeploymentPlanBuilder add(String name, URL url) throws IOException
Indicates the content at the specified URL should be added to the content repository.Note that this operation does not indicate the content should be deployed into the runtime. See
AddDeploymentPlanBuilder.andDeploy()
.- Parameters:
name
- name that should be given to the new content to uniquely identify it within the server. Must be different from the name given to an other deployment content presently available on the serverurl
- URL pointing to the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
add
AddDeploymentPlanBuilder add(String name, InputStream stream)
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. See
AddDeploymentPlanBuilder.andDeploy()
.- Parameters:
name
- name that should be given to the new content to uniquely identify it within the server's management system. Must be different from the name given to an other deployment content presently available on the serverstream
-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
-
add
AddDeploymentPlanBuilder add(String name, String commonName, InputStream stream) throws IOException
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. See
AddDeploymentPlanBuilder.andDeploy()
.- Parameters:
name
- name that should be given to the new content to uniquely identify it within the server'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 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 caseadd(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
-
explodeDeployment
DeploymentPlanBuilder explodeDeployment(String deploymentName) throws IOException
Indicates the deployment to be exploded.Note that this operation does not indicate the content should be undeployed into the runtime.
- Parameters:
deploymentName
- name by which the deployment is known in the model.- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
explodeDeploymentContent
DeploymentPlanBuilder explodeDeploymentContent(String deploymentName, String path) throws IOException
Indicates the deployment content to be exploded.Note that this operation does not indicate the content should be undeployed into the runtime.
- Parameters:
deploymentName
- name by which the deployment is known in the model.path
- the relative path to the archive to be exploded.- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
addContentToDeployment
DeploymentPlanBuilder addContentToDeployment(String deploymentName, Map<String,InputStream> contents) throws IOException
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. See
AddDeploymentPlanBuilder.andDeploy()
.- Parameters:
deploymentName
- name by which the deployment is known in the model.contents
- a map consisting of the content relative target path as key and the bytes as value.- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
addContentFileToDeployment
DeploymentPlanBuilder addContentFileToDeployment(String deploymentName, Map<String,Path> files) throws IOException
Indicates the content readable from the specifiedPath
should be added to the content repository.Note that this operation does not indicate the content should be deployed into the runtime. See
AddDeploymentPlanBuilder.andDeploy()
.- Parameters:
deploymentName
- name by which the deployment is known in the model.files
- a map consisting of the content relative target path as key and the file as value.- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
removeContenFromDeployment
DeploymentPlanBuilder removeContenFromDeployment(String deploymentName, List<String> paths) throws IOException
Indicates the content readable from the specified targetPath should be removed from the deployment with the specified name.Note that this operation does not indicate the content should be undeployed into the runtime.
- Parameters:
deploymentName
- name by which the deployment is known in the model.paths
- paths to the exploded deployment from which the content will be removed.- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
deploy
DeploymentPlanBuilder deploy(String deploymentName)
Indicates the specified deployment content should be deployed.- Parameters:
deploymentName
- unique identifier of the deployment content- Returns:
- a builder that can continue building the overall deployment plan
-
undeploy
UndeployDeploymentPlanBuilder undeploy(String deploymentName)
Indicates the specified deployment content should be undeployed.- Parameters:
deploymentName
- unique identifier of the deployment content- Returns:
- a builder that can continue building the overall deployment plan
-
redeploy
DeploymentPlanBuilder redeploy(String deploymentName)
Indicates the specified deployment content should be redeployed (i.e. undeployed and then deployed again).- Parameters:
deploymentName
- unique identifier of the deployment content- Returns:
- a builder that can continue building the overall deployment plan
-
replace
ReplaceDeploymentPlanBuilder replace(String replacementDeploymentName, String toReplaceDeploymentName)
Indicates the specified deployment content should be deployed, replacing the specified existing deployment.- Parameters:
replacementDeploymentName
- unique identifier of the content to deploytoReplaceDeploymentName
- unique identifier of the currently deployed content to replace- Returns:
- a builder that can continue building the overall deployment plan
-
replace
DeploymentPlanBuilder replace(File file) throws IOException
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.
- Parameters:
file
- file containing the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
replace
DeploymentPlanBuilder replace(URL url) throws IOException
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.
- Parameters:
url
- URL pointing to the new content- Returns:
- a builder that can continue building the overall deployment plan
- Throws:
IOException
-
replace
DeploymentPlanBuilder replace(String name, File file) throws IOException
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.
- 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
DeploymentPlanBuilder replace(String name, URL url) throws IOException
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.
- 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
DeploymentPlanBuilder 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.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.
- 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
-
replace
DeploymentPlanBuilder 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.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.
- 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 caseadd(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
-
remove
DeploymentPlanBuilder remove(String deploymentName)
Indicates the specified deployment content should be removed from the content repository.- Parameters:
deploymentName
- unique identifier of the deployment content- Returns:
- a builder that can continue building the overall deployment plan
-
build
DeploymentPlan build()
Creates the deployment plan.- Returns:
- the deployment plan
-
-