Package org.wildfly.plugin.tools
Class Deployment
java.lang.Object
org.wildfly.plugin.tools.Deployment
- All Implemented Interfaces:
AutoCloseable
,Comparable<Deployment>
,DeploymentDescription
public class Deployment
extends Object
implements DeploymentDescription, Comparable<Deployment>, AutoCloseable
Represents a deployment to be deployed or redeployed to a server.
Instances of this are not thread-safe.
- Author:
- James R. Perkins
-
Method Summary
Modifier and TypeMethodDescriptionaddServerGroup
(String serverGroup) Adds a server group for the deployment.addServerGroups
(String... serverGroups) Adds the server groups for the deployment.addServerGroups
(Collection<String> serverGroups) Adds the server groups for the deployment.void
close()
int
boolean
getName()
Returns the name for this deployment.Returns the runtime name set for the deployment which may benull
.Returns the server groups for this deployment.int
hashCode()
boolean
Indicates whether or not the deployment should be enabled by default.static Deployment
Creates a new deployment for the path.static Deployment
Creates a new deployment for the file.static Deployment
of
(InputStream content, String name) Creates a new deployment for the input stream.static Deployment
Creates a new deployment for the URL.static Deployment
Creates a new deployment for the path.setEnabled
(boolean enabled) Sets whether or not the deployment should be enabled.Sets the name for the deployment.setRuntimeName
(String runtimeName) Sets the runtime name for the deployment.setServerGroups
(String... serverGroups) Sets the server groups for the deployment.setServerGroups
(Collection<String> serverGroups) Sets the server groups for the deployment.toString()
-
Method Details
-
of
Creates a new deployment for the file. If the file is a directory the content will be deployed exploded using the file system location.- Parameters:
content
- the file containing the content- Returns:
- the deployment
-
of
Creates a new deployment for the path. If the path is a directory the content will be deployed exploded using the file system location.- Parameters:
content
- the path containing the content- Returns:
- the deployment
-
of
Creates a new deployment for the input stream. The name is required for the deployment and cannot benull
. IfsetName(String)
with anull
argument is invoked when using this static factory anIllegalArgumentException
will be thrown.The content will be copied, stored in-memory and then closed. Large content should be written to a file and the
of(Path)
orof(File)
static factory methods should be used.- Parameters:
content
- the input stream representing the contentname
- the name for the deployment- Returns:
- the deployment
-
of
Creates a new deployment for the URL. The target server will require access to the URL.- Parameters:
url
- the URL representing the content- Returns:
- the deployment
-
local
Creates a new deployment for the path. If the path is a directory the content will be deployed exploded using the file system location. Otherwise, the content is deployed with the local path as an archive.- Parameters:
content
- the path containing the content- Returns:
- the deployment
-
addServerGroup
Adds a server group for the deployment.- Parameters:
serverGroup
- the server group to add- Returns:
- this deployment
- See Also:
-
addServerGroups
Adds the server groups for the deployment.- Parameters:
serverGroups
- the server groups to add- Returns:
- this deployment
- See Also:
-
addServerGroups
Adds the server groups for the deployment.- Parameters:
serverGroups
- the server groups to add- Returns:
- this deployment
- See Also:
-
getServerGroups
Description copied from interface:DeploymentDescription
Returns the server groups for this deployment.- Specified by:
getServerGroups
in interfaceDeploymentDescription
- Returns:
- a set of server groups for this deployment
-
setServerGroups
Sets the server groups for the deployment.- Parameters:
serverGroups
- the server groups to set- Returns:
- this deployment
-
setServerGroups
Sets the server groups for the deployment.- Parameters:
serverGroups
- the server groups to set- Returns:
- this deployment
-
isEnabled
public boolean isEnabled()Indicates whether or not the deployment should be enabled by default.If the value is set to
false
the content will only be added. An explicitdeploy
operation will be required to deploy the content to the runtime.- Returns:
true
if the deployment should be enabled,false
if the deployment should not be enabled
-
setEnabled
Sets whether or not the deployment should be enabled. If set tofalse
the deployment will not be enabled, but the content will be uploaded and added. This is set totrue
by default.If the value is set to
false
the content will only be added. An explicitdeploy
operation will be required to deploy the content to the runtime.- Parameters:
enabled
-false
to keep the content disabled- Returns:
- this deployment
-
getName
Description copied from interface:DeploymentDescription
Returns the name for this deployment.- Specified by:
getName
in interfaceDeploymentDescription
- Returns:
- the name for this deployment
-
setName
Sets the name for the deployment. This can benull
for a deployment created based on a file system path. If the deployment was created using in input stream and the value isnull
anIllegalArgumentException
will be thrown.- Parameters:
name
- the name for the deployment- Returns:
- this deployment
-
getRuntimeName
Returns the runtime name set for the deployment which may benull
.- Returns:
- the runtime name set or
null
if one was not set
-
setRuntimeName
Sets the runtime name for the deployment.- Parameters:
runtimeName
- the runtime name, can benull
- Returns:
- this deployment
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Deployment>
-
hashCode
public int hashCode() -
equals
-
toString
-