Class ServiceEnvironmentType

java.lang.Object
eu.cloudnetservice.driver.service.ServiceEnvironmentType
All Implemented Interfaces:
Named, DefaultedDocPropertyHolder, DocPropertyHolder, Cloneable

public final class ServiceEnvironmentType extends Object implements DefaultedDocPropertyHolder, Named, Cloneable
The service environment type groups multiple service environments together and holds all common variables to identify them. Everything which is configured on the service environment type level should apply to all service environments as well.
Since:
4.0
  • Field Details

    • JAVA_PROXY

      public static final DocProperty<Boolean> JAVA_PROXY
      A property set on all service environment types which are a Minecraft java edition proxy.
    • PE_PROXY

      public static final DocProperty<Boolean> PE_PROXY
      A property set on all service environment types which are a Minecraft pocket edition proxy.
    • JAVA_SERVER

      public static final DocProperty<Boolean> JAVA_SERVER
      A property set on all service environment types which are a Minecraft java edition server.
    • PE_SERVER

      public static final DocProperty<Boolean> PE_SERVER
      A property set on all service environment types which are a Minecraft pocket edition server.
    • PLUGIN_DIR

      public static final DocProperty<String> PLUGIN_DIR
      A property which defines the plugin directory of a service environment. For example for a modded server this would return "mods" rather than "plugins" (which is the default value).
    • NUKKIT

      public static final ServiceEnvironmentType NUKKIT
      The default nukkit service environment type (Pocket Edition server).
    • MINECRAFT_SERVER

      public static final ServiceEnvironmentType MINECRAFT_SERVER
      The default minecraft server service environment type. This applies to all services which don't need special configuration to run a wrapped minecraft java edition server in any way (Java Edition server).
    • MODDED_MINECRAFT_SERVER

      public static final ServiceEnvironmentType MODDED_MINECRAFT_SERVER
      The default modded server service environment type. This applies to all services which are wrapping a minecraft server instance but allows mods to run on them, for example fabric (Java Edition server).
    • MINESTOM

      public static final ServiceEnvironmentType MINESTOM
      The minestom service environment type. This applies to all services which are a server minestom instance allowing extensions running on it.
    • LIMBO_LOOHP

      public static final ServiceEnvironmentType LIMBO_LOOHP
      The Limbo (LOOHP) service environment type (Java Edition dummy server).
    • BUNGEECORD

      public static final ServiceEnvironmentType BUNGEECORD
      The bungeecord service environment type, can also be any fork of bungeecord (Java Edition proxy).
    • VELOCITY

      public static final ServiceEnvironmentType VELOCITY
      The velocity service environment type (Java Edition proxy).
    • WATERDOG_PE

      public static final ServiceEnvironmentType WATERDOG_PE
      The waterdog PE service environment type (PE proxy).
    • name

      private final String name
    • defaultServiceStartPort

      private final int defaultServiceStartPort
    • defaultProcessArguments

      private final Set<String> defaultProcessArguments
    • properties

      private final Document properties
  • Constructor Details

    • ServiceEnvironmentType

      private ServiceEnvironmentType(@NonNull @NonNull String name, int defaultServiceStartPort, @NonNull @NonNull Set<String> defaultProcessArguments, @NonNull @NonNull Document properties)
      Constructs a new service environment type instance.
      Parameters:
      name - the name of the environment type.
      defaultServiceStartPort - the default start port of the environment, used when no specific port is supplied.
      defaultProcessArguments - the default process arguments to append to a service startup command line.
      properties - the properties which contain further information about the environment.
      Throws:
      NullPointerException - if one of the given parameters is null.
  • Method Details

    • builder

      Constructs a new builder instance for a service environment type.
      Returns:
      a new service environment builder.
    • builder

      Constructs a new builder instance for a service environment which has the properties of the given service environment already set.

      When calling build directly after constructing a builder using this method, it will result in an environment type which is equal but not the same as the given one.

      Parameters:
      type - the environment type to copy the properties of.
      Returns:
      a new environment type builder instance which has the properties of the given environment type set.
      Throws:
      NullPointerException - if the given environment type is null.
    • minecraftProxy

      public static boolean minecraftProxy(@NonNull @NonNull ServiceEnvironmentType type)
      Checks if the given environment type is a proxy for Minecraft java or pocket edition.
      Parameters:
      type - the type to check.
      Returns:
      true if the given type is a proxy for java or pocket edition, false otherwise.
      Throws:
      NullPointerException - if the given service environment type is null.
    • minecraftServer

      public static boolean minecraftServer(@NonNull @NonNull ServiceEnvironmentType type)
      Checks if the given environment type is a server for Minecraft java or pocket edition.
      Parameters:
      type - the type to check.
      Returns:
      true if the given type is a server for java or pocket edition, false otherwise.
      Throws:
      NullPointerException - if the given service environment type is null.
    • name

      @NonNull public @NonNull String name()
      Get the unique name identifier of this object in the related scope.
      Specified by:
      name in interface Named
      Returns:
      the unique name identifier of this object in the related scope.
    • defaultStartPort

      public int defaultStartPort()
      Get the default start port of the environment which will be used when no specific port was used to create a service.
      Returns:
      the default start port of the environment.
    • defaultProcessArguments

      @NonNull public @NonNull Collection<String> defaultProcessArguments()
      Get the default arguments which get appended to the end of a service command line.
      Returns:
      the default process arguments for the environment type.
    • clone

      public ServiceEnvironmentType clone()
      Overrides:
      clone in class Object
    • propertyHolder

      @NonNull public @NonNull Document propertyHolder()
      Get the underlying document that all read and write operations are delegated to.
      Specified by:
      propertyHolder in interface DocPropertyHolder
      Returns:
      the underlying document.