export = ClusterNode; declare class ClusterNode { config: { enabled: boolean; activityDepth: number; heartbeat: number; interface: any; ipv6: boolean; ip: string; joinTimeout: number; minimumNodes: number; ports: { command: number; sync: number; }; syncTimeout: number; }; logger: import("../kuzzle/Logger").Logger; heartbeatDelay: number; ip: string; nodeId: string; heartbeatTimer: NodeJS.Timeout; idCardHandler: ClusterIdCardHandler; publisher: ClusterPublisher; fullState: any; command: ClusterCommand; eventEmitter: any; /** * Links remote node IDs with their subscriber counterpart * @type {Map.} */ remoteNodes: Map; /** * Cluster nodes activity, used to keep track of nodes being added or * removed, to give more insights to cluster statuses */ activityMaxLength: number; activity: any[]; get syncAddress(): string; init(): Promise; /** * Shutdown event: clears all timers, sends a termination status to other * nodes, and removes entries from the cache */ shutdown(): Promise; /** * Notify other nodes to not evict this node * * @param {bool} evictionPrevented */ preventEviction(evictionPrevented: bool): void; /** * Adds a new remote node, and subscribes to it. * @param {string} id - remote node ID * @param {string} ip - remote node IP address * @param {number} lastMessageId - remote node last message ID * @return {boolean} false if the node was already known, true otherwise */ addNode(id: string, ip: string, lastMessageId: number): boolean; /** * Evicts this node from the cluster. * * @param {String} reason * @param {Error} [error] * @return {void} */ evictSelf(reason: string, error?: Error): void; /** * Evicts a remote from the list * @param {string} nodeId - remote node ID * @param {Object} [options] * @param {boolean} [options.broadcast] - broadcast the eviction to the cluster * @param {string} [options.reason] - reason of eviction */ evictNode(nodeId: string, { broadcast, reason }?: { broadcast?: boolean; reason?: string; }): Promise; /** * Verifies the consistency of the cluster by comparing our own known * topology with the one kept in other nodes ID cards * * /!\ Do not wait for this method: it's meant to run as a background check. * It'll never throw, and it'll never generate unhandled rejections. */ enforceClusterConsistency(): Promise; /** * Discovers other active nodes from the cluster and, if other nodes exist, * starts a handshake procedure to sync this node and to make it able to * handle new client requests * * @return {void} */ handshake(): void; countActiveNodes(): number; startHeartbeat(): void; /** * Cluster activity tracking * * @param {string} id * @param {string} ip * @param {nodeActivityEnum} event * @param {string} [reason] */ trackActivity(id: string, ip: string, event: any, reason?: string): void; /** * Returns the full status of the cluster * @return {Object} */ getStatus(): any; /** * Registers ask events */ registerAskEvents(): void; /** * Starts listening to events to trigger sync messages on state changes. * * @return {void} */ registerEvents(): void; /** * Triggered whenever a realtime room is created on this node * * @param {NormalizedFilter} payload * @return {void} */ onNewRealtimeRoom(payload: NormalizedFilter): void; /** * Triggered on a new realtime subscription * * @param {string} roomId * @return {void} */ onNewSubscription(roomId: string): void; /** * Triggered when a realtime room is removed from this node. * * @param {string} roomId * @return {void} */ removeRealtimeRoom(roomId: string): void; /** * Broadcasts an event to other nodes * * @param {string} event name * @param {Object} payload - event payload */ broadcast(event: string, payload: any): void; /** * Triggered when a user unsubscribes from a room * * @param {string} roomId * @return {void} */ onUnsubscription(roomId: string): void; /** * Triggered when a document notification must be propagated * * @param {Array.} rooms - list of rooms to notify * @param {DocumentNotification} notification * @return {void} */ onDocumentNotification(rooms: Array, notification: DocumentNotification): void; /** * Triggered when a user notification must be propagated * * @param {string} room * @param {UserNotification} notification * @return {void} */ onUserNotification(room: string, notification: UserNotification): void; /** * Triggered when a new authentication strategy has been dynamically added * * @param {string} strategyName * @param {string} pluginName * @param {Object} strategyObject * @return {void} */ onAuthStrategyAdded(strategyName: string, pluginName: string, strategyObject: any): void; /** * Triggered when an authentication strategy has been dynamically removed * * @param {string} strategyName * @param {string} pluginName * @return {void} */ onAuthStrategyRemoved(strategyName: string, pluginName: string): void; /** * Triggered when a dump has been requested * * @param {string} suffix * @return {void} */ onDumpRequest(suffix: string): void; /** * Triggered when security rights have been reset * * @return {void} */ onSecurityReset(): void; /** * Triggered when a document validator has changed * * @return {void} */ onValidatorsChanged(): void; /** * Triggered when a profile has changed * * @param {string} profileId * @return {void} */ onProfileChanged(profileId: string): void; /** * Triggered when a role has changed * * @param {string} roleId * @return {void} */ onRoleChanged(roleId: string): void; /** * Triggered when an index has been added to the index cache * * @param {storeScopeEnum} scope * @param {string} index * @return {void} */ onIndexAdded(scope: storeScopeEnum, index: string): void; /** * Triggered when a collection has been added to the index cache * * @param {storeScopeEnum} scope * @param {string} index * @param {string} collection * @return {void} */ onCollectionAdded(scope: storeScopeEnum, index: string, collection: string): void; /** * Triggered when index have been removed from the index cache * * @param {storeScopeEnum} scope * @param {Array.} indexes * @return {void} */ onIndexesRemoved(scope: storeScopeEnum, indexes: Array): void; /** * Triggered when a collection has been removed from the index cache * * @param {storeScopeEnum} scope * @param {string} index * @param {string} collection * @return {void} */ onCollectionRemoved(scope: storeScopeEnum, index: string, collection: string): void; /** * Triggered when a cluster-wide shutdown has been initiated * * @return {void} */ onShutdown(): void; /** * Triggered when the index cache has been manually refreshed */ onIndexCacheRefreshed(): void; /** * Returns the total number of subscribers on the cluster for the provided * room * * @param {string} roomId * @return {void} */ countRealtimeSubscribers(roomId: string): void; } import { ClusterIdCardHandler } from "./idCardHandler"; import ClusterPublisher = require("./publisher"); import ClusterCommand = require("./command"); import ClusterSubscriber = require("./subscriber");