public class Deployment extends Object implements DeploymentDescription, Comparable<Deployment>
Instances of this are not thread-safe.
Modifier and Type | Method and Description |
---|---|
Deployment |
addServerGroup(String serverGroup)
Adds a server group for the deployment.
|
Deployment |
addServerGroups(Collection<String> serverGroups)
Adds the server groups for the deployment.
|
Deployment |
addServerGroups(String... serverGroups)
Adds the server groups for the deployment.
|
int |
compareTo(Deployment o) |
boolean |
equals(Object obj) |
String |
getName()
Returns the name for this deployment.
|
String |
getRuntimeName()
Returns the runtime name set for the deployment which may be
null . |
Set<String> |
getServerGroups()
Returns the server groups for this deployment.
|
int |
hashCode() |
boolean |
isEnabled()
Indicates whether or not the deployment should be enabled by default.
|
static Deployment |
of(File content)
Creates a new deployment for the file.
|
static Deployment |
of(InputStream content,
String name)
Creates a new deployment for the input stream.
|
static Deployment |
of(Path content)
Creates a new deployment for the path.
|
static Deployment |
of(URL url)
Creates a new deployment for the URL.
|
Deployment |
setEnabled(boolean enabled)
Sets whether or not the deployment should be enabled.
|
Deployment |
setName(String name)
Sets the name for the deployment.
|
Deployment |
setRuntimeName(String runtimeName)
Sets the runtime name for the deployment.
|
Deployment |
setServerGroups(Collection<String> serverGroups)
Sets the server groups for the deployment.
|
Deployment |
setServerGroups(String... serverGroups)
Sets the server groups for the deployment.
|
String |
toString() |
public static Deployment of(File content)
content
- the file containing the contentpublic static Deployment of(Path content)
content
- the path containing the contentpublic static Deployment of(InputStream content, String name)
null
.
If setName(String)
with a null
argument is invoked when using this static factory an
IllegalArgumentException
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)
or of(File)
static factory methods should be used.
content
- the input stream representing the contentname
- the name for the deploymentpublic static Deployment of(URL url)
url
- the URL representing the contentpublic Deployment addServerGroup(String serverGroup)
serverGroup
- the server group to addaddServerGroups(Collection)
,
addServerGroups(String...)
public Deployment addServerGroups(String... serverGroups)
serverGroups
- the server groups to addaddServerGroup(String)
,
addServerGroups(Collection)
public Deployment addServerGroups(Collection<String> serverGroups)
serverGroups
- the server groups to addaddServerGroup(String)
,
addServerGroups(String...)
public Set<String> getServerGroups()
DeploymentDescription
getServerGroups
in interface DeploymentDescription
public Deployment setServerGroups(String... serverGroups)
serverGroups
- the server groups to setpublic Deployment setServerGroups(Collection<String> serverGroups)
serverGroups
- the server groups to setpublic boolean isEnabled()
If the value is set to false
the content will only be added. An explicit deploy
operation will
be required to deploy the content to the runtime.
true
if the deployment should be enabled, false
if the deployment should not be enabledpublic Deployment setEnabled(boolean enabled)
false
the deployment will not be enabled,
but the content will be uploaded and added. This is set to true
by default.
If the value is set to false
the content will only be added. An explicit deploy
operation will
be required to deploy the content to the runtime.
enabled
- false
to keep the content disabledpublic String getName()
DeploymentDescription
getName
in interface DeploymentDescription
public Deployment setName(String name)
null
for a deployment created based on a file system path.
If the deployment was created using in input stream and the value is null
an IllegalArgumentException
will be thrown.name
- the name for the deploymentpublic String getRuntimeName()
null
.null
if one was not setpublic Deployment setRuntimeName(String runtimeName)
runtimeName
- the runtime name, can be null
public int compareTo(Deployment o)
compareTo
in interface Comparable<Deployment>
Copyright © 2021 JBoss by Red Hat. All rights reserved.