Options
All
  • Public
  • Public/Protected
  • All
Menu

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

  • addDistributedObjectListener(listener: DistributedObjectListener): Promise<string>
  • Registers a distributed object listener to cluster.

    Parameters

    • listener: DistributedObjectListener

      distributed object listener function.

    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

  • getCluster(): Cluster
  • Returns the Cluster to which this client is connected.

    Returns Cluster

getConfig

  • getConfig(): ClientConfig
  • Returns configuration that this instance started with. The returned object should not be modified.

    Returns ClientConfig

getDistributedObjects

  • getDistributedObjects(): Promise<DistributedObject[]>
  • Gives all known distributed objects in the 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

  • getLocalEndpoint(): ClientInfo
  • 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

  • getPartitionService(): PartitionService
  • 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>>

getSql

  • Returns a service to execute distributed SQL queries. The service is in beta state. Behavior and API might be changed in future releases.

    Returns SqlService

    SQL service

    see SqlService

removeDistributedObjectListener

  • removeDistributedObjectListener(listenerId: string): Promise<boolean>
  • Removes a distributed object listener from the 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

  • newHazelcastFailoverClient(failoverConfig?: ClientFailoverConfig): Promise<HazelcastClient>
  • 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

    • Optional failoverConfig: ClientFailoverConfig

      Configuration object describing the failover client configs and try count

    Returns Promise<HazelcastClient>

    a new client instance

Generated using TypeDoc