Class ServiceDeployment
java.lang.Object
eu.cloudnetservice.driver.service.ServiceDeployment
- All Implemented Interfaces:
eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,,ServiceDeployment> eu.cloudnetservice.common.document.property.DocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,,ServiceDeployment> Cloneable
public class ServiceDeployment
extends Object
implements eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,ServiceDeployment>, 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. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Collection<Pattern>protected final Collection<Pattern>protected final eu.cloudnetservice.common.document.gson.JsonDocumentprotected final ServiceTemplate -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedServiceDeployment(@NonNull ServiceTemplate template, @NonNull Collection<Pattern> excludes, @NonNull Collection<Pattern> includes, @NonNull eu.cloudnetservice.common.document.gson.JsonDocument 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.@NonNull eu.cloudnetservice.common.document.gson.JsonDocumenttemplate()Get the template to which this deployment (and therefore the service files) should get copied.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow, removeProperty, writeProperty, writePropertyIfAbsent, writePropertyIfAbsent, writePropertyIfPresent, writePropertyIfPresent
-
Field Details
-
DEFAULT_EXCLUSIONS
-
template
-
excludes
-
includes
-
properties
protected final eu.cloudnetservice.common.document.gson.JsonDocument properties
-
-
Constructor Details
-
ServiceDeployment
protected ServiceDeployment(@NonNull @NonNull ServiceTemplate template, @NonNull @NonNull Collection<Pattern> excludes, @NonNull @NonNull Collection<Pattern> includes, @NonNull @NonNull eu.cloudnetservice.common.document.gson.JsonDocument 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
- Specified by:
propertyHolderin interfaceeu.cloudnetservice.common.document.property.DocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,ServiceDeployment>
-