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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for a service environment type.Nested classes/interfaces inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
DefaultedDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ServiceEnvironmentTypeThe bungeecord service environment type, can also be any fork of bungeecord (Java Edition proxy).private final intstatic final DocProperty<Boolean> A property set on all service environment types which are a Minecraft java edition proxy.static final DocProperty<Boolean> A property set on all service environment types which are a Minecraft java edition server.static final ServiceEnvironmentTypeThe Limbo (LOOHP) service environment type (Java Edition dummy server).static final ServiceEnvironmentTypeThe default minecraft server service environment type.static final ServiceEnvironmentTypeThe minestom service environment type.static final ServiceEnvironmentTypeThe default modded server service environment type.private final Stringstatic final ServiceEnvironmentTypeThe default nukkit service environment type (Pocket Edition server).static final DocProperty<Boolean> A property set on all service environment types which are a Minecraft pocket edition proxy.static final DocProperty<Boolean> A property set on all service environment types which are a Minecraft pocket edition server.static final DocProperty<String> A property which defines the plugin directory of a service environment.private final Documentstatic final ServiceEnvironmentTypeThe velocity service environment type (Java Edition proxy).static final ServiceEnvironmentTypeThe waterdog PE service environment type (PE proxy). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Constructs a new builder instance for a service environment type.Constructs a new builder instance for a service environment which has the properties of the given service environment already set.clone()Get the default arguments which get appended to the end of a service command line.intGet the default start port of the environment which will be used when no specific port was used to create a service.static booleanChecks if the given environment type is a proxy for Minecraft java or pocket edition.static booleanChecks if the given environment type is a server for Minecraft java or pocket edition.name()Get the unique name identifier of this object in the related scope.Get the underlying document that all read and write operations are delegated to.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow
-
Field Details
-
JAVA_PROXY
A property set on all service environment types which are a Minecraft java edition proxy. -
PE_PROXY
A property set on all service environment types which are a Minecraft pocket edition proxy. -
JAVA_SERVER
A property set on all service environment types which are a Minecraft java edition server. -
PE_SERVER
A property set on all service environment types which are a Minecraft pocket edition server. -
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
The default nukkit service environment type (Pocket Edition server). -
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
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
The minestom service environment type. This applies to all services which are a server minestom instance allowing extensions running on it. -
LIMBO_LOOHP
The Limbo (LOOHP) service environment type (Java Edition dummy server). -
BUNGEECORD
The bungeecord service environment type, can also be any fork of bungeecord (Java Edition proxy). -
VELOCITY
The velocity service environment type (Java Edition proxy). -
WATERDOG_PE
The waterdog PE service environment type (PE proxy). -
name
-
defaultServiceStartPort
private final int defaultServiceStartPort -
defaultProcessArguments
-
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
@NonNull public static @NonNull ServiceEnvironmentType.Builder builder(@NonNull @NonNull ServiceEnvironmentType type) 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
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
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
-
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
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
-
propertyHolder
Get the underlying document that all read and write operations are delegated to.- Specified by:
propertyHolderin interfaceDocPropertyHolder- Returns:
- the underlying document.
-