|
IBM WebSphere® DataPower® XC10 Appliance Release 2.0 Client API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ObjectGrid
This object is used for creating sessions to the ObjectGrid. It is the
central core of the ObjectGrid framework. Besides creating
Session
s, it is also responsible for defining BackingMap
s,
setting a TransactionCallback
, managing keywords,
adding event listeners, and managing the security settings.
Field Summary | |
---|---|
static int |
CLIENT
Indicates the ObjectGrid is a client-side distributed ObjectGrid. |
static int |
DEFAULT_TX_TIMEOUT_VALUE
The default transaction time out value of 10 minutes if no transaction time out value is set. |
static int |
LOCAL
Indicates the ObjectGrid is a local ObjectGrid. |
static int |
SERVER
Indicates the ObjectGrid is a server-side distributed ObjectGrid. |
Method Summary | |
---|---|
void |
addEventListener(EventListener listener)
Adds an EventListener . |
void |
addEventListener(ObjectGridEventListener listener)
Deprecated. This method is deprecated in version 7.1.1, use the addEventListener(EventListener) method. |
void |
associateKeyword(java.io.Serializable parent,
java.io.Serializable child)
Deprecated. Use Index or query function to get Objects with specific attributes |
BackingMap |
createMap(java.lang.String name)
Creates a BackingMap, but does not associate it with this ObjectGrid. |
BackingMap |
defineMap(java.lang.String name)
Defines a BackingMap that will be used by the application. |
void |
destroy()
Destroys this instance. |
CollisionArbiter |
getCollisionArbiter()
Retrieves the CollisionArbiter that this grid is using to resolve revision collisions. |
java.util.List |
getEventListeners()
Returns the current list of EventListener s. |
java.util.List |
getListOfMapNames()
Gets the list of map names currently defined for this ObjectGrid instance. |
BackingMap |
getMap(java.lang.String name)
Returns a BackingMap previously configured by calling the defineMap(String) or setMaps(List) method. |
java.lang.String |
getName()
Gets the name of this ObjectGrid. |
int |
getObjectGridType()
Returns the type of ObjectGrid. |
Session |
getSession()
Gets a Session object that can be used by a single thread at a time. |
Session |
getSession(CredentialGenerator credGen)
Get a session using a CredentialGenerator . |
Session |
getSession(javax.security.auth.Subject subject)
Allows the use of a specific Subject rather than use the
SubjectSource configured on the ObjectGrid to get a Session. |
ObjectGridLifecycleListener.State |
getState()
Retrieve the current life cycle state of this ObjectGrid. |
TransactionCallback |
getTransactionCallback()
Retrieves the TransactionCallback object. |
int |
getTxIsolation()
Retrieves the default transaction isolation level. |
int |
getTxTimeout()
Gets transaction timeout setting for this ObjectGrid instance. |
void |
initialize()
Begins the bootstrapping of the ObjectGrid and Session instances. |
boolean |
isSecurityEnabled()
Checks whether security is enabled on this ObjectGrid or not. |
void |
registerEntities(java.lang.Class[] entities)
Register one or more entities based on the class metadata. |
void |
registerEntities(java.net.URL entityXML)
Registers one ore more entities from an entity XML file. |
void |
removeEventListener(EventListener listener)
Removes an EventListener . |
void |
removeEventListener(ObjectGridEventListener listener)
Deprecated. This method is deprecated in version 7.1.1, use the removeEventListener(EventListener) method. |
int |
reserveSlot(java.lang.String containerName)
Allows plugins on this ObjectGrid to reserve slots for use to store context data. |
void |
setAccessByCreatorOnlyMode(int accessByCreatorOnlyMode)
Set the "access by creator only" mode. |
void |
setAuthorizationMechanism(int authMechanism)
Sets the authorization mechanism. |
void |
setCollisionArbiter(CollisionArbiter arbiter)
Sets the CollisionArbiter that is responsible for arbitration of revision conflicts. |
void |
setEventListeners(java.util.List listeners)
Deprecated. This method is deprecated in version 7.1.1. Use the addEventListener(EventListener) or removeEventListener(EventListener) methods.
Plug-ins that implement the ObjectGridLifecycleListener interface are automatically
registered with the grid. Using this method will remove those automatically
added listeners. |
void |
setMapAuthorization(MapAuthorization mapAuthorization)
Deprecated. in WAS XD 6.1. Use setObjectGridAuthorization(ObjectGridAuthoirzation) instead
to plug in custom authorizations.
If both setMapAuthorization(MapAuthorization) and setObjectGridAuthorization(ObjectGridAuthoirzation)
are used, ObjectGrid will use the provided MapAuthorization to authorize map accesses,
even though this method is deprecated. |
void |
setMaps(java.util.List mapList)
Clears any BackingMap s that have been previously defined
on this ObjectGrid and replaces them with the List of BackingMaps provided. |
void |
setName(java.lang.String gridName)
Sets the name of this ObjectGrid. |
void |
setObjectGridAuthorization(ObjectGridAuthorization ogAuthorization)
Sets the ObjectGridAuthorization for this ObjectGrid instance. |
void |
setPermissionCheckPeriod(int period)
Sets the permission check period. |
void |
setQueryConfig(QueryConfig queryConfig)
Set the QueryConfig object for this ObjectGrid. |
void |
setSecurityEnabled()
Enables the ObjectGrid security. |
void |
setSubjectSource(SubjectSource source)
Sets the SubjectSource plugin. |
void |
setSubjectValidation(SubjectValidation subjectValidation)
Sets the SubjectValidation for this ObjectGrid instance. |
void |
setTransactionCallback(TransactionCallback callback)
Sets the TransactionCallback object. |
void |
setTxIsolation(int level)
Sets the default transaction isolation level for all sessions created by the ObjectGrid. |
void |
setTxTimeout(int timeout)
Sets the transaction timeout value to a specified number of seconds. |
Methods inherited from interface com.ibm.websphere.objectgrid.streamquery.StreamQueryManager |
---|
addStreamQuerySet, createStreamQuerySet, getStreamQuerySets, removeStreamQuerySet, setStreamQuerySets |
Field Detail |
---|
static final int DEFAULT_TX_TIMEOUT_VALUE
static final int LOCAL
static final int SERVER
static final int CLIENT
Method Detail |
---|
Session getSession() throws ObjectGridException, TransactionCallbackException
Gets a Session object that can be used by a single thread at a time.
It is not allowed to share this Session
object between
threads without placing a critical section around it. While the core
framework allows the object to move between threads, the
TransactionCallback
and Loader
may prevent this
usage, especially in J2EE environments.
When the ObjectGrid is a local ObjectGrid, and its security is enabled, this
method will use the SubjectSource
to get a Subject
object and then associate the Subject
object with this session .
When the ObjectGrid is a distributed ObjectGrid (client server mode), and its security is enabled, this method will utilize the client server security infrastructure to get a secure session.
If the initialize()
method has not been invoked prior to
the first getSession
invocation, an implicit initialization
will occur. This ensures that all of the configuration is complete
before any runtime usage is required.
Session
ObjectGridException
- if an error occurs during processing
TransactionCallbackException
- if the TransactionCallback
throws an exception
java.lang.IllegalStateException
- if this method is called after the
destroy()
method is called.destroy()
,
initialize()
,
Session
,
SubjectSource
Session getSession(javax.security.auth.Subject subject) throws ObjectGridException, TransactionCallbackException, InvalidSubjectException
Subject
rather than use the
SubjectSource
configured on the ObjectGrid to get a Session.
This method should only be used when ObjectGrid security is enabled. If
the ObjectGrid security is disabled, the provided Subject
object will not be
used.
If the initialize()
method has not been invoked prior to
the first getSession
invocation, an implicit initialization
will occur. This ensures that all of the configuration is complete
before any runtime usage is required.
subject
- Subject
to associate with the returned Session
Session
ObjectGridException
- if an error occurs during processing
TransactionCallbackException
- if the TransactionCallback
throws an exception
InvalidSubjectException
- the subject passed in is invalid based
on the SubjectValidation
mechanism.
java.lang.IllegalStateException
- if this method is called after the
destroy()
method is called.destroy()
,
initialize()
,
Session
,
SubjectValidation
void setTransactionCallback(TransactionCallback callback)
A single cache is a single domain. All Loader
s defined for
BackingMap
s in an ObjectGrid will normally cooperate, thus
a corresponding TransactionCallback
object needs to be set
on the ObjectGrid.
A TransactionCallback that implements the ObjectGridLifecycleListener
interface is automatically added
as if the addEventListener(EventListener)
method was called. Any previous
callback which implements ObjectGridLifecycleListener
interface is removed as if
the removeEventListener(EventListener)
method was called.
A TransactionCallback may implement the ObjectGridPlugin
interface in order
to receive enhanced ObjectGrid plug-in lifecycle method calls. The plug-in is
also required to correctly implement each of the bean methods related to
introspection of its state (for example isInitialized()
,
isDestroyed()
, etc).
callback
- An instance of a TransactionCallback
java.lang.IllegalArgumentException
- if callback is null
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.initialize()
,
TransactionCallback
TransactionCallback getTransactionCallback()
The TransactionCallback can be used in conjunction with the
TxID
to house transaction-specific context data,
such as the connection to the database.
setTransactionCallback(TransactionCallback)
method of
this interface or a default TransactionCallback
object
if setTransactionCallback was not previously called for this ObjectGrid.setTransactionCallback(TransactionCallback)
,
TransactionCallback
void setCollisionArbiter(CollisionArbiter arbiter)
A CollistionArbiter that implements the ObjectGridLifecycleListener
interface is automatically added
as if the addEventListener(EventListener)
method was called. Any previous
arbiter which implements ObjectGridLifecycleListener
interface is removed as if
the removeEventListener(EventListener)
method was called.
A CollisionArbiter may implement the ObjectGridPlugin
interface in order
to receive enhanced ObjectGrid plug-in lifecycle method calls. The plug-in is
also required to correctly implement each of the bean methods related to
introspection of its state (for example isInitialized()
,
isDestroyed()
, etc).
arbiter
- The arbitration logic that will be used to resolve collisions.CollisionArbiter getCollisionArbiter()
BackingMap defineMap(java.lang.String name)
Note, to avoid an IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
name
- the name of the map being defined.
java.lang.IllegalArgumentException
- if name is null
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.initialize()
,
BackingMap
BackingMap createMap(java.lang.String name)
This method is to be used in tandem with the
Note, to avoid an
setMaps(List)
method, which will associate BackingMap
s with this ObjectGrid.
These methods are for use when configuring an ObjectGrid with the Spring Framework.
IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
name
- the name of the map being defined.
java.lang.IllegalArgumentException
- if name is null
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.initialize()
,
setMaps(List)
void setMaps(java.util.List mapList)
BackingMap
s that have been previously defined
on this ObjectGrid and replaces them with the List of BackingMaps provided.
Note, to avoid an IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
mapList
- a list of BackingMaps to set on this ObjectGrid.
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.createMap(String)
,
initialize()
java.util.List getListOfMapNames()
Note, once the initialize()
method is called, the
List
returned will not change. However, it could
change if called prior to initialization. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
defineMap(String)
or
setMaps(List)
method. An empty List is returned
if no maps are currently defined.defineMap(String)
,
initialize()
,
setMaps(List)
BackingMap getMap(java.lang.String name)
defineMap(String)
or setMaps(List)
method.
name
- the same name that was used as an argument to the
defineMap(String)
or createMap(String) method.
A null reference is returned if a map is not associated with this
ObjectGrid for the specified map name.
- Returns:
- the BackingMap instance
- See Also:
createMap(String)
,
defineMap(String)
,
setMaps(List)
void initialize() throws ObjectGridException
After this method has been invoked, the configuration of the ObjectGrid is
considered complete and is ready for runtime usage. Any additional
configuration method invocations, such as defineMap(String)
,
will result in an exception.
This method is considered optional since the first call to one of the
getSession
methods will perform an implicit initialization.
ObjectGridException
- if an error occurs during processingvoid addEventListener(EventListener listener)
EventListener
.
Significant events will be communicated to interested listeners through
the
Note, this method is allowed to be invoked before and after the
Object grid plug-ins (
ObjectGridEventListener
and
ObjectGridLifecycleListener
callback interface. Multiple event listeners are allowed to be registered, with no
implied ordering of event notifications.
initialize()
method.
TransactionCallback
, CollisionArbiter
)
that implement the ObjectGridLifecycleListener
are automatically
added as lifecycle listeners when added to the ObjectGrid
.
listener
- An instance of ObjectGridEventListener or
ObjectGridLifecycleListener
java.lang.IllegalArgumentException
- if listener is null
or not
an instance of ObjectGridEventListener, ObjectGridLifecycleListener.
java.lang.IllegalStateException
- if this method is called during
initialization by one of the configured plugins and the
ObjectGrid runtime is not in a usable state to initialize
the ObjectGridEventListener.ObjectGridEventListener
,
ObjectGridLifecycleListener
,
EventListener
void addEventListener(ObjectGridEventListener listener)
addEventListener(EventListener)
method.
addEventListener(EventListener)
method.
listener
- void removeEventListener(EventListener listener)
EventListener
.
This method removes an ObjectGridEventListener
or ObjectGridLifecycleListener
that was
previously added to this object using the
addEventListener(ObjectGridEventListener)
or
setEventListeners(List)
method. If the desired
ObjectGridEventListener is not found, no error will be
returned.
Note, this method is allowed to be invoked before and after the
initialize()
method.
Object grid plug-ins (TransactionCallback
, CollisionArbiter
)
that implement the ObjectGridLifecycleListener
are automatically
removed as lifecycle listeners when removed from the ObjectGrid
.
listener
- An instance of ObjectGridEventListener or ObjectGridLifecycleListener
java.lang.IllegalArgumentException
- if listener is null
or not
an instance of ObjectGridEventListener
,
ObjectGridLifecycleListener
addEventListener(EventListener)
,
ObjectGridEventListener
,
EventListener
void removeEventListener(ObjectGridEventListener listener)
removeEventListener(EventListener)
method.
removeEventListener(EventListener)
method.
listener
- @Deprecated void setEventListeners(java.util.List listeners)
addEventListener(EventListener)
or removeEventListener(EventListener)
methods.
Plug-ins that implement the ObjectGridLifecycleListener interface are automatically
registered with the grid. Using this method will remove those automatically
added listeners.
EventListener
s
and replaces it with the supplied List
of EventListener
s
Note, this method is allowed to be invoked before and after the
initialize()
method.
listeners
- List
of ObjectGridEventListener
s
and ObjectGridLifecycleListener
instances
java.lang.ClassCastException
- if one of the elements in the provided list
is not an instance of ObjectGridEventListener
java.lang.IllegalArgumentException
- if listeners is null
,
contains a null
reference, or contains an instance
of a type other than ObjectGridEventListener
and ObjectGridLifecycleListener
java.lang.IllegalStateException
- if this method is called during
initialization by one of the configured plugins and the
ObjectGrid runtime is not in a usable state to initialize
the ObjectGridEventListener objects.EventListener
,
addEventListener(EventListener)
,
removeEventListener(EventListener)
java.util.List getEventListeners()
EventListener
s.
EventListener
s.addEventListener(EventListener)
,
EventListener
,
ObjectGridEventListener
,
ObjectGridLifecycleListener
void associateKeyword(java.io.Serializable parent, java.io.Serializable child)
If map entries are invalidated using the parent keyword, map entries associated with the child keyword are also invalidated. Invalidating a child keyword has no impact on entries associated with the parent keyword. For example, this method can be used to add the keyword "New York" as a child of the keyword "USA" so that if "USA" is invalidated, all of the entries associated with the "New York" keyword will also be invalidated.
Note, this method is allowed to be invoked before and after the
initialize()
method.
parent
- keyword to associate with the child parameter in a
parent-child relationshipchild
- All entries associated with this keyword will also be
associated with the parent keywordObjectMap.invalidateUsingKeyword(Serializable, boolean)
java.lang.String getName()
This method is useful for authorization as all Maps are prefixed with the ObjectGrid name.
setName(String)
void setName(java.lang.String gridName)
IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
gridName
- The ObjectGrid name to use.
java.lang.IllegalArgumentException
- if gridName is null
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.int reserveSlot(java.lang.String containerName)
Currently the TxID
object is the only object that uses
slots for storing context data. TxID slots are used for storing
transactional context data.
Once a slot is reserved, the slot assignment is permanent and cannot be
given back. Note, this method is allowed to be invoked before and after the
initialize()
method.
containerName
- The name of the Object with the slots. Currently
TxID.SLOT_NAME
is the only supported value for
this argument.
java.lang.IllegalArgumentException
- if containerName is not TxID.SLOT_NAME
.TxID.SLOT_NAME
,
TxID.getSlot(int)
,
TxID.putSlot(int, Object)
void setSubjectValidation(SubjectValidation subjectValidation)
SubjectValidation
for this ObjectGrid instance.
Passing null
to this method removes a previously set
SubjectValidation
object from an earlier invocation of this method
and indicates that this ObjectGrid
is not associated with a
SubjectValidation
object.
This method should only be used when ObjectGrid security is enabled. If
the ObjectGrid security is disabled, the provided SubjectValidation
object
will not be used.
A SubjectValidation
plugin can be used to validate the
Subject
object passed in is a valid Subject.
Please refer to SubjectValidation
for more details.
Note, to avoid an IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
subjectValidation
- the SubjectValidation
plugin
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.getSession(Subject)
,
initialize()
,
SubjectValidation
void setMapAuthorization(MapAuthorization mapAuthorization)
setObjectGridAuthorization(ObjectGridAuthoirzation)
instead
to plug in custom authorizations.
If both setMapAuthorization(MapAuthorization)
and setObjectGridAuthorization(ObjectGridAuthoirzation)
are used, ObjectGrid will use the provided MapAuthorization
to authorize map accesses,
even though this method is deprecated.
MapAuthorization
for this ObjectGrid instance.
Passing null
to this method removes a previously set
MapAuthorization
object from an earlier invocation of this method
and indicates that this ObjectGrid
is not associated with a
MapAuthorization
object.
This method should only be used when ObjectGrid security is enabled. If
the ObjectGrid security is disabled, the provided MapAuthorization
object
will not be used.
A MapAuthorization
plugin can be used to authorize
access to the maps. Please refer to MapAuthorization
for more details.
Note, to avoid an IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
mapAuthorization
- the MapAuthorization
plugin
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.initialize()
,
MapAuthorization
void setAuthorizationMechanism(int authMechanism)
If this method is not invoked, the default authorization mechanism is
SecurityConstants.AUTHORIZATION_MECHANISM_JAAS
.
This method should only be used when ObjectGrid security is enabled. If the ObjectGrid security is disabled, the provide authorization mechanism will not be used.
Note, to avoid an IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
authMechanism
- the authorization mechanism, must be one of the
final static variable on the SecurityConstants
class.
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.initialize()
,
SecurityConstants.AUTHORIZATION_MECHANISM_CUSTOM
,
SecurityConstants.AUTHORIZATION_MECHANISM_JAAS
void setSecurityEnabled()
Security on the ObjectGrid level refers to ObjectGrid authorizations.
Note, to avoid an IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.initialize()
boolean isSecurityEnabled()
Security on the ObjectGrid level refers to ObjectGrid authorizations. Security is disabled by default.
setSecurityEnabled()
void setPermissionCheckPeriod(int period)
This method takes a single parameter indicating how often the customer wants to check the permission used to allow a client access. If the parameter is 0 then every single authorized operation call will ask the authorization mechanism, either JAAS authorization or custom authorization to check if the current Subject has permission. This approach may be prohibitively expensive from a performance point of view depending on the authorization implementation, but if it is required then you can do it. Alternatively, if the parameter is > 0 then it indicates the number of seconds to cache a set of permissions before returning to the authorization mechanism to refresh them. This mechanism provides much better performance, but you run the risk that if the back-end permissions are changed during this time, the ObjectGrid will possibly allow or prevent access even though the back-end security provider has been modified.
Note, to avoid an IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
period
- the permission check period in seconds.
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.initialize()
void setSubjectSource(SubjectSource source)
SubjectSource
plugin.
Passing null
to this method removes a previously set
SubjectSource
object from an earlier invocation of this method
and indicates that this ObjectGrid
is not associated with a
SubjectSource
object.
A SubjectSource
plugin can be used to get a Subject
object from the environment to represent the ObjectGrid client.
This method should only be used when ObjectGrid security is enabled. If
the ObjectGrid security is disabled, the provided SubjectSource
object
will not be used.
Note, to avoid an IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
source
- the SubjectSource plugin
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.initialize()
,
SubjectSource
void setTxTimeout(int timeout)
Any transaction that is started by use of a Session returned by one of
the
Note, to avoid an
The transaction timeout is used by any transaction started by a Session
that is returned by the getSession methods of this interface. Since this
method must be called prior to getSession method to avoid IllegalStateException,
this method only affects transactions that are started after this method is called.
If this method is never called, the transaction is allowed unlimited amount of
time to complete.
getSession
methods on this interface must complete
within the number of seconds specified by the transaction timeout
parameter of this method. The timeout value is the maximum number of
seconds the transaction is allowed to execute. If a transaction
executes longer than this amount, a
TransactionTimeoutException
is thrown and the transaction is rolled back even if commit is requested.
IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
timeout
- is the transaction timeout value in seconds. Use a value of 0
to indicate a transaction is allowed unlimited amount
of time so that no TransactionTimeoutException ever occurs.
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.initialize()
,
Session.TRANSACTION_NO_TIMEOUT
,
Session.setTransactionTimeout(int)
,
TransactionTimeoutException
int getTxTimeout()
setTxTimeout(int)
method or 0
if setTxTimeout was never called.setTxTimeout(int)
void setTxIsolation(int level)
Session.TRANSACTION_REPEATABLE_READ
.
level
- one of the following Session constants:
Session.TRANSACTION_READ_UNCOMMITTED
, Session.TRANSACTION_READ_COMMITTED
or
Session.TRANSACTION_REPEATABLE_READ
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.
java.lang.IllegalArgumentException
- if this method is includes and invalid transaction isolation level.int getTxIsolation()
setTxIsolation(int)
void destroy()
This method should be invoked when the ObjectGrid is no longer being
used. When this method is called, the ObjectGrid can free up any
resources it is using. No new Sessions can be created or used after
the destroy()
has been invoked. Any in-flight Sessions
will be allowed to continue, if the resources are still available to
complete processing.
Session getSession(CredentialGenerator credGen) throws ObjectGridException, TransactionCallbackException
CredentialGenerator
.
This method can only be called by the ObjectGrid client in an ObjectGrid
client server environment. If ObjectGrid is used in a local model, that is,
within the same JVM with no client or server existing, getSession(Subject)
or the SubjectSource
plugin should be used to secure the ObjectGrid.
If the initialize()
method has not been invoked prior to
the first getSession
invocation, an implicit initialization
will occur. This ensures that all of the configuration is complete
before any runtime usage is required.
credGen
- A CredentialGenerator
for generating a credential
for the session returned.
Session
ObjectGridException
- if an error occurs during processing
TransactionCallbackException
- if the TransactionCallback
throws an exception
java.lang.IllegalStateException
- if this method is called after the
destroy()
method is called.destroy()
,
initialize()
,
CredentialGenerator
,
Session
void setQueryConfig(QueryConfig queryConfig)
queryConfig
- The QueryConfig to associate with this ObjectGrid instance.
java.lang.IllegalArgumentException
- if queryConfig is null
.
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.QueryConfig
void registerEntities(java.net.URL entityXML)
Entity registration is required prior to ObjectGrid initialization to bind an Entity with a BackingMap and any defined indices.
This method may be called multiple times.
entityXML
- the URL of the entity XML that defines the entities.
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.void registerEntities(java.lang.Class[] entities)
Entity registration is required prior to ObjectGrid initialization to bind an Entity with a BackingMap and any defined indices.
This method may be called multiple times.
entities
- one or more annotated entity classes to register as entities.
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.int getObjectGridType()
The return value is equivalent to one of the constants declared on this interface,
LOCAL
, SERVER
, or CLIENT
.
void setObjectGridAuthorization(ObjectGridAuthorization ogAuthorization)
ObjectGridAuthorization
for this ObjectGrid instance.
Passing null
to this method removes a previously set
ObjectGridAuthorization
object from an earlier invocation of this method
and indicates that this ObjectGrid
is not associated with a
ObjectGridAuthorization
object.
This method should only be used when ObjectGrid security is enabled. If
the ObjectGrid security is disabled, the provided ObjectGridAuthorization
object
will not be used.
A ObjectGridAuthorization
plugin can be used to authorize
access to the ObjectGrid and maps. Please refer to ObjectGridAuthorization
for more details.
As of XD 6.1, the setMapAuthorization
is deprecated and
setObjectGridAuthorization
is recommended for use. However,
if both MapAuthorization
plugin and ObjectGridAuthorization
plugin
are used, ObjectGrid will use the provided MapAuthorization
to authorize map accesses,
even though it is deprecated.
Note, to avoid an IllegalStateException
, this method must be
called prior to the initialize()
method. Also, keep in mind
that the getSession
methods implicitly call the
initialize()
method if it has yet to be called by the
application.
ogAuthorization
- the ObjectGridAuthorization
plugin
java.lang.IllegalStateException
- if this method is called after the
initialize()
method is called.initialize()
,
ObjectGridAuthorization
void setAccessByCreatorOnlyMode(int accessByCreatorOnlyMode)
Enabling "access by creator only" mode ensures that only the user (represented by the Principals associated with it), who inserts the record into the map, can access (read, update, invalidate, and remove) the record.
The "access by creator only" mode can be disabled, or can complement the
ObjectGrid authorization model, or it can supersede the ObjectGrid
authorization model. The default value is disabled:
SecurityConstants.ACCESS_BY_CREATOR_ONLY_DISABLED
.
accessByCreatorOnlyMode
- the access by creator mode.SecurityConstants.ACCESS_BY_CREATOR_ONLY_DISABLED
,
SecurityConstants.ACCESS_BY_CREATOR_ONLY_COMPLEMENT
,
SecurityConstants.ACCESS_BY_CREATOR_ONLY_SUPERSEDE
ObjectGridLifecycleListener.State getState()
|
IBM WebSphere® DataPower® XC10 Appliance Release 2.0 Client API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |