Class ServiceDeployment.Builder
- Enclosing class:
ServiceDeployment
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Collection<Pattern> protected Collection<Pattern> protected Documentprotected ServiceTemplate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new service deployment instances based on this builder.excludes(@NonNull Collection<Pattern> excludes) Sets the file names (in a regular expression form) which should be ignored when deploying a service.includes(@NonNull Collection<Pattern> includes) Sets the file names (in a regular expression form) which should be included when deploying a service.modifyExcludes(@NonNull Consumer<Collection<Pattern>> modifier) Modifies the file names (in a regular expression form) which should be ignored when deploying a service.modifyIncludes(@NonNull Consumer<Collection<Pattern>> modifier) Modifies the file names (in a regular expression form) which should be included when deploying a service.properties(@NonNull Document properties) Sets the properties of the deployment.template(@NonNull ServiceTemplate template) Sets the target template of the deployment.Adds thewrapper.jarfile and the.wrapper/directory to the files which should be ignored when deploying a service into the target template.
-
Field Details
-
template
-
excludes
-
includes
-
properties
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
template
@NonNull public @NonNull ServiceDeployment.Builder template(@NonNull @NonNull ServiceTemplate template) Sets the target template of the deployment. There is no need for the template to exist, nor for the template to be added to the target service of this deployment.- Parameters:
template- the target template of the deployment.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given template is null.
-
excludes
@NonNull public @NonNull ServiceDeployment.Builder excludes(@NonNull @NonNull Collection<Pattern> excludes) Sets the file names (in a regular expression form) which should be ignored when deploying a service. Directories must be suffixed with a /.Any exclusion overrides an explicit inclusion, for example an exclusion of
plugins/*overrides the explicit inclusion ofplugins/cloudnet-bridge.jar.The given exclusion collection will get copied into the builder, meaning that further modification of it will not reflect into the builder and vice-versa.
- Parameters:
excludes- the excludes of the deployment.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if then given exclusion collection is null.
-
modifyExcludes
@NonNull public @NonNull ServiceDeployment.Builder modifyExcludes(@NonNull @NonNull Consumer<Collection<Pattern>> modifier) Modifies the file names (in a regular expression form) which should be ignored when deploying a service. Directories must be suffixed with a /.Any exclusion overrides an explicit inclusion, for example an exclusion of
plugins/*overrides the explicit inclusion ofplugins/cloudnet-bridge.jar.- Parameters:
modifier- the modifier to be applied to the already added exclusions of this builder.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if then given exclusion collection is null.
-
withDefaultExclusions
Adds thewrapper.jarfile and the.wrapper/directory to the files which should be ignored when deploying a service into the target template.Overriding the excludes of the exclusion using
excludes(Collection)results in a removal of the default exclusions as well, therefore setting the excludes must be done before calling this method. Later adds of excluded files or directories viamodifyExcludes(Consumer)will keep the default exclusions.- Returns:
- the same instance as used to call the method, for chaining.
-
includes
@NonNull public @NonNull ServiceDeployment.Builder includes(@NonNull @NonNull Collection<Pattern> includes) Sets the file names (in a regular expression form) which should be included when deploying a service. Directories must be suffixed with a /.Any exclusion overrides an explicit inclusion, for example an exclusion of
plugins/*overrides the explicit inclusion ofplugins/cloudnet-bridge.jar.The given includes collection will get copied into the builder, meaning that further modification of it will not reflect into the builder and vice-versa.
- Parameters:
includes- the includes of the deployment.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if then given includes collection is null.
-
modifyIncludes
@NonNull public @NonNull ServiceDeployment.Builder modifyIncludes(@NonNull @NonNull Consumer<Collection<Pattern>> modifier) Modifies the file names (in a regular expression form) which should be included when deploying a service. Directories must be suffixed with a /.Any exclusion overrides an explicit inclusion, for example an exclusion of
plugins/*overrides the explicit inclusion ofplugins/cloudnet-bridge.jar.- Parameters:
modifier- the modifier to be applied to the already added inclusions of this builder.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if then given includes collection is null.
-
properties
@NonNull public @NonNull ServiceDeployment.Builder properties(@NonNull @NonNull Document properties) Sets the properties of the deployment. These properties will not be used internally and are mainly there for different implementation and/or identification by modules or plugins if needed.- Parameters:
properties- the properties of this deployment.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given properties document is null.
-
build
Builds a new service deployment instances based on this builder.- Returns:
- a service deployment from this builder.
- Throws:
NullPointerException- if no template was set in this builder.
-