Class ServiceDeployment.Builder

java.lang.Object
eu.cloudnetservice.driver.service.ServiceDeployment.Builder
Enclosing class:
ServiceDeployment

public static class ServiceDeployment.Builder extends Object
A builder for a service deployment.
Since:
4.0
  • Field Details

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • 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

      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 of plugins/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

      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 of plugins/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

      @NonNull public @NonNull ServiceDeployment.Builder withDefaultExclusions()
      Adds the wrapper.jar file 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 via modifyExcludes(Consumer) will keep the default exclusions.

      Returns:
      the same instance as used to call the method, for chaining.
    • 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 of plugins/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

      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 of plugins/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

      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.