Package eu.cloudnetservice.driver
Class DriverEnvironment
java.lang.Object
eu.cloudnetservice.driver.DriverEnvironment
- All Implemented Interfaces:
eu.cloudnetservice.common.Named,DefaultedDocPropertyHolder,DocPropertyHolder
public final class DriverEnvironment
extends Object
implements DefaultedDocPropertyHolder, eu.cloudnetservice.common.Named
Represents the current environment in which the driver is running. There are currently two default environments, the
node and wrapper which are statically represented in this class.
A driver environment can hold additional information in its json properties, these are however never persisted anywhere.
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
DefaultedDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringstatic final DriverEnvironmentThe jvm-static representation of the node environment.private final Documentstatic final DriverEnvironmentThe jvm-static representation of the wrapper environment. -
Constructor Summary
ConstructorsConstructorDescriptionDriverEnvironment(@NonNull String name, @NonNull Document properties) Constructs a new driver environment instance. -
Method Summary
Methods inherited from class java.lang.Object
clone, 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
-
NODE
The jvm-static representation of the node environment. -
WRAPPER
The jvm-static representation of the wrapper environment. -
name
-
properties
-
-
Constructor Details
-
DriverEnvironment
Constructs a new driver environment instance.- Parameters:
name- the name of the environment.properties- the properties of the environment.- Throws:
NullPointerException- if the given name or properties are null.
-
-
Method Details
-
name
- Specified by:
namein interfaceeu.cloudnetservice.common.Named
-
propertyHolder
Get the underlying document that all read and write operations are delegated to.- Specified by:
propertyHolderin interfaceDocPropertyHolder- Returns:
- the underlying document.
-