Module is.codion.framework.db.core
Package is.codion.framework.db
Class AbstractEntityConnectionProvider
java.lang.Object
is.codion.framework.db.AbstractEntityConnectionProvider
- All Implemented Interfaces:
EntityConnectionProvider,AutoCloseable
public abstract class AbstractEntityConnectionProvider
extends Object
implements EntityConnectionProvider
An abstract EntityConnectionProvider implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAbstractEntityConnectionProvider.AbstractBuilder<T extends EntityConnectionProvider,B extends EntityConnectionProvider.Builder<T, B>> An abstractEntityConnectionProvider.Builder.Nested classes/interfaces inherited from interface is.codion.framework.db.EntityConnectionProvider
EntityConnectionProvider.Builder<T extends EntityConnectionProvider,B extends EntityConnectionProvider.Builder<T, B>> -
Field Summary
Fields inherited from interface is.codion.framework.db.EntityConnectionProvider
CLIENT_CONNECTION_TYPE, CLIENT_DOMAIN_TYPE, CONNECTION_TYPE_HTTP, CONNECTION_TYPE_LOCAL, CONNECTION_TYPE_REMOTE, DESCRIPTION -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionfinal UUIDclientId()final voidclose()Closes the underlying connection and performs cleanup if requiredprotected abstract voidclose(EntityConnection connection) Closes the given connectionprotected abstract EntityConnectionconnect()final Observer<EntityConnection> Provides a EntityConnection object, is responsible for returning a healthy EntityConnection object, that is, it must reconnect an invalid connection whether remotely or locallyfinal booleanfinal DomainTypefinal Entitiesentities()Returns the domain entities this connection is based onfinal Useruser()protected final EntityConnectionReturns a valid connection or throws an exception in case one can not be establishedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface is.codion.framework.db.EntityConnectionProvider
connectionType, description
-
Constructor Details
-
AbstractEntityConnectionProvider
protected AbstractEntityConnectionProvider(AbstractEntityConnectionProvider.AbstractBuilder<?, ?> builder) - Parameters:
builder- the builder
-
-
Method Details
-
entities
Description copied from interface:EntityConnectionProviderReturns the domain entities this connection is based on- Specified by:
entitiesin interfaceEntityConnectionProvider- Returns:
- the underlying domain entities
-
user
- Specified by:
userin interfaceEntityConnectionProvider- Returns:
- the user used by this connection provider
-
domainType
- Specified by:
domainTypein interfaceEntityConnectionProvider- Returns:
- the domain type
-
clientId
- Specified by:
clientIdin interfaceEntityConnectionProvider- Returns:
- the UUID identifying this client connection
-
clientType
- Specified by:
clientTypein interfaceEntityConnectionProvider- Returns:
- the String identifying the client type for this connection provider
-
clientVersion
- Specified by:
clientVersionin interfaceEntityConnectionProvider- Returns:
- the client version
-
connectionValid
public final boolean connectionValid()- Specified by:
connectionValidin interfaceEntityConnectionProvider- Returns:
- true if a connection has been establised and the connection is in a valid state
-
connected
- Specified by:
connectedin interfaceEntityConnectionProvider- Returns:
- an observer notified when a connection is established
-
connection
Description copied from interface:EntityConnectionProviderProvides a EntityConnection object, is responsible for returning a healthy EntityConnection object, that is, it must reconnect an invalid connection whether remotely or locally- Specified by:
connectionin interfaceEntityConnectionProvider- Returns:
- a EntityConnection instance
-
close
public final void close()Description copied from interface:EntityConnectionProviderCloses the underlying connection and performs cleanup if required- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceEntityConnectionProvider- See Also:
-
connect
- Returns:
- a new valid connection
-
close
Closes the given connection- Parameters:
connection- the connection to be closed
-
validConnection
Returns a valid connection or throws an exception in case one can not be established- Returns:
- a valid connection
-