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
Modifier and TypeClassDescriptionstatic class
AbstractEntityConnectionProvider.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
-
Constructor Summary
ModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionfinal UUID
clientId()
final String
final Version
final void
close()
Closes the underlying connection and performs cleanup if requiredprotected abstract void
close
(EntityConnection connection) Closes the given connectionprotected abstract EntityConnection
connect()
final Observer<EntityConnection>
final 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 boolean
final DomainType
final Entities
entities()
Returns the domain entities this connection is based onfinal User
user()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:EntityConnectionProvider
Returns the domain entities this connection is based on- Specified by:
entities
in interfaceEntityConnectionProvider
- Returns:
- the underlying domain entities
-
user
- Specified by:
user
in interfaceEntityConnectionProvider
- Returns:
- the user used by this connection provider
-
domainType
- Specified by:
domainType
in interfaceEntityConnectionProvider
- Returns:
- the domain type
-
clientId
- Specified by:
clientId
in interfaceEntityConnectionProvider
- Returns:
- the UUID identifying this client connection
-
clientType
- Specified by:
clientType
in interfaceEntityConnectionProvider
- Returns:
- the String identifying the client type for this connection provider
-
clientVersion
- Specified by:
clientVersion
in interfaceEntityConnectionProvider
- Returns:
- the client version
-
connectionValid
public final boolean connectionValid()- Specified by:
connectionValid
in interfaceEntityConnectionProvider
- Returns:
- true if a connection has been establised and the connection is in a valid state
-
connected
- Specified by:
connected
in interfaceEntityConnectionProvider
- Returns:
- an observer notified when a connection is established
-
connection
Description copied from interface:EntityConnectionProvider
Provides 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:
connection
in interfaceEntityConnectionProvider
- Returns:
- a EntityConnection instance
-
close
public final void close()Description copied from interface:EntityConnectionProvider
Closes the underlying connection and performs cleanup if required- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceEntityConnectionProvider
- See Also:
-
connect
- Returns:
- an established connection
-
close
Closes the given connection- Parameters:
connection
- the connection to be closed
-