Interface EntityConnectionProvider

    • Method Detail

      • getDomain

        Domain getDomain()
        Returns the domain model this connection is based on
        Returns:
        the underlying domain model
      • getConnection

        EntityConnection getConnection()
        Provides a EntityConnection object, is responsible for returning a healthy EntityConnection object, that is, it must reconnect an invalid connection whether remotely or locally
        Returns:
        a EntityConnection instance
      • getConnectionType

        String getConnectionType()
        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"
      • getDescription

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

        boolean isConnected()
        Returns:
        true if a connection has been established, note that this does not check if the actual connection is valid, only that one has been established.
        See Also:
        isConnectionValid()
      • isConnectionValid

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

        void addOnConnectListener​(EventListener listener)
        Adds a listener notified each time this connection provider establishes a connection to the database
        Parameters:
        listener - a listener notified each time the underlying connection is connected
      • removeOnConnectListener

        void removeOnConnectListener​(EventListener listener)
        Removes the given listener
        Parameters:
        listener - the listener to remove
      • disconnect

        void disconnect()
        Logs out, disconnects and performs cleanup if required
      • setUser

        EntityConnectionProvider setUser​(User user)
        Disconnects the underlying connection if connected.
        Parameters:
        user - the user
        Returns:
        this EntityConnectionProvider instance
      • getUser

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

        EntityConnectionProvider setDomainClassName​(String domainClassName)
        Disconnects the underlying connection if connected.
        Parameters:
        domainClassName - the name of the class specifying the domain model for this connection provider
        Returns:
        this EntityConnectionProvider instance
        Throws:
        IllegalArgumentException - in case domainClassName is null
      • getDomainClassName

        String getDomainClassName()
        Returns:
        the domain model classname
      • setClientId

        EntityConnectionProvider setClientId​(UUID clientId)
        Disconnects the underlying connection if connected.
        Parameters:
        clientId - the UUID identifying this client connection
        Returns:
        this EntityConnectionProvider instance
        Throws:
        IllegalArgumentException - in case clientId is null
      • getClientId

        UUID getClientId()
        Returns:
        the UUID identifying this client connection
      • setClientTypeId

        EntityConnectionProvider setClientTypeId​(String clientTypeId)
        Disconnects the underlying connection if connected.
        Parameters:
        clientTypeId - a String identifying the client type for this connection provider
        Returns:
        this EntityConnectionProvider instance
      • getClientTypeId

        String getClientTypeId()
        Returns:
        the String identifying the client type for this connection provider
      • setClientVersion

        EntityConnectionProvider setClientVersion​(Version clientVersion)
        Parameters:
        clientVersion - the client version
        Returns:
        this EntityConnectionProvider instance
      • getClientVersion

        Version getClientVersion()
        Returns:
        the client version