IBM WebSphere® DataPower® XC10 Appliance
Release 2.0 Client API Specification

com.ibm.websphere.objectgrid
Interface JavaMap

All Superinterfaces:
java.util.Map

public interface JavaMap
extends java.util.Map

This interface is a handle to a named Map. Maps should have homogeneous keys and values. An instance of this JavaMap can only be used by the thread that is currently associated with the Session that was used to get this JavaMap instance. Both Session and JavaMap objects are not allowed to be shared by multiple threads concurrently. Keywords are applied within a transaction. A transaction rollback will rollback any keyword associations applied during this transaction. The keyword function is deprecated in version 6.1 and later.

Users can get an instance of JavaMap from an instance of ObjectMap by calling ObjectMap.getJavaMap(). There are two main differences between JavaMap and ObjectMap:

The only methods that are supported from the java.util.Map interface are:

All other methods on the java.util.Map interface will throw java.lang.UnsupportedOperationException.

Since:
WAS XD 6.0, XC10
See Also:
ObjectMap, ObjectMap.getJavaMap(), Map, BackingMap.setCopyMode(CopyMode, Class), BackingMap.setLockStrategy(LockStrategy)

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
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.
 boolean containsValue(java.lang.Object value)
          This method of the java.util.Map interface is not supported.
 java.util.Set entrySet()
          This method of the java.util.Map interface is not supported.
 void flush()
          Pushes the current set of changes for the JavaMap 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
 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
 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.String getName()
          Returns the name of the JavaMap 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
 boolean isEmpty()
          This method of the java.util.Map interface is not supported.
 java.util.Set keySet()
          This method of the java.util.Map interface is not supported.
 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 values into the cache at location represented by the corresponding 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
 int setTimeToLive(int ttl)
          Establishes the number of seconds that any given cache entry can live for, which is refered to as "time to live" or TTL.
 int size()
          This method of the java.util.Map interface is not supported.
 void touch(java.lang.Object key)
          Updates the last access time in the BackingMap without retrieving the value to the JavaMap.
 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
 java.util.Collection values()
          This method of the java.util.Map interface is not supported.
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

getName

java.lang.String getName()
Returns the name of the JavaMap as defined by the configuration.

Returns:
name of JavaMap

get

java.lang.Object get(java.lang.Object key,
                     java.io.Serializable keyword)
                     throws ObjectGridRuntimeException
Deprecated. Use Index or query function to get Objects with specific attributes

Gets an entry and associates it with the specified keyword.

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.

Parameters:
key - The entry to fetch
keyword - The keyword to associate with this entry if it exists.
Returns:
the value or null
Throws:
java.lang.IllegalArgumentException - if key or keyword is null
ObjectGridRuntimeException - if an error occurs during processing
See Also:
containsKey(Object), get(Object), CopyMode, ObjectMap.get(Object, Serializable)

getForUpdate

java.lang.Object getForUpdate(java.lang.Object key)
                              throws ObjectGridRuntimeException
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. 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.

Parameters:
key - The entry to fetch
Returns:
the value retrieved for update or null
Throws:
java.lang.IllegalArgumentException - if key is null
ObjectGridRuntimeException - if an error occurs during processing
See Also:
containsKey(Object), get(Object), CopyMode, LockStrategy.PESSIMISTIC, ObjectMap.getForUpdate(Object)

getForUpdate

java.lang.Object getForUpdate(java.lang.Object key,
                              java.io.Serializable keyword)
                              throws ObjectGridRuntimeException
Deprecated. Use Index or query function to get Objects with specific attributes

The same as getForUpdate(Object) except the returned entry is associated with the specified keyword.

Parameters:
key - The entry to fetch
keyword - The keyword to associate with the returned entry
Returns:
the value retrieved for update purposes or null
Throws:
java.lang.IllegalArgumentException - if key or keyword is null
ObjectGridRuntimeException - if an error occurs during processing
See Also:
getForUpdate(Object), get(Object, Serializable), ObjectMap.getForUpdate(Object, Serializable)

put

void put(java.lang.Object key,
         java.lang.Object value,
         java.io.Serializable keyword)
         throws ObjectGridRuntimeException
Deprecated. Use Index or query function to get Objects with specific attributes

Puts an entry in the cache and associates it with the specified keyword.

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.

Parameters:
key - The key of the entry to update or insert
value - The new value
keyword - The keyword
Throws:
java.lang.IllegalArgumentException - if key or keyword is null, or if the map does not allow null values and value is null
ObjectGridRuntimeException - if an error occurs during processing
See Also:
put(Object, Object), CopyMode, ObjectMap.put(Object, Object, Serializable)

getAll

java.util.List getAll(java.util.List keyList)
                      throws ObjectGridRuntimeException
Gets a list of entries from the map.

If a key in the list cannot be found, a null value will be set at the appropriate position in the returned list.

Parameters:
keyList - A list of keys for identifying which entries to fetch
Returns:
a list of values
Throws:
java.lang.IllegalArgumentException - if keyList is null or contains a null element.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
get(Object), ObjectMap.getAll(List)

getAll

java.util.List getAll(java.util.List keyList,
                      java.io.Serializable keyword)
                      throws ObjectGridRuntimeException
Deprecated. Use Index or query function to get Objects with specific attributes

Gets a list of entries from the map and associates them with the specified keyword.

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.

Parameters:
keyList - A list of keys for identifying which entries to fetch
keyword - the keyword to associate with each fetched entry
Returns:
a list of values
Throws:
java.lang.IllegalArgumentException - if keyList is null or contains a null element or keyword is null.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
get(Object, Serializable), getAll(List), ObjectMap.getAll(List, Serializable)

getAllForUpdate

java.util.List getAllForUpdate(java.util.List keyList)
                               throws ObjectGridRuntimeException
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. 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.

Parameters:
keyList - A list of keys for identifying which entries to fetch
Returns:
a list of values
Throws:
java.lang.IllegalArgumentException - if keyList is null or contains a null element.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
getAll(List), getForUpdate(Object), LockStrategy.PESSIMISTIC, ObjectMap.getAllForUpdate(List)

getAllForUpdate

java.util.List getAllForUpdate(java.util.List keyList,
                               java.io.Serializable keyword)
                               throws ObjectGridRuntimeException
Deprecated. Use Index or query function to get Objects with specific attributes

The same as the getAllForUpdate(List) method except the returned entries are associated with the specified keyword.

Parameters:
keyList - A list of keys for identifying which entries to fetch
keyword - the keyword to associate with each fetched entry
Returns:
the list of values
Throws:
java.lang.IllegalArgumentException - if keyList is null or contains a null element or keyword is null.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
getAllForUpdate(List), getForUpdate(Object), ObjectMap.getAllForUpdate(List, Serializable)

removeAll

void removeAll(java.util.Collection keyList)
               throws ObjectGridRuntimeException
Batch remove from the Map. If a key in the list cannot be found, it will be ignored.

Parameters:
keyList - A list of keys for identifying which entries to remove
Throws:
java.lang.IllegalArgumentException - if keyList is null or contains a null element.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
remove(Object), ObjectMap.removeAll(Collection)

putAll

void putAll(java.util.Map map,
            java.io.Serializable keyword)
            throws ObjectGridRuntimeException
Deprecated. Use Index or query function to get Objects with specific attributes

Batch put to the Map, with the addition of associating a keyword with each entry.

Parameters:
map - The key/values to be put into the map.
keyword - The keyword to associate with all these entries.
Throws:
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.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
putAll(Map), ObjectMap.putAll(Map, Serializable)

invalidate

void invalidate(java.lang.Object key,
                boolean isGlobal)
                throws ObjectGridRuntimeException
Invalidates an entry in the cache based on the key parameter.

If the key's value has changes pending in the JavaMap, 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 JavaMap. 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 JavaMap (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.

Parameters:
key - Object representing the key to be used for cache entry invalidation
isGlobal - Indicates whether to remove the entry from the BackingMap (true) or just the JavaMap (false).
Throws:
java.lang.IllegalArgumentException - if key is null
ObjectGridRuntimeException - if an error occurs during processing
See Also:
ObjectMap.invalidate(Object, boolean)

invalidateAll

void invalidateAll(java.util.Collection keyList,
                   boolean isGlobal)
                   throws ObjectGridRuntimeException
Invalidate a set of cache entries based on the Collection of keys provided. If a key in the collection cannot be found, it will be ignored.

Parameters:
keyList - A Collection of keys representing the entries to be invalidated
isGlobal - Indicates whether to remove the entry from the BackingMap (true) or just the JavaMap (false).
Throws:
java.lang.IllegalArgumentException - if keyList is null or contains a null element.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
invalidate(Object, boolean), ObjectMap.invalidateAll(Collection, boolean)

invalidateUsingKeyword

void invalidateUsingKeyword(java.io.Serializable keyword,
                            boolean isGlobal)
                            throws ObjectGridRuntimeException
Deprecated. Use Index or query function to get Objects with specific attributes

Invalidates a set of cache entries based on the keyword provided.

Parameters:
keyword - The keyword to be used for finding associated entries
isGlobal - Indicates whether to remove the entry from the BackingMap (true) or just the JavaMap (false).
Throws:
java.lang.IllegalArgumentException - if keyword is null.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
ObjectMap.invalidateUsingKeyword(Serializable, boolean)

setTimeToLive

int setTimeToLive(int ttl)
Establishes the number of seconds that any given cache entry can live for, which is refered to as "time to live" or TTL. Setting a new TTL value affects cache entries that are accessed after this method call occurs. It does not affect any cache entry that was created or accessed prior to this method call. By calling this method on this JavaMap, any previous value set by the BackingMap.setTimeToLive(int) method is overridden for this JavaMap. If this method is never called on the JavaMap, the TTL value from the BackingMap setting is used by default. 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 on the BackingMap. If this method is called on the JavaMap and the TTLType is something other than LAST_ACCESS_TIME, an IllegalStateException is thrown.

Parameters:
ttl - is the time-to-live value in seconds. The value must be >= 0. A value of 0 is used to indicate the cache entry can live "forever". Use of the constant ObjectMap.TTL_FOREVER is recommended when "forever" is desired.
Returns:
previous time-to-live value in seconds. The constant ObjectMap.TTL_FOREVER can be used to determine if the previous TTL was set to "forever".
Throws:
java.lang.IllegalArgumentException - if seconds argument is < 0.
java.lang.IllegalStateException - if BackingMap.getTtlEvictorType() returns anything other than TTLType.LAST_ACCESS_TIME.
See Also:
BackingMap.setTimeToLive(int), ObjectMap.setTimeToLive(int), TTLType.LAST_ACCESS_TIME

update

void update(java.lang.Object key,
            java.lang.Object value)
            throws ObjectGridRuntimeException
Performs an explicit update of a given entry.

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.

Parameters:
key - Identifies the entry to be updated
value - The updated value for this entry
Throws:
java.lang.IllegalArgumentException - if key is null or if the map does not allow null values and value is null.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
insert(Object, Object), put(Object, Object), CopyMode, LockStrategy.OPTIMISTIC, ObjectMap.update(Object, Object)

update

void update(java.lang.Object key,
            java.lang.Object value,
            java.io.Serializable keyword)
            throws ObjectGridRuntimeException
Deprecated. Use Index or query function to get Objects with specific attributes

Performs an explicit update of a given entry, also associating the given keyword with the entry.

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.

Parameters:
key - Identifies the entry to be updated
value - The updated value for this entry
keyword - The keyword to associate with this entry.
Throws:
java.lang.IllegalArgumentException - if key or keyword is null or if the map does not allow null values and value is null.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
update(Object, Object), CopyMode, LockStrategy.OPTIMISTIC, ObjectMap.update(Object, Object, Serializable)

insert

void insert(java.lang.Object key,
            java.lang.Object value)
            throws ObjectGridRuntimeException
Performs an explicit insert of a given entry.

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.

Parameters:
key - Identifies the entry to be inserted
value - The value for this entry
Throws:
java.lang.IllegalArgumentException - if key is null or if the map does not allow null values and value is null.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
put(Object, Object), update(Object, Object), CopyMode, ObjectMap.insert(Object, Object)

insert

void insert(java.lang.Object key,
            java.lang.Object value,
            java.io.Serializable keyword)
            throws ObjectGridRuntimeException
Deprecated. Use Index or query function to get Objects with specific attributes

Performs an explicit insert of a given entry, also associating the given keyword with the entry.

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.

Parameters:
key - Identifies the entry to be inserted
value - The value for this entry
keyword - The keyword to associate with the entry.
Throws:
java.lang.IllegalArgumentException - if key or keyword is null or if the map does not allow null values and value is null.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
insert(Object, Object), CopyMode, ObjectMap.insert(Object, Object, Serializable)

getIndex

java.lang.Object getIndex(java.lang.String name)
                          throws IndexUndefinedException,
                                 IndexNotReadyException,
                                 java.lang.UnsupportedOperationException
Returns a reference to the named index that can be used with this Map. This index cannot be shared between threads and works on the same rules as 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.

Parameters:
name - The index name
Returns:
A reference to the index, it must be cast to the appropriate index interface.
Throws:
IndexUndefinedException - if the index is not defined on the BackingMap
IndexNotReadyException - if the index is a dynamic index and it is not ready
java.lang.UnsupportedOperationException - if the map is a distributed map
Since:
WAS XD 6.0.1

flush

void flush()
           throws ObjectGridRuntimeException
Pushes the current set of changes for the JavaMap 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.

Throws:
ObjectGridRuntimeException - if an error occurs during processing
See Also:
Session.flush(), ObjectMap.flush()

size

int size()
This method of the java.util.Map interface is not supported.

Specified by:
size in interface java.util.Map
Returns:
the number of key-value mappings in this map.
Throws:
java.lang.UnsupportedOperationException - indicating this method is not supported

isEmpty

boolean isEmpty()
This method of the java.util.Map interface is not supported.

Specified by:
isEmpty in interface java.util.Map
Returns:
true if this map contains no key-value mappings.
Throws:
java.lang.UnsupportedOperationException - indicating this method is not supported

containsKey

boolean containsKey(java.lang.Object key)
Returns 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.

Specified by:
containsKey in interface java.util.Map
Parameters:
key - key whose presence in this map is to be tested.
Returns:
true if this map contains a mapping for the specified key.
Throws:
java.lang.IllegalArgumentException - if null key parameter is passed in
ObjectGridRuntimeException - if an error occurs during processing
See Also:
ObjectMap.containsKey(Object)

containsValue

boolean containsValue(java.lang.Object value)
This method of the java.util.Map interface is not supported.

Specified by:
containsValue in interface java.util.Map
Parameters:
value - value whose presence in this map is to be tested.
Returns:
true if this map maps one or more keys to the specified value.
Throws:
java.lang.UnsupportedOperationException - indicating this method is not supported

get

java.lang.Object get(java.lang.Object key)
Retrieves the object from the cache at the given key.

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.

Specified by:
get in interface java.util.Map
Parameters:
key - The entry to fetch
Returns:
the value or null
Throws:
java.lang.IllegalArgumentException - if key is null
ObjectGridRuntimeException - if an error occurs during processing
See Also:
containsKey(Object), getForUpdate(Object), CopyMode, ObjectMap.get(Object)

put

java.lang.Object put(java.lang.Object key,
                     java.lang.Object value)
Puts the Object value into the cache at location represented by key.

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.

Specified by:
put in interface java.util.Map
Parameters:
key - The entry to put into the map
value - The value to put into the map using the key
Returns:
the previous value in this transaction
Throws:
java.lang.IllegalArgumentException - if key is null, or if the map does not allow null values and value is null
ObjectGridRuntimeException - if an error occurs during processing
See Also:
CopyMode, ObjectMap.put(Object, Object)

remove

java.lang.Object remove(java.lang.Object key)
Removes the Object value from the cache represented by key.

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.

Specified by:
remove in interface java.util.Map
Parameters:
key - The entry to remove
Returns:
the current value at invocation time
Throws:
java.lang.IllegalArgumentException - if key is null
ObjectGridRuntimeException - if an error occurs during processing
See Also:
ObjectMap.remove(Object)

putAll

void putAll(java.util.Map map)
Puts each of the Object values into the cache at location represented by the corresponding key contained in the Map.

The values 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 objects contained in the map 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.

Specified by:
putAll in interface java.util.Map
Parameters:
map - The key/values to be put into the map.
Throws:
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.
ObjectGridRuntimeException - if an error occurs during processing
See Also:
put(Object, Object), ObjectMap.putAll(Map)

clear

void clear()
Clear all keys from the Map.

This method is an auto-commit call, so a session should not be explicitly begun or committed when calling clear on the Map.

Specified by:
clear in interface java.util.Map
Throws:
ObjectGridRuntimeException - if an error occurs during processing
Since:
WAS XD 6.1.0.3

keySet

java.util.Set keySet()
This method of the java.util.Map interface is not supported.

Specified by:
keySet in interface java.util.Map
Returns:
a set view of the keys contained in this map.
Throws:
java.lang.UnsupportedOperationException - indicating this method is not supported

values

java.util.Collection values()
This method of the java.util.Map interface is not supported.

Specified by:
values in interface java.util.Map
Returns:
a collection view of the values contained in this map.
Throws:
java.lang.UnsupportedOperationException - indicating this method is not supported

entrySet

java.util.Set entrySet()
This method of the java.util.Map interface is not supported.

Specified by:
entrySet in interface java.util.Map
Returns:
a set view of the mappings contained in this map.
Throws:
java.lang.UnsupportedOperationException - indicating this method is not supported

touch

void touch(java.lang.Object key)
Updates the last access time in the BackingMap without retrieving the value to the JavaMap.

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.

Parameters:
key - key to be touched
Throws:
java.lang.IllegalArgumentException - if key is null
ObjectGridRuntimeException - if an error occurs during processing
See Also:
ObjectMap.touch(Object)

touch

void touch(java.lang.Object key,
           java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes

Updates the last access time in the BackingMap without retrieving the value to the JavaMap and also associate a keyword with this entry.

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.

Parameters:
key - key to be touched
keyword - keyword to add to this entry
Throws:
java.lang.IllegalArgumentException - if key or keyword is null
ObjectGridRuntimeException - if an error occurs during processing
See Also:
touch(Object), ObjectMap.touch(Object, Serializable)

setCopyMode

void setCopyMode(CopyMode copyMode,
                 java.lang.Class valueInterface)
                 throws ObjectGridRuntimeException
Allows the CopyMode for the Map to be overridden on this map on this session only.

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.

Parameters:
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.
Throws:
java.lang.IllegalArgumentException - if copyMode is null or COPY_ON_WRITE CopyMode is specified and the required value interface parameter is null
ObjectGridRuntimeException - if a transaction is active on the associated session or an error occurs during processing
See Also:
BackingMap.setCopyMode(CopyMode, Class), CopyMode, ObjectMap.setCopyMode(CopyMode, Class)

clearCopyMode

void clearCopyMode()
                   throws ObjectGridRuntimeException
Resets the CopyMode back to the one in the BackingMap.

This method is used to reverse a previous setCopyMode method call for this JavaMap. This method can only be called when no transaction is active on the associated session.

Throws:
ObjectGridRuntimeException - if a transaction is active on the associated session
See Also:
setCopyMode(CopyMode, Class), ObjectMap.clearCopyMode()

setDefaultKeyword

void setDefaultKeyword(java.io.Serializable keyword)
Deprecated. Use Index or query function to get Objects with specific attributes

Allows the setting of a default 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.

Parameters:
keyword - default keyword value to use
See Also:
ObjectMap.setDefaultKeyword(Serializable)

getNextKey

java.lang.Object getNextKey(long timeout)
Retrieves a key off the map in first-in-first-out (FIFO) insert order. 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.

Parameters:
timeout - The period of time to wait for an entry to become available on the queue.
Returns:
The next available key in the map.
See Also:
ObjectMap.getNextKey(long)

getEntityMetadata

EntityMetadata getEntityMetadata()
Retrieve the metadata for the entity associated with this map.

Returns:
the EntityMetadata if an entity is associated with this map or null if there is no entity associated with this map.
Since:
WAS XD 6.1

IBM WebSphere® DataPower® XC10 Appliance
Release 2.0 Client API Specification

© Copyright International Business Machines Corp 2005,2011. All rights reserved.