public interface AffinityContextHelper
AffinityContextHelperFactory
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
createAffinityContext(java.lang.String databaseName,
java.lang.String serviceName,
java.lang.String instanceName)
Returns a new connection affinity context object derived from the specified
arguments.
|
java.lang.Object |
getAffinityContext(java.lang.String key)
Returns the affinity context object associated with the specified key.
|
java.lang.String |
getDatabaseName(java.lang.Object affinityContext)
Extracts the database unique name from the affinity context object.
|
java.lang.String |
getInstanceName(java.lang.Object affinityContext)
Extracts the database instance name from the affinity context object.
|
java.lang.String |
getKey(java.lang.Object affinityContext)
Returns an affinity context key derived from database and
service names found in the specified affinity context
|
java.lang.String |
getKey(java.lang.String databaseName,
java.lang.String serviceName)
Returns the affinity context key derived from the specified database
and service name
|
java.lang.String[] |
getKeys()
Returns a list of the set affinity context keys for this application context type,
or null if no contexts are set.
|
java.lang.String |
getServiceName(java.lang.Object affinityContext)
Extracts the database service name from the affinity context object.
|
boolean |
isApplicationContextAvailable()
Returns true if the application context is available for this affinity
context type.
|
boolean |
setAffinityContext(java.lang.String key,
java.lang.Object context)
Sets the affinity context object on the application context under
the specified key.
|
java.lang.String getKey(java.lang.Object affinityContext) throws AffinityContextException
affinityContext
- The affinity context objectAffinityContextException
- An error occurredjava.lang.String getKey(java.lang.String databaseName, java.lang.String serviceName)
databaseName
- Database unique nameserviceName
- Database service namejava.lang.String[] getKeys()
java.lang.Object getAffinityContext(java.lang.String key)
key
- The key of the affinity context objectboolean setAffinityContext(java.lang.String key, java.lang.Object context)
key
- The key used to store the affinity context objectcontext
- The affinity context object to storejava.lang.Object createAffinityContext(java.lang.String databaseName, java.lang.String serviceName, java.lang.String instanceName) throws AffinityContextException
databaseName
- The database unique name.serviceName
- The service name.instanceName
- The instance name.AffinityContextException
- An error occurred accessing the affinity context objectjava.lang.String getDatabaseName(java.lang.Object affinityContext) throws AffinityContextException
affinityContext
- The affinity context object.AffinityContextException
- An error occurred accessing the affinity context objectjava.lang.String getServiceName(java.lang.Object affinityContext) throws AffinityContextException
affinityContext
- The affinity context object.AffinityContextException
- An error occurred accessing the affinity context objectjava.lang.String getInstanceName(java.lang.Object affinityContext) throws AffinityContextException
affinityContext
- The affinity context object.AffinityContextException
- An error occurred accessing the affinity context objectboolean isApplicationContextAvailable()