Adds an entry listener to this multi-map.
entry listener to be attached
if specified then this entry listener will only be notified of updates related to this key.
if true
, then the event will include the modified value.
registration ID for this entry listener
Removes all entries from this multi-map.
key to match against.
value to match against.
true
if this multi-map has an association between
the specified key and the specified value, false
otherwise.
Checks if this multi-map contains a specified key.
key to search for.
true
if this map contains the specified key, false
otherwise.
value to search for.
true
if the specified value is associated with at least one key in this multi-map,
false
otherwise.
Destroys this object cluster-wide. Clears all resources taken for this object.
Returns all entries in this multi-map. If a certain key has multiple values associated with it, then one pair will be returned for each value.
an array of all key value pairs stored in this multi-map.
Forcefully unlocks the specified key, disregarding the acquisition count.
This in contrast to the regular unlock
, which has to be called the same amount of times as
the lock was acquired.
key to be unlocked.
Retrieves a list of values associated with the specified key.
key to search for.
a list of values associated with the specified key.
Returns the unique name of this object.
Returns the key of the partition that this DistributedObject is assigned to.
For a partitioned data structure, the returned value will not be null
,
but otherwise undefined
.
Returns the service name for this object.
key to be checked
true
if this key is locked, false
otherwise
an array of all keys in this multi-map.
Locks the specified key. If the specified key cannot be locked immediately, then the returned Promise will be resolved only when the lock becomes available. All attempts to access the locked key will block until the lock is released.
Locking is reentrant, meaning that the lock owner client can obtain the lock multiple times.
If the lock was acquired multiple times, then unlock()
method must be called the same amount of
times, otherwise the lock will remain unavailable.
If lease time is specified, then the lock will automatically become available
after the specified time has passed.
If lease time is not specified or is less than zero,
then lock owner must call unlock
to make the lock available.
key to be locked.
lease time in milliseconds.
Adds a key-value pair to this multi-map. If this multi-map already has some value associated with the specified key, then calling this method will not replace the old value. Instead, both values will be associated with the same key.
key to add.
value to associate with the key.
true
if this multi-map did not have the specified value associated
with the specified key, false
otherwise.
Stores the given key, value array pairs in the MultiMap.
The behaviour of this operation is undefined if the specified pairs are modified while this operation is in progress.
No atomicity guarantees are given. It could be that in case of failure some of the key/value-pairs get written, while others are not.
key-value array pairs
Removes an association of the specified value with the specified key. Calling this method does not affect other values associated with the same key.
key from which the value should be detached.
value to be removed.
true
if the value was detached from the specified key, false
if it was not.
Detaches all values from the specified key.
key from which all entries should be removed.
a list of old values that were associated with this key prior to this method call.
Removes the entry listener by the registration ID.
registration ID that was returned when this listener was added.
the total number of values in this multi-map.
Attempts to acquire the lock for the specified key within the specified timeout. The returned promise will be returned either when the lock becomes available or when the timeout is reached.
If the specified key cannot be locked immediately, then the returned Promise will be resolved only when the lock becomes available. All attempts to access the locked key will block until the lock is released.
Locking is reentrant, meaning that the lock owner client can obtain the lock multiple times.
If the lock was acquired multiple times, then unlock()
method must be called the same amount of
times, otherwise the lock will remain unavailable.
If lease time is specified, then the lock will automatically become available
after the specified time has passed.
If lease time is not specified or is less than zero,
then lock owner must call unlock
to make the lock available.
key to be locked
timeout for locking, in milliseconds
lease time in milliseconds
Unlocks the specified key
key to be unlocked
key to search for.
the number of values associated with the specified key.
a flat list of all values stored in this multi-map.
Generated using TypeDoc
A specialized map whose keys can be associated with multiple values.
Methods that require serialization/deserialization may throw RangeError, e.g when there is no suitable serializer for a certain type.