Interface EntityConnectionProvider

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
HttpEntityConnectionProvider, LocalEntityConnectionProvider, RemoteEntityConnectionProvider
All Known Implementing Classes:
AbstractEntityConnectionProvider

public interface EntityConnectionProvider extends AutoCloseable
Specifies a class responsible for providing a single EntityConnection instance. connection() is guaranteed to return a healthy connection or throw an exception. A factory for EntityConnectionProviders based on system properties.
See Also:
  • Field Details

  • Method Details

    • entities

      Entities entities()
      Returns the domain entities this connection is based on
      Returns:
      the underlying domain entities
    • connection

      <T extends EntityConnection> T connection()
      Provides a EntityConnection object, is responsible for returning a healthy EntityConnection object, that is, it must reconnect an invalid connection whether remotely or locally
      Type Parameters:
      T - the expected EntityConnection type
      Returns:
      a EntityConnection instance
    • connectionType

      String connectionType()
      Returns a String specifying the type of connection provided by this connection provider
      Returns:
      a String specifying the type of connection, e.g. "local" or "remote"
    • description

      String description()
      Returns:
      a short description of the database provider
    • connectionValid

      boolean connectionValid()
      Returns:
      true if a connection has been establised and the connection is in a valid state
    • connected

      Returns:
      an observer notified when a connection is established
    • close

      void close()
      Closes the underlying connection and performs cleanup if required
      Specified by:
      close in interface AutoCloseable
      See Also:
    • user

      User user()
      Returns:
      the user used by this connection provider
    • domainType

      DomainType domainType()
      Returns:
      the domain type
    • clientId

      UUID clientId()
      Returns:
      the UUID identifying this client connection
    • clientTypeId

      String clientTypeId()
      Returns:
      the String identifying the client type for this connection provider
    • clientVersion

      Version clientVersion()
      Returns:
      the client version
    • builder

      static EntityConnectionProvider.Builder<?,?> builder()
      Returns:
      an unconfigured EntityConnectionProvider.Builder instance, based on the CLIENT_CONNECTION_TYPE configuration value
      Throws:
      IllegalStateException - in case the required connection provider builder is not available on the classpath
      See Also: