Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MultiMap<K, V>

Type parameters

  • K

  • V

Hierarchy

Implemented by

Index

Methods

addEntryListener

  • addEntryListener(listener: IMapListener<K, V>, key?: K, includeValue?: boolean): Promise
  • Adds an entry listener to this multi-map.

    Parameters

    • listener: IMapListener<K, V>

      entry listener to be attached

    • Optional key: K

      if specified then this entry listener will only be notified of updates related to this key.

    • Optional includeValue: boolean

      if true, then the event will include the modified value.

    Returns Promise

    registration ID for this entry listener

clear

  • clear(): Promise

containsEntry

  • containsEntry(key: K, value: V): Promise
  • Parameters

    • key: K

      key to match against.

    • value: V

      value to match against.

    Returns Promise

    true if this multi-map has an association between the specified key and the specified value, false otherwise.

containsKey

  • containsKey(key: K): Promise
  • Checks if this multi-map contains a specified key.

    Parameters

    • key: K

      key to search for.

    Returns Promise

    true if this map contains the specified key, false otherwise.

containsValue

  • containsValue(value: V): Promise
  • Parameters

    • value: V

      value to search for.

    Returns Promise

    true if the specified value is associated with at least one key in this multi-map, false otherwise.

destroy

  • destroy(): Promise

entrySet

  • entrySet(): Promise
  • 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.

    Returns Promise

    an array of all key value pairs stored in this multi-map.

forceUnlock

  • forceUnlock(key: K): Promise
  • 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.

    Parameters

    • key: K

      key to be unlocked.

    Returns Promise

get

  • get(key: K): Promise
  • Retrieves a list of values associated with the specified key.

    Parameters

    • key: K

      key to search for.

    Returns Promise

    array of values associated with the specified key.

getName

  • getName(): string

getPartitionKey

  • getPartitionKey(): string
  • 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 string

getServiceName

  • getServiceName(): string

isLocked

  • isLocked(key: K): Promise
  • Parameters

    • key: K

      key to be checked

    Returns Promise

    true if this key is locked, false otherwise

keySet

  • keySet(): Promise

lock

  • lock(key: K, leaseMillis?: number): Promise
  • 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 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.

    Parameters

    • key: K

      key to be locked.

    • Optional leaseMillis: number

      lease time in milliseconds.

    Returns Promise

put

  • put(key: K, value: V): Promise
  • 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.

    Parameters

    • key: K

      key to add.

    • value: V

      value to associate with the key.

    Returns Promise

    true if this multi-map did not have the specified value associated with the specified key, false otherwise.

remove

  • remove(key: K, value: V): Promise
  • Removes an association of the specified value with the specified key. Calling this method does not affect other values associated with the same key.

    Parameters

    • key: K

      key from which the value should be detached.

    • value: V

      value to be removed.

    Returns Promise

    true if the value was detached from the specified key, false if it was not.

removeAll

  • removeAll(key: K): Promise
  • Detaches all values from the specified key.

    Parameters

    • key: K

      key from which all entries should be removed.

    Returns Promise

    an array of old values that were associated with this key prior to this method call.

removeEntryListener

  • removeEntryListener(listenerId: string): Promise
  • Removes the entry listener by the registration ID.

    Parameters

    • listenerId: string

      registration ID that was returned when this listener was added.

    Returns Promise

size

  • size(): Promise

tryLock

  • tryLock(key: K, timeoutMillis?: number, leaseMillis?: number): Promise
  • 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 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.

    Parameters

    • key: K

      key to be locked

    • Optional timeoutMillis: number

      timeout for locking, in milliseconds

    • Optional leaseMillis: number

      lease time in milliseconds

    Returns Promise

unlock

  • unlock(key: K): Promise
  • Unlocks the specified key

    Parameters

    • key: K

      key to be unlocked

    Returns Promise

valueCount

  • valueCount(key: K): Promise
  • Parameters

    • key: K

      key to search for.

    Returns Promise

    the number of values associated with the specified key.

values

  • values(): Promise
  • Returns Promise

    a flat array of all values stored in this multi-map.

Generated using TypeDoc