UNPKG

hazelcast-client

Version:

Hazelcast - open source In-Memory Data Grid - client for NodeJS

44 lines (43 loc) 1.67 kB
/// <reference types="node" /> /// <reference types="bluebird" /> import * as Promise from 'bluebird'; import { EventEmitter } from 'events'; import HazelcastClient from '../HazelcastClient'; import { ClientConnection } from './ClientConnection'; import Address = require('../Address'); /** * Maintains connections between the client and members of the cluster. */ export declare class ClientConnectionManager extends EventEmitter { private client; private pendingConnections; private logger; establishedConnections: { [address: string]: ClientConnection; }; constructor(client: HazelcastClient); getActiveConnections(): { [address: string]: ClientConnection; }; /** * Returns the {@link ClientConnection} with given {@link Address}. If there is no such connection established, * it first connects to the address and then return the {@link ClientConnection}. * @param address * @param ownerConnection Sets the connected node as owner of this client if true. * @returns {Promise<ClientConnection>|Promise<T>} */ getOrConnect(address: Address, ownerConnection?: boolean): Promise<ClientConnection>; private triggerConnect(address); private connectTLSSocket(address, configOpts); private connectNetSocket(address); private initiateCommunication(connection); /** * Destroys the connection with given node address. * @param address */ destroyConnection(address: Address): void; shutdown(): void; private onConnectionClosed(connection); private onConnectionOpened(connection); private authenticate(connection, ownerConnection); }