Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HazelcastClient

Hazelcast client instance. When you want to use Hazelcast's distributed data structures, you must first create a client instance. Multiple instances can be created on a single Node.js process.

Client instances should be shut down explicitly.

Hierarchy

  • HazelcastClient

Index

Methods

addDistributedObjectListener

  • Registers a distributed object listener to cluster.

    Parameters

    Returns Promise<string>

    registration id of the listener.

getCPSubsystem

  • Returns the CP subsystem that offers a set of in-memory linearizable data structures.

    Returns CPSubsystem

getCluster

  • Returns the Cluster to which this client is connected.

    Returns Cluster

getConfig

  • Returns configuration that this instance started with. The returned object should not be modified.

    Returns ClientConfig

getDistributedObjects

  • Gives all known distributed objects in cluster.

    Returns Promise<DistributedObject[]>

getFlakeIdGenerator

  • Returns the distributed Flake ID Generator instance with given name.

    Parameters

    • name: string

    Returns Promise<FlakeIdGenerator>

getLifecycleService

  • Returns the lifecycle service for this client.

    Returns LifecycleService

getList

  • getList<E>(name: string): Promise<IList<E>>
  • Returns the distributed List instance with given name.

    Type parameters

    • E

    Parameters

    • name: string

    Returns Promise<IList<E>>

getLocalEndpoint

  • Gathers information of this local client.

    Returns ClientInfo

getMap

  • getMap<K, V>(name: string): Promise<IMap<K, V>>
  • Returns the distributed Map instance with given name.

    Type parameters

    • K

    • V

    Parameters

    • name: string

    Returns Promise<IMap<K, V>>

getMultiMap

  • getMultiMap<K, V>(name: string): Promise<MultiMap<K, V>>
  • Returns the distributed MultiMap instance with given name.

    Type parameters

    • K

    • V

    Parameters

    • name: string

    Returns Promise<MultiMap<K, V>>

getName

  • getName(): string
  • Returns the name of this Hazelcast instance.

    Returns string

getPNCounter

  • getPNCounter(name: string): Promise<PNCounter>
  • Returns the distributed PN Counter instance with given name.

    Parameters

    • name: string

    Returns Promise<PNCounter>

getPartitionService

  • Returns the partition service of this client.

    Returns PartitionService

getQueue

  • getQueue<E>(name: string): Promise<IQueue<E>>
  • Returns the distributed Queue instance with given name.

    Type parameters

    • E

    Parameters

    • name: string

    Returns Promise<IQueue<E>>

getReliableTopic

  • getReliableTopic<E>(name: string): Promise<ITopic<E>>
  • Returns a distributed Reliable Topic instance with the given name.

    Type parameters

    • E

    Parameters

    • name: string

    Returns Promise<ITopic<E>>

getReplicatedMap

  • getReplicatedMap<K, V>(name: string): Promise<ReplicatedMap<K, V>>
  • Returns the distributed Replicated Map instance with given name.

    Type parameters

    • K

    • V

    Parameters

    • name: string

    Returns Promise<ReplicatedMap<K, V>>

getRingbuffer

  • getRingbuffer<E>(name: string): Promise<Ringbuffer<E>>
  • Returns a distributed Ringbuffer instance with the given name.

    Type parameters

    • E

    Parameters

    • name: string

    Returns Promise<Ringbuffer<E>>

getSet

  • getSet<E>(name: string): Promise<ISet<E>>
  • Returns the distributed Set instance with given name.

    Type parameters

    • E

    Parameters

    • name: string

    Returns Promise<ISet<E>>

removeDistributedObjectListener

  • removeDistributedObjectListener(listenerId: string): Promise<boolean>
  • Removes a distributed object listener from cluster.

    Parameters

    • listenerId: string

      id of the listener to be removed.

    Returns Promise<boolean>

    true if registration was removed, false otherwise.

shutdown

  • shutdown(): Promise<void>
  • Shuts down this client instance.

    Returns Promise<void>

Static newHazelcastClient

  • Creates a new client object and automatically connects to cluster.

    Parameters

    • Optional config: ClientConfig

      Client config. Default client config is used when this parameter is absent.

    Returns Promise<HazelcastClient>

    a new client instance

Static newHazelcastFailoverClient

  • Creates a client with cluster switch capability. Client will try to connect to alternative clusters according to failover configuration when it disconnects from a cluster.

    throws

    InvalidConfigurationError if the provided failover configuration is not valid

    Parameters

    Returns Promise<HazelcastClient>

    a new client instance

Generated using TypeDoc