T
- the type of EntityConnection
providedpublic interface EntityConnectionProvider<T extends EntityConnection>
EntityConnection
instance.
getConnection()
is guaranteed to return a healthy connection or throw an exception.Modifier and Type | Field and Description |
---|---|
static PropertyValue<java.lang.String> |
CLIENT_CONNECTION_TYPE
Specifies whether the client should connect locally, remotely or via http,
accepted values: local, remote, http
Value type: String Default value: local |
static PropertyValue<java.lang.String> |
CLIENT_DOMAIN_CLASS
Specifies the name of the domain model class required for a client connection.
Value type: String Default value: null |
static java.lang.String |
CONNECTION_TYPE_HTTP
Indicates a http database connection
|
static java.lang.String |
CONNECTION_TYPE_LOCAL
Indicates a local database connection
|
static java.lang.String |
CONNECTION_TYPE_REMOTE
Indicates a remote database connection
|
Modifier and Type | Method and Description |
---|---|
void |
addOnConnectListener(EventListener listener)
Adds a listener notified each time this connection provider establishes a connection to the database
|
void |
disconnect()
Logs out, disconnects and performs cleanup if required
|
java.util.UUID |
getClientId() |
java.lang.String |
getClientTypeId() |
Version |
getClientVersion() |
T |
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
|
java.lang.String |
getConnectionType()
Returns a String specifying the type of connection provided by this connection provider
|
java.lang.String |
getDescription() |
Domain |
getDomain()
Returns the domain model this connection is based on
|
java.lang.String |
getDomainClassName() |
java.lang.String |
getServerHostName() |
User |
getUser() |
boolean |
isConnected() |
boolean |
isConnectionValid() |
void |
removeOnConnectListener(EventListener listener)
Removes the given listener
|
EntityConnectionProvider |
setClientId(java.util.UUID clientId)
Disconnects the underlying connection if connected.
|
EntityConnectionProvider |
setClientTypeId(java.lang.String clientTypeId)
Disconnects the underlying connection if connected.
|
EntityConnectionProvider |
setClientVersion(Version clientVersion) |
EntityConnectionProvider |
setDomainClassName(java.lang.String domainClassName)
Disconnects the underlying connection if connected.
|
EntityConnectionProvider |
setUser(User user)
Disconnects the underlying connection if connected.
|
static final java.lang.String CONNECTION_TYPE_LOCAL
CLIENT_CONNECTION_TYPE
,
Constant Field Valuesstatic final java.lang.String CONNECTION_TYPE_REMOTE
CLIENT_CONNECTION_TYPE
,
Constant Field Valuesstatic final java.lang.String CONNECTION_TYPE_HTTP
CLIENT_CONNECTION_TYPE
,
Constant Field Valuesstatic final PropertyValue<java.lang.String> CLIENT_DOMAIN_CLASS
static final PropertyValue<java.lang.String> CLIENT_CONNECTION_TYPE
Domain getDomain()
T getConnection()
java.lang.String getConnectionType()
java.lang.String getDescription()
java.lang.String getServerHostName()
boolean isConnected()
isConnectionValid()
boolean isConnectionValid()
void addOnConnectListener(EventListener listener)
listener
- a listener notified each time the underlying connection is connectedvoid removeOnConnectListener(EventListener listener)
listener
- the listener to removevoid disconnect()
EntityConnectionProvider setUser(User user)
user
- the userUser getUser()
EntityConnectionProvider setDomainClassName(java.lang.String domainClassName)
domainClassName
- the name of the class specifying the domain model for this connection providerjava.lang.IllegalArgumentException
- in case domainClassName
is nulljava.lang.String getDomainClassName()
EntityConnectionProvider setClientId(java.util.UUID clientId)
clientId
- the UUID identifying this client connectionjava.lang.IllegalArgumentException
- in case clientId
is nulljava.util.UUID getClientId()
EntityConnectionProvider setClientTypeId(java.lang.String clientTypeId)
clientTypeId
- a String identifying the client type for this connection providerjava.lang.String getClientTypeId()
EntityConnectionProvider setClientVersion(Version clientVersion)
clientVersion
- the client versionVersion getClientVersion()