Class ServiceDeployment
java.lang.Object
eu.cloudnetservice.driver.service.ServiceDeployment
- All Implemented Interfaces:
DefaultedDocPropertyHolder, DocPropertyHolder, Cloneable
A deployment for a service. A deployment can be added to any service and will copy the data from the currently
running service into the given template, allowing for example cross copy of templates as there is no need for a
service to be based on the given template to get copied to it.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for a service deployment.Nested classes/interfaces inherited from interface DefaultedDocPropertyHolder
DefaultedDocPropertyHolder.Mutable<S> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Collection<Pattern> protected final Collection<Pattern> protected final Documentprotected final ServiceTemplate -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedServiceDeployment(@NonNull ServiceTemplate template, @NonNull Collection<Pattern> excludes, @NonNull Collection<Pattern> includes, @NonNull Document properties) Constructs a new service deployment instance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new builder for a service deployment.builder(@NonNull ServiceDeployment deployment) Creates a new builder for a service deployment which has the same properties pre-set as the given deployment instance.clone()excludes()Get a collection of file names (in a regular expression format) which should get excluded from a deployment.includes()Get a collection of file names (in a regular expression format) which should be included in a deployment.Get the underlying document that all read and write operations are delegated to.template()Get the template to which this deployment (and therefore the service files) should get copied.Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow
-
Field Details
-
DEFAULT_EXCLUSIONS
-
template
-
excludes
-
includes
-
properties
-
-
Constructor Details
-
ServiceDeployment
protected ServiceDeployment(@NonNull @NonNull ServiceTemplate template, @NonNull @NonNull Collection<Pattern> excludes, @NonNull @NonNull Collection<Pattern> includes, @NonNull @NonNull Document properties) Constructs a new service deployment instance.- Parameters:
template- the template to deploy the service data to.excludes- the names of the files to exclude.properties- the properties for the deployment, not used internally and mainly for identification reasons.- Throws:
NullPointerException- if one of the constructor parameters is null.
-
-
Method Details
-
builder
Creates a new builder for a service deployment.- Returns:
- a new service deployment builder.
-
builder
@NonNull public static @NonNull ServiceDeployment.Builder builder(@NonNull @NonNull ServiceDeployment deployment) Creates a new builder for a service deployment which has the same properties pre-set as the given deployment instance. Changes made to the given deployment will not reflect into the builder and vice-versa.When calling build directly after creating the builder with this method it will return a service deployment instance which is equal to the given one but not identical.
- Parameters:
deployment- the deployment to copy the properties of.- Returns:
- a new service builder.
- Throws:
NullPointerException- if the given deployment is null.
-
template
Get the template to which this deployment (and therefore the service files) should get copied.- Returns:
- the target template of this deployment.
-
excludes
Get a collection of file names (in a regular expression format) which should get excluded from a deployment. Directories must be suffixed with a /.- Returns:
- the regular expressions of file names which should get excluded from a deployment.
-
includes
Get a collection of file names (in a regular expression format) which should be included in a deployment. Directories must be suffixed with a /.- Returns:
- the regular expressions of file names which should be included in a deployment.
-
clone
-
propertyHolder
Get the underlying document that all read and write operations are delegated to.- Specified by:
propertyHolderin interfaceDocPropertyHolder- Returns:
- the underlying document.
-