|
IBM WebSphere® DataPower® XC10 Appliance Release 1.0 Client API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ObjectMap
This is a handle to a named Map. Maps should have homogeneous keys and values. An instance of this ObjectMap can only be used by the thread that is currently associated with the Session that was used to get this ObjectMap instance. Both Session and ObjectMap objects are not allowed to be shared by multiple threads concurrently. Keywords are applied within a transaction. A transaction rollback will rollback any keywords association applied during this transaction. The keyword function is deprecated in version 6.1 and later.
The CopyMode
setting on the map determines whether or not a copy of the value is returned by get
methods. It also determines whether or not a copy of the committed value is made at commit time. The
LockStrategy
setting for the map determines whether or not a lock is obtained for each map entry
accessed by the transaction, the lock mode of the lock obtained, and when the lock is obtained.
Session.getMap(String)
,
BackingMap.setCopyMode(CopyMode, Class)
,
BackingMap.setLockStrategy(LockStrategy)
Field Summary | |
---|---|
static long |
QUEUE_TIMEOUT_INFINITE
Used as a parameter on the getNextKey(long) method, specifies the method should block until a key
becomes available. |
static long |
QUEUE_TIMEOUT_NONE
Used as a parameter on the getNextKey(long) method, specifies to return a null value if the map is
empty. |
static int |
TTL_FOREVER
A constant indicating the time-to-live value is "forever". |
static int |
USE_DEFAULT
A constant indicating the time-to-live value or lock timeout value is the default setting. |
Method Summary | |
---|---|
void |
clear()
Clear all keys from the Map. |
void |
clearCopyMode()
Resets the CopyMode back to the one in the BackingMap. |
boolean |
containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key. |
void |
flush()
Pushes the current set of changes for the ObjectMap instance to the Loader without
committing the changes. |
java.lang.Object |
get(java.lang.Object key)
Retrieves the object from the cache at the given key. |
java.lang.Object |
get(java.lang.Object key,
java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes |
com.ibm.websphere.objectgrid.datagrid.AgentManager |
getAgentManager()
Returns the Agent Manager that allows DataGrid operations to be performed on the objects within this Map. |
java.util.List |
getAll(java.util.List keyList)
Gets a list of entries from the map. |
java.util.List |
getAll(java.util.List keyList,
java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes |
java.util.List |
getAllForUpdate(java.util.List keyList)
Same as the getAll(List) method except that if pessimistic lock strategy is used for this map, an
upgradable lock mode is obtained for these map entries. |
java.util.List |
getAllForUpdate(java.util.List keyList,
java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes |
com.ibm.websphere.projector.md.EntityMetadata |
getEntityMetadata()
Retrieve the metadata for the entity associated with this map. |
java.lang.Object |
getForUpdate(java.lang.Object key)
Same as get(Object) method except that if pessimistic lock strategy is used for this map, an
upgradable lock mode is obtained for this map entry. |
java.lang.Object |
getForUpdate(java.lang.Object key,
java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes |
java.lang.Object |
getIndex(java.lang.String name)
Returns a reference to the named index that can be used with this Map. |
java.lang.Object |
getIndex(java.lang.String name,
boolean forUpdate)
Returns a reference to the named index that can be used with this Map. |
java.util.Map |
getJavaMap()
Returns an implementation of java.util.Map that is backed by this ObjectMap . |
int |
getMapType()
Returns the type of the underlying BackingMap. |
java.lang.String |
getName()
Returns the name of the ObjectMap as defined by the configuration. |
java.lang.Object |
getNextKey(long timeout)
Retrieves a key off the map in first-in-first-out (FIFO) insert order. |
void |
insert(java.lang.Object key,
java.lang.Object value)
Performs an explicit insert of a given entry. |
void |
insert(java.lang.Object key,
java.lang.Object value,
java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes |
void |
invalidate(java.lang.Object key,
boolean isGlobal)
Invalidates an entry in the cache based on the key parameter. |
void |
invalidateAll(java.util.Collection keyList,
boolean isGlobal)
Invalidate a set of cache entries based on the Collection of keys provided. |
void |
invalidateUsingKeyword(java.io.Serializable keyword,
boolean isGlobal)
Deprecated. Use Index or query function to get Objects with specific attributes |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts the Object value into the cache at location represented by key. |
void |
put(java.lang.Object key,
java.lang.Object value,
java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes |
void |
putAll(java.util.Map map)
Puts each of the Object value into the cache at location represented by key contained in the Map. |
void |
putAll(java.util.Map map,
java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes |
java.lang.Object |
remove(java.lang.Object key)
Removes the Object value from the cache represented by key. |
void |
removeAll(java.util.Collection keyList)
Batch remove from the Map. |
void |
setCopyMode(CopyMode copyMode,
java.lang.Class valueInterface)
Allows the CopyMode for the Map to be overridden on this map on this session only. |
void |
setDefaultKeyword(java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes |
void |
setLockTimeout(int seconds)
Overrides the BackingMap's lock timeout for this ObjectMap. |
int |
setTimeToLive(int ttl)
Establishes the number of seconds that any given cache entry can live for, which is referred to as "time to live" or TTL. |
void |
touch(java.lang.Object key)
Updates the last access time in the BackingMap without retrieving the value to the ObjectMap. |
void |
touch(java.lang.Object key,
java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes |
void |
update(java.lang.Object key,
java.lang.Object value)
Performs an explicit update of a given entry. |
void |
update(java.lang.Object key,
java.lang.Object value,
java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes |
Field Detail |
---|
static final int TTL_FOREVER
static final int USE_DEFAULT
The default setting is to retain the time-to-live value for any existing map entry and to use the default value from BackingMap setting if a new map entry is being created.
For lock timeout override the default setting is to use the value defined on the BackingMap
setLockTimeout(int)
,
setTimeToLive(int)
,
BackingMap.setTimeToLive(int)
,
BackingMap.getTimeToLive()
,
BackingMap.setLockTimeout(int)
,
Constant Field Valuesstatic final long QUEUE_TIMEOUT_NONE
getNextKey(long)
method, specifies to return a null value if the map is
empty.
static final long QUEUE_TIMEOUT_INFINITE
getNextKey(long)
method, specifies the method should block until a key
becomes available.
Method Detail |
---|
java.lang.String getName()
java.lang.Object get(java.lang.Object key) throws ObjectGridException
Whether or not a copy of the object is returned is determined by the CopyMode setting for this map. See
CopyMode
for a description of each possible CopyMode. If the key cannot be found in the map, a
null
value will be returned. A null
value is also returned if a value is
null
and this map allows null
values. To distinguish the two, use the
containsKey
method.
key
- The entry to fetch
null
java.lang.IllegalArgumentException
- if key is null
ObjectGridException
- if an error occurs during processingcontainsKey(Object)
,
getForUpdate(Object)
,
CopyMode
java.lang.Object get(java.lang.Object key, java.io.Serializable keyword) throws ObjectGridException
The keyword is associated only when the transaction commits. Whether or not a copy of the object is returned is
determined by the CopyMode
setting for this map. See CopyMode
for a description of
each possible CopyMode. If the key cannot be found in the map, a null
value will be returned. A
null
value is also returned if a value is null
and this map allows
null
values. To distinguish the two, use the containsKey
method.
key
- The entry to fetchkeyword
- The keyword to associate with this entry if it exists.
null
java.lang.IllegalArgumentException
- if key or keyword is null
ObjectGridException
- if an error occurs during processingcontainsKey(Object)
,
get(Object)
,
CopyMode
java.lang.Object put(java.lang.Object key, java.lang.Object value) throws ObjectGridException
The value will be pushed down to the BackingMap/Loader at commit time. The semantics of this method are that a put without a preceding get is an insert. For an entry in a map, a put following a get is always an update. However, if the entry is not in the map, a put following a get is an insert.
Whether or not a copy of the object is made when transaction is committed is determined by the copy mode setting
for this map. See CopyMode
for a description of each possible copy mode.
key
- The entry to put into the mapvalue
- The value to put into the map using the key
java.lang.IllegalArgumentException
- if key is null
, or if the map does not allow null
values and value is
null
ObjectGridException
- if an error occurs during processingCopyMode
java.lang.Object getForUpdate(java.lang.Object key) throws ObjectGridException
get(Object)
method except that if pessimistic lock strategy is used for this map, an
upgradable lock mode is obtained for this map entry. See LockStrategy.PESSIMISTIC
for additional
information. Whether or not a copy of the object is returned is determined by the CopyMode
setting
for this map. See CopyMode
for a description of each possible CopyMode. If the key cannot be found
in the map, a null
value will be returned. A null
value is also returned if the
value is null
and this map allows null
values. To distinguish the two, use the
containsKey
method.
key
- The entry to fetch
null
java.lang.IllegalArgumentException
- if key is null
ObjectGridException
- if an error occurs during processingcontainsKey(Object)
,
get(Object)
,
CopyMode
,
LockStrategy.PESSIMISTIC
java.lang.Object getForUpdate(java.lang.Object key, java.io.Serializable keyword) throws ObjectGridException
getForUpdate(Object)
except the returned entry is associated with the specified
keyword.
key
- The entry to fetchkeyword
- The keyword to associate with the returned entry
null
java.lang.IllegalArgumentException
- if key or keyword is null
ObjectGridException
- if an error occurs during processinggetForUpdate(Object)
,
get(Object, Serializable)
java.lang.Object remove(java.lang.Object key) throws ObjectGridException
This removal will be pushed down to the BackingMap/Loader at commit time. If the key cannot be found in the map, a null value will be returned.
key
- The entry to remove
java.lang.IllegalArgumentException
- if key is null
ObjectGridException
- if an error occurs during processingvoid put(java.lang.Object key, java.lang.Object value, java.io.Serializable keyword) throws ObjectGridException
The keyword is added to the current set of keywords for the entry. Whether or not a copy of the object is made
when the transaction is committed is determined by the CopyMode setting for this map. See CopyMode
for a description of each possible CopyMode.
key
- The key of the entry to update or insertvalue
- The new valuekeyword
- The keyword
java.lang.IllegalArgumentException
- if key or keyword is null
, or if the map does not allow null
values
and value is null
ObjectGridException
- if an error occurs during processingput(Object, Object)
,
CopyMode
java.util.List getAll(java.util.List keyList) throws ObjectGridException
If a key in the list cannot be found, a null
value will be set at the appropriate position in the
returned list.
keyList
- A list of keys for identifying which entries to fetch
java.lang.IllegalArgumentException
- if keyList is null or contains a null
element.
ObjectGridException
- if an error occurs during processingget(Object)
java.util.List getAll(java.util.List keyList, java.io.Serializable keyword) throws ObjectGridException
If a key in the list cannot be found, a null
value will be set at the appropriate position in the
returned list. All returned entries will also be associated with the specified keyword.
keyList
- A list of keys for identifying which entries to fetchkeyword
- the keyword to associate with each fetched entry
java.lang.IllegalArgumentException
- if keyList is null or contains a null
element or keyword is null
.
ObjectGridException
- if an error occurs during processingget(Object, Serializable)
,
getAll(List)
java.util.List getAllForUpdate(java.util.List keyList) throws ObjectGridException
getAll(List)
method except that if pessimistic lock strategy is used for this map, an
upgradable lock mode is obtained for these map entries. See LockStrategy.PESSIMISTIC
for
additional information. If a key in the list cannot be found, a null
value will be set at the
appropriate position in the returned list.
keyList
- A list of keys for identifying which entries to fetch
java.lang.IllegalArgumentException
- if keyList is null or contains a null
element.
ObjectGridException
- if an error occurs during processinggetAll(List)
,
getForUpdate(Object)
,
LockStrategy.PESSIMISTIC
java.util.List getAllForUpdate(java.util.List keyList, java.io.Serializable keyword) throws ObjectGridException
getAllForUpdate(List)
method except the returned entries are associated with the
specified keyword.
keyList
- A list of keys for identifying which entries to fetchkeyword
- the keyword to associate with each fetched entry
java.lang.IllegalArgumentException
- if keyList is null or contains a null
element or keyword is null
.
ObjectGridException
- if an error occurs during processinggetAll(List)
,
getForUpdate(Object)
void removeAll(java.util.Collection keyList) throws ObjectGridException
keyList
- A list of keys for identifying which entries to remove
java.lang.IllegalArgumentException
- if keyList is null or contains a null
element.
ObjectGridException
- if an error occurs during processingremove(Object)
void putAll(java.util.Map map) throws ObjectGridException
The value will be pushed down to the BackingMap/Loader at commit time. The semantics of this method are that a put without a preceding get is an insert. For an entry in a map, a put following a get is always an update. However, if the entry is not in the map, a put following a get is an insert.
Whether or not a copy of the object is made when transaction is committed is determined by the copy mode setting
for this map. See CopyMode
for a description of each possible copy mode.
An existing Map object will be passed in to use for obtaining the keys and values to be inserted or updated into the existing Map.
map
- The key/values to be put into the map.
java.lang.IllegalArgumentException
- if map is null
or contains a null
key or if null
values
are not allowed and map contains a null
value.
ObjectGridException
- if an error occurs during processingput(Object, Object)
void putAll(java.util.Map map, java.io.Serializable keyword) throws ObjectGridException
map
- The key/values to be put into the map.keyword
- The keyword to associate with all these entries.
java.lang.IllegalArgumentException
- if keyword is null
, or map is null
or contains a null
key or if null
values are not allowed and map contains a null
value.
ObjectGridException
- if an error occurs during processingputAll(Map)
void invalidate(java.lang.Object key, boolean isGlobal) throws ObjectGridException
If the key's value has changes pending in the ObjectMap, it is the application's responsibility to flush these changes to the Loader before invalidation. If a flush is not performed prior to invoking the invalidate operation, all pending changes for this key will be removed from the ObjectMap. If the key cannot be found in the map, it will be ignored.
The isGlobal parameter is used to indicate which cache level is used to invalidate the entries. If isGlobal is true, when the transaction is committed, the key is removed from the BackingMap also. If a subsequent get operation is performed, the BackingMap will be skipped and the Loader will be used to get the data. If isGlobal is false, the entry is only invalidated in the ObjectMap (transactional cache). If a subsequent get operation is performed, the BackingMap can be used; and, if it's not in the BackingMap, the Loader will be used to get the data.
A typical use of isGlobal being false is when a large number of records are touched in a transaction and the application wants to evict records that are no longer used in the cache.
key
- Object representing the key to be used for cache entry invalidationisGlobal
- Indicates whether to remove the entry from the BackingMap (true) or just the ObjectMap (false).
java.lang.IllegalArgumentException
- if key is null
ObjectGridException
- if an error occurs during processingvoid invalidateAll(java.util.Collection keyList, boolean isGlobal) throws ObjectGridException
keyList
- A Collection of keys representing the entries to be invalidatedisGlobal
- Indicates whether to remove the entry from the BackingMap (true) or just the ObjectMap (false).
java.lang.IllegalArgumentException
- if keyList is null or contains a null
element.
ObjectGridException
- if an error occurs during processinginvalidate(Object, boolean)
void invalidateUsingKeyword(java.io.Serializable keyword, boolean isGlobal) throws ObjectGridException
keyword
- The keyword to be used for finding associated entriesisGlobal
- Indicates whether to remove the entry from the BackingMap (true) or just the ObjectMap (false).
java.lang.IllegalArgumentException
- if keyword is null
.
ObjectGridException
- if an error occurs during processingint setTimeToLive(int ttl)
ObjectMap
, any previous value set by the BackingMap.setTimeToLive(int)
method is
overridden for this ObjectMap. If this method is never called on the ObjectMap, the default setting is used. The
default setting is to retain the time-to-live value for any existing map entry and to use the default value from
BackingMap setting if a new map entry is being created. If TTL is never set on the BackingMap, the cache entry
can live "forever".
This method can only be used when the TTLType
is set to LAST_ACCESS_TIME
or
LAST_UPDATE_TIME
on the BackingMap. If this method is called on the ObjectMap and the TTLType
is something other than LAST_ACCESS_TIME
or LAST_UPDATE_TIME
, an IllegalStateException is thrown.
ttl
- is the time-to-live value in seconds. The value must be >= -1. A value of 0
is used to indicate the cache entry can live "forever" and -1 to indicate to
use default setting. Use of the constant TTL_FOREVER
is recommended
when "forever" is desired and the constantUSE_DEFAULT
is recommended
when "use default" setting is desired.
TTL_FOREVER
and
constant USE_DEFAULT
can be used to determine if the previous
TTL is one of the special values.
java.lang.IllegalArgumentException
- if seconds argument is < -1.
java.lang.IllegalStateException
- if BackingMap.getTtlEvictorType()
returns anything other
than TTLType.LAST_ACCESS_TIME
or TTLType.LAST_UPDATE_TIME
.TTL_FOREVER
,
USE_DEFAULT
,
BackingMap.setTimeToLive(int)
,
TTLType.LAST_ACCESS_TIME
,
TTLType.LAST_UPDATE_TIME
void update(java.lang.Object key, java.lang.Object value) throws KeyNotFoundException, ObjectGridException
A get
operation is not required prior to invoking the update
method (unlike the
put
method). Also, an update
invocation will never insert a new record. If a the
map's LockStrategy
is LockStrategy.OPTIMISTIC
this method will implicitly get the
entry so as to have the version value of the object for when this method was invoked. Whether or not a copy of
the object is made when transaction is committed is determined by the CopyMode setting for this map. See
CopyMode
for a description of each possible CopyMode.
If a key cannot be found in the map during commit, a TransactionException will be thrown.
key
- Identifies the entry to be updatedvalue
- The updated value for this entry
java.lang.IllegalArgumentException
- if key is null
or if the map does not allow null
values and value is
null
.
KeyNotFoundException
- if the key cannot be found in the map
ObjectGridException
- if an error occurs during processinginsert(Object, Object)
,
put(Object, Object)
,
CopyMode
,
LockStrategy.OPTIMISTIC
void update(java.lang.Object key, java.lang.Object value, java.io.Serializable keyword) throws KeyNotFoundException, ObjectGridException
A get
operation is not required prior to invoking the update
method (unlike the
put
method). Also, an update
invocation will never insert a new record. If a the
map's LockStrategy
is LockStrategy.OPTIMISTIC
this method will implicitly get the
entry so as to have the version value of the object for when this method was invoked. Whether or not a copy of
the object is made when transaction is committed is determined by the CopyMode setting for this map. See
CopyMode
for a description of each possible CopyMode.
key
- Identifies the entry to be updatedvalue
- The updated value for this entrykeyword
- The keyword to associate with this entry.
java.lang.IllegalArgumentException
- if key or keyword is null
or if the map does not allow null
values and
value is null
.
KeyNotFoundException
- if the key cannot be found in the map
ObjectGridException
- if an error occurs during processingupdate(Object, Object)
,
CopyMode
,
LockStrategy.OPTIMISTIC
void insert(java.lang.Object key, java.lang.Object value) throws DuplicateKeyException, ObjectGridException
The key must not exist before executing this method. Also, an insert
invocation will never update
an existing record. Whether or not a copy of the object is made when a transaction is committed is determined by
the CopyMode setting for this map. See CopyMode
for a description of each possible CopyMode.
If the key is already in the map, a TransactionException will be thrown during commit.
key
- Identifies the entry to be insertedvalue
- The value for this entry
java.lang.IllegalArgumentException
- if key is null
or if the map does not allow null
values and value is
null
.
DuplicateKeyException
- if this entries already exists in the map
ObjectGridException
- if an error occurs during processingput(Object, Object)
,
update(Object, Object)
,
CopyMode
void insert(java.lang.Object key, java.lang.Object value, java.io.Serializable keyword) throws DuplicateKeyException, ObjectGridException
Whether or not a copy of the object is made when transaction is committed is determined by the copy mode setting
for this map. See CopyMode
for a description of each possible copy mode.
If the key is already in the map, a TransactionException will be thrown during commit.
key
- Identifies the entry to be insertedvalue
- The value for this entrykeyword
- The keyword to associate with the entry.
java.lang.IllegalArgumentException
- if key or keyword is null
or if the map does not allow null
values and
value is null
.
DuplicateKeyException
- if this entries already exists in the map
ObjectGridException
- if an error occurs during processinginsert(Object, Object)
,
CopyMode
java.lang.Object getIndex(java.lang.String name) throws com.ibm.websphere.objectgrid.IndexUndefinedException, com.ibm.websphere.objectgrid.IndexNotReadyException
Session
. The returned value should be cast to the right
index interface such as MapIndex
, MapRangeIndex
or a custom index interface such
as a geo spatial index.
name
- The index name
IndexUndefinedException
- if the index is not defined on the BackingMap
IndexNotReadyException
- if the index is a dynamic index and it is not readyjava.lang.Object getIndex(java.lang.String name, boolean forUpdate) throws com.ibm.websphere.objectgrid.IndexUndefinedException, com.ibm.websphere.objectgrid.IndexNotReadyException
Session
. The returned value should be cast to the right
index interface such as MapIndex
, MapRangeIndex
or a custom index interface such
as a geo spatial index.
name
- The index nameforUpdate
- if true, the returned index will always operate with forUpdate intent.
IndexUndefinedException
- if the index is not defined on the BackingMap
IndexNotReadyException
- if the index is a dynamic index and it is not readyvoid flush() throws ObjectGridException
ObjectMap
instance to the Loader
without
committing the changes. The changes are not propagated to the BackingMap
either. This is useful
for re-priming the Loader
's data without committing the current transaction and starting over.
ObjectGridException
- if an error occurs during processingSession.flush()
boolean containsKey(java.lang.Object key) throws ObjectGridException
true
if this map contains a mapping for the specified key. ObjectGrid does not support
null keys. If you configured the map to support null
values, this method can be used to determine
whether a key is contained in the map or not.
key
- key whose presence in this map is to be tested.
true
if this map contains a mapping for the specified key.
java.lang.IllegalArgumentException
- if null
key parameter is passed in
ObjectGridException
- if an error occurs during processingjava.util.Map getJavaMap()
java.util.Map
that is backed by this ObjectMap
.
The returned java.util.Map
implementation can be cast to
com.ibm.websphere.objectgrid.JavaMap
to be able to use the rest of the ObjectGrid programming
model, but with java.util.Map
's use of RuntimeException
s instead of checked
ObjectGridException
s.
java.util.Map
backed by this ObjectMap
Map
,
JavaMap
void touch(java.lang.Object key) throws ObjectGridException
The last access time is updated during commit. If the key does not exist in the BackingMap, a TransactionException will be returned during commit processing.
key
- key to be touched
java.lang.IllegalArgumentException
- if key is null
ObjectGridException
- if an error occurs during processingvoid touch(java.lang.Object key, java.io.Serializable keyword) throws ObjectGridException
The last access time is updated during commit. If the key does not exist in the BackingMap, a TransactionException will be returned during commit processing.
key
- key to be touchedkeyword
- keyword to add to this entry
java.lang.IllegalArgumentException
- if key or keyword is null
ObjectGridException
- if an error occurs during processingtouch(Object)
void setCopyMode(CopyMode copyMode, java.lang.Class valueInterface) throws TransactionAlreadyActiveException, ObjectGridException
This method allows an application to use an optimal CopyMode TRANSACTION by TRANSACTION as its needs dictate. The CopyMode cannot be changed during a transaction. There must be no active transaction when this method is called.
copyMode
- must be one of the final static variables defined in CopyMode
. See
CopyMode
class for an explanation of each mode and how the valueInterface is used for
CopyMode.COPY_ON_WRITE
.valueInterface
- the value interface Class object. Specify null in version 7.1 and later.
java.lang.IllegalArgumentException
- if copyMode is null
or COPY_ON_WRITE CopyMode is specified and the required value
interface parameter is null
TransactionAlreadyActiveException
- if a transaction is active on the associated session
ObjectGridException
- if an error occurs during processingBackingMap.setCopyMode(CopyMode, Class)
,
CopyMode
void clearCopyMode() throws TransactionAlreadyActiveException
This method is used to reverse a previous setCopyMode method call for this ObjectMap. This method can only be called when no transaction is active on the associated session.
TransactionAlreadyActiveException
- if a transaction is active on the associated sessionsetCopyMode(CopyMode, Class)
void setDefaultKeyword(java.io.Serializable keyword)
The default keyword is used for any subsequent gets, updates, puts, etc. method invocations that do not have a
keyword parameter. To reset the default keyword a parameter of null
should be passed to this
method. The default keyword is not used when any of the appropriate gets, updates, puts, etc. methods with a
keyword parameter is invoked.
keyword
- default keyword value to usejava.lang.Object getNextKey(long timeout) throws ObjectGridException
The entry is locked by the session such that other calls to getNextKey will not return the same key. The key can be used to remove or manipulate the value although leaving the entry will result in the key remaining at the beginning of the queue. This order is optimized for performance and is not guaranteed especially across partitions or in highly concurrent environments.
timeout
- The period of time in milliseconds to wait for an entry to become available on the queue.
ObjectGridException
- if an error occurs during processingQUEUE_TIMEOUT_INFINITE
,
QUEUE_TIMEOUT_NONE
com.ibm.websphere.projector.md.EntityMetadata getEntityMetadata()
int getMapType()
The return value is equivalent to one of the constants declared on the BackingMap interface,
BackingMap.LOCAL
, BackingMap.SERVER
, or BackingMap.CLIENT
.
com.ibm.websphere.objectgrid.datagrid.AgentManager getAgentManager()
This method should only be called on a client ObjectGrid. If called on a non client ObjectGrid an
IllegalStateException
will be thrown
java.lang.IllegalStateException
- if this method is invoked on a non client ObjectGridvoid setLockTimeout(int seconds)
Establishes the number of seconds that any given fetch (get, getForUpdate, find, findForUpdate) of a cache entry
will wait to get a lock. When the lock strategy is LockStrategy.NONE
, no lock manager is used by
this map. In this case, a call to this method does nothing.
seconds
- is the lock timeout in seconds. The value must be >= -1. A value of -1 is used to indicate to use
the default setting. Use of the constantUSE_DEFAULT
is recommended when "use default"
setting is desired. A value of 0 indicates that if a lock cannot be retrieved immediately to time out
without waiting for any period of time for the lock to be released and made available.
java.lang.IllegalArgumentException
- if seconds argument is less than -1 (USE_DEFAULT)USE_DEFAULT
,
BackingMap.setLockTimeout(int)
,
BackingMap.setLockStrategy(LockStrategy)
,
LockStrategy.OPTIMISTIC
,
LockStrategy.PESSIMISTIC
void clear() throws ObjectGridException
This method is an autocommit call, so a session should not be explicitly begun or committed when calling clear on the ObjectMap.
ObjectGridException
- if an error occurs during processing
TransactionAlreadyActiveException
- if a transaction is already started.
|
IBM WebSphere® DataPower® XC10 Appliance Release 1.0 Client API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |