Class DriverEnvironment

java.lang.Object
eu.cloudnetservice.driver.DriverEnvironment
All Implemented Interfaces:
Named, DefaultedDocPropertyHolder, DocPropertyHolder

public final class DriverEnvironment extends Object implements DefaultedDocPropertyHolder, 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
  • Field Details

    • NODE

      public static final DriverEnvironment NODE
      The jvm-static representation of the node environment.
    • WRAPPER

      public static final DriverEnvironment WRAPPER
      The jvm-static representation of the wrapper environment.
    • name

      private final String name
    • properties

      private final Document properties
  • Constructor Details

    • DriverEnvironment

      public DriverEnvironment(@NonNull @NonNull String name, @NonNull @NonNull Document properties)
      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

      @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.
    • 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.