com.hazelcast.multimap.impl.txn
Class TransactionalMultiMapProxy<K,V>

java.lang.Object
  extended by com.hazelcast.spi.AbstractDistributedObject<MultiMapService>
      extended by com.hazelcast.multimap.impl.txn.TransactionalMultiMapProxySupport
          extended by com.hazelcast.multimap.impl.txn.TransactionalMultiMapProxy<K,V>
All Implemented Interfaces:
BaseMultiMap<K,V>, DistributedObject, TransactionalMultiMap<K,V>, TransactionalObject

public class TransactionalMultiMapProxy<K,V>
extends TransactionalMultiMapProxySupport
implements TransactionalMultiMap<K,V>


Field Summary
 
Fields inherited from class com.hazelcast.multimap.impl.txn.TransactionalMultiMapProxySupport
config, name, tx
 
Fields inherited from class com.hazelcast.spi.AbstractDistributedObject
PARTITIONING_STRATEGY
 
Constructor Summary
TransactionalMultiMapProxy(NodeEngine nodeEngine, MultiMapService service, String name, TransactionSupport tx)
           
 
Method Summary
 Collection<V> get(K key)
          Returns the collection of values associated with the key.
 String getName()
          Returns the unique name for this DistributedObject.
 boolean put(K key, V value)
          Stores a key-value pair in the multimap.
 Collection<V> remove(Object key)
          Removes all the entries associated with the given key.
 boolean remove(Object key, Object value)
          Removes the given key value pair from the multimap.
 String toString()
           
 int valueCount(K key)
          Returns the number of values matching the given key in the multimap.
 
Methods inherited from class com.hazelcast.multimap.impl.txn.TransactionalMultiMapProxySupport
checkTransactionState, getInternal, getServiceName, putInternal, removeAllInternal, removeInternal, size, valueCountInternal
 
Methods inherited from class com.hazelcast.spi.AbstractDistributedObject
destroy, equals, getId, getNameAsPartitionAwareData, getNodeEngine, getPartitionKey, getService, hashCode, invalidate, postDestroy, throwNotActiveException
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hazelcast.core.TransactionalMultiMap
size
 
Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getId, getPartitionKey, getServiceName
 

Constructor Detail

TransactionalMultiMapProxy

public TransactionalMultiMapProxy(NodeEngine nodeEngine,
                                  MultiMapService service,
                                  String name,
                                  TransactionSupport tx)
Method Detail

getName

public String getName()
Description copied from interface: DistributedObject
Returns the unique name for this DistributedObject. The returned value will never be null.

Specified by:
getName in interface DistributedObject
Returns:
the unique name for this object.

put

public boolean put(K key,
                   V value)
            throws TransactionException
Description copied from interface: TransactionalMultiMap
Stores a key-value pair in the multimap.

Specified by:
put in interface BaseMultiMap<K,V>
Specified by:
put in interface TransactionalMultiMap<K,V>
Parameters:
key - the key to be stored
value - the value to be stored
Returns:
true if the size of the multimap is increased, false if the multimap already contains the key-value pair.
Throws:
TransactionException

get

public Collection<V> get(K key)
Description copied from interface: TransactionalMultiMap
Returns the collection of values associated with the key.

Specified by:
get in interface BaseMultiMap<K,V>
Specified by:
get in interface TransactionalMultiMap<K,V>
Parameters:
key - the key whose associated values are returned
Returns:
the collection of the values associated with the key

remove

public boolean remove(Object key,
                      Object value)
Description copied from interface: TransactionalMultiMap
Removes the given key value pair from the multimap.

Specified by:
remove in interface BaseMultiMap<K,V>
Specified by:
remove in interface TransactionalMultiMap<K,V>
Parameters:
key - the key of the entry to remove
value - the value of the entry to remove
Returns:
true if the size of the multimap changed after the remove operation, false otherwise.

remove

public Collection<V> remove(Object key)
Description copied from interface: TransactionalMultiMap
Removes all the entries associated with the given key.

Specified by:
remove in interface BaseMultiMap<K,V>
Specified by:
remove in interface TransactionalMultiMap<K,V>
Parameters:
key - the key of the entries to remove
Returns:
the collection of removed values associated with the given key. The returned collection might be modifiable but it has no effect on the multimap.

valueCount

public int valueCount(K key)
Description copied from interface: TransactionalMultiMap
Returns the number of values matching the given key in the multimap.

Specified by:
valueCount in interface BaseMultiMap<K,V>
Specified by:
valueCount in interface TransactionalMultiMap<K,V>
Parameters:
key - the key whose number of values is to be returned
Returns:
the number of values matching the given key in the multimap

toString

public String toString()
Overrides:
toString in class AbstractDistributedObject<MultiMapService>


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.