Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MultiMap<K, V>

Type parameters

  • K

  • V

Hierarchy

Implemented by

Index

Methods

addEntryListener

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

    Parameters

    • listener: EntryListener<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<string>

    registration ID for this entry listener

clear

  • clear(): Promise<void>

containsEntry

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

    • key: K

      key to match against.

    • value: V

      value to match against.

    Returns Promise<boolean>

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

containsKey

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

    Parameters

    • key: K

      key to search for.

    Returns Promise<boolean>

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

containsValue

  • containsValue(value: V): Promise<boolean>
  • Parameters

    • value: V

      value to search for.

    Returns Promise<boolean>

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

destroy

  • destroy(): Promise<void>

entrySet

  • entrySet(): Promise<Array<[K, V]>>
  • 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<Array<[K, V]>>

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

forceUnlock

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

get

  • Retrieves a list of values associated with the specified key.

    Parameters

    • key: K

      key to search for.

    Returns Promise<ReadOnlyLazyList<V>>

    a list of values associated with the specified key.

getName

  • getName(): string

getPartitionKey

  • getPartitionKey(): string

getServiceName

  • getServiceName(): string

isLocked

  • isLocked(key: K): Promise<boolean>
  • Parameters

    • key: K

      key to be checked

    Returns Promise<boolean>

    true if this key is locked, false otherwise

keySet

  • keySet(): Promise<K[]>

lock

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

put

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

    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<boolean>
  • 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<boolean>

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

removeAll

  • Detaches all values from the specified key.

    Parameters

    • key: K

      key from which all entries should be removed.

    Returns Promise<ReadOnlyLazyList<V>>

    a list of old values that were associated with this key prior to this method call.

removeEntryListener

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

    Parameters

    • listenerId: string

      registration ID that was returned when this listener was added.

    Returns Promise<boolean>

size

  • size(): Promise<number>

tryLock

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

unlock

  • unlock(key: K): Promise<void>
  • Unlocks the specified key

    Parameters

    • key: K

      key to be unlocked

    Returns Promise<void>

valueCount

  • valueCount(key: K): Promise<number>
  • Parameters

    • key: K

      key to search for.

    Returns Promise<number>

    the number of values associated with the specified key.

values

Generated using TypeDoc