Class Environment

java.lang.Object
org.rapidcontext.core.storage.StorableObject
org.rapidcontext.core.type.Environment

public class Environment extends StorableObject
An external connectivity environment. The environment contains a list of adapter connection pool, each with their own set of configuration parameter values.
Version:
1.0
  • Field Details

    • KEY_DESCRIPTION

      public static final String KEY_DESCRIPTION
      The dictionary key for the environment description.
      See Also:
    • KEY_CONNECTIONS

      public static final String KEY_CONNECTIONS
      The dictionary key for the environment connection path. The value stored will be a path object.
      See Also:
    • PATH

      public static final Path PATH
      The environment object storage path.
  • Constructor Details

    • Environment

      public Environment(String id, String type, Dict dict)
      Creates a new environment from a serialized representation.
      Parameters:
      id - the object identifier
      type - the object type name
      dict - the serialized representation
  • Method Details

    • all

      public static Stream<Environment> all(Storage storage)
      Returns a stream of all environments found in the storage.
      Parameters:
      storage - the storage to search
      Returns:
      a stream of environment instances found
    • find

      public static Environment find(Storage storage, String id)
      Searches for a specific environment in the storage.
      Parameters:
      storage - the storage to search in
      id - the environment identifier
      Returns:
      the environment found, or null if not found
    • description

      public String description()
      Returns the environment description.
      Returns:
      the environment description.
    • connectionPath

      public String connectionPath()
      Returns the default connection path for this environment.
      Returns:
      the default connection path for this environment
    • findConnection

      public Connection findConnection(Storage storage, String id)
      Searches for a connection with the specified id.
      Parameters:
      storage - the storage to search in
      id - the connection id to search for
      Returns:
      the connection found, or null if not found