import { ServerNode } from "./ServerNode"; import { RavenCommand } from "./RavenCommand"; import { Topology } from "./Topology"; import { NodeSelector } from "./NodeSelector"; import { IDisposable } from "../Types/Contracts"; import { IRequestAuthOptions, IAuthOptions } from "../Auth/AuthOptions"; import { ICertificate } from "../Auth/Certificate"; import { ReadBalanceBehavior } from "./ReadBalanceBehavior"; import { HttpCache } from "./HttpCache"; import { AggressiveCacheOptions } from "./AggressiveCacheOptions"; import CurrentIndexAndNode from "./CurrentIndexAndNode"; import { HttpRequestParameters, HttpRequestParametersWithoutUri } from "../Primitives/Http"; import { DocumentConventions } from "../Documents/Conventions/DocumentConventions"; import { SessionInfo } from "../Documents/Session/IDocumentSession"; import { PromiseStatusTracker } from "../Utility/PromiseUtil"; export interface ExecuteOptions { chosenNode: ServerNode; nodeIndex: number; shouldRetry: boolean; } export interface ITopologyUpdateEvent { topologyJson: object; serverNodeUrl: string; requestedDatabase?: string; forceUpdate?: boolean; wasUpdated?: boolean; } export interface IRequestExecutorOptions { authOptions?: IRequestAuthOptions; documentConventions?: DocumentConventions; } export declare class NodeStatus implements IDisposable { private _nodeStatusCallback; private _timerPeriodInMs; readonly nodeIndex: number; readonly node: ServerNode; private _timer; constructor(nodeIndex: number, node: ServerNode, nodeStatusCallback: (nodeStatus: NodeStatus) => Promise); private _nextTimerPeriod; startTimer(): void; updateTimer(): void; dispose(): void; } export declare class RequestExecutor implements IDisposable { private _log; static readonly CLIENT_VERSION = "4.1.0"; private _updateDatabaseTopologySemaphore; private _updateClientConfigurationSemaphore; private static _failureCheckOperation; private _failedNodesTimers; protected _databaseName: string; protected _certificate: ICertificate; private _lastReturnedResponse; protected _readBalanceBehavior: ReadBalanceBehavior; private readonly _cache; private _topologyTakenFromNode; aggressiveCaching: AggressiveCacheOptions; private _updateTopologyTimer; protected _nodeSelector: NodeSelector; numberOfServerRequests: number; protected _disposed: boolean; private _firstTopologyUpdatePromiseInternal; protected _firstTopologyUpdatePromise: Promise; protected _firstTopologyUpdateStatus: PromiseStatusTracker; protected _lastKnownUrls: string[]; protected _clientConfigurationEtag: number; protected _topologyEtag: number; private readonly _conventions; private readonly _authOptions; protected _disableTopologyUpdates: boolean; protected _disableClientConfigurationUpdates: boolean; protected _customHttpRequestOptions: HttpRequestParametersWithoutUri; protected _defaultRequestOptions: HttpRequestParametersWithoutUri; static requestPostProcessor: (req: HttpRequestParameters) => void; customHttpRequestOptions: HttpRequestParametersWithoutUri; getAuthOptions(): IAuthOptions; getTopologyEtag(): number; readonly conventions: DocumentConventions; getClientConfigurationEtag(): number; readonly cache: HttpCache; readonly disposed: boolean; getUrl(): string; getTopology(): Topology; getTopologyNodes(): ServerNode[]; protected constructor(database: string, authOptions: IRequestAuthOptions, conventions: DocumentConventions); static create(initialUrls: string[], database: string): RequestExecutor; static create(initialUrls: string[], database: string, opts?: IRequestExecutorOptions): RequestExecutor; static createForSingleNodeWithConfigurationUpdates(url: string, database: string, opts: IRequestExecutorOptions): RequestExecutor; static createForSingleNodeWithoutConfigurationUpdates(url: string, database: string, opts: IRequestExecutorOptions): RequestExecutor; private _ensureNodeSelector; getPreferredNode(): Promise; getNodeBySessionId(sessionId: number): Promise; getFastestNode(): Promise; private _updateClientConfigurationInternal; protected _updateClientConfiguration(): Promise; updateTopology(node: ServerNode, timeout: number, forceUpdate?: boolean): Promise; protected static _validateUrls(initialUrls: string[], authOptions: IAuthOptions): any[]; private _initializeUpdateTopologyTimer; private _updateTopologyCallback; protected _firstTopologyUpdate(inputUrls: string[]): Promise; protected _throwExceptions(details: string): void; protected _disposeAllFailedNodesTimers(): void; chooseNodeForRequest(cmd: RavenCommand, sessionInfo: SessionInfo): CurrentIndexAndNode; execute(command: RavenCommand): Promise; execute(command: RavenCommand, sessionInfo?: SessionInfo): Promise; execute(command: RavenCommand, sessionInfo?: SessionInfo, options?: ExecuteOptions): Promise; private _unlikelyExecute; private _getFromCache; private _executeOnSpecificNode; private _throwFailedToContactAllNodes; inSpeedTestPhase(): boolean; private _handleUnsuccessfulResponse; private _executeOnAllToFigureOutTheFastest; private _shouldExecuteOnAll; private _nodeSelectorHasMultipleNodes; private _handleServerDown; private static _addFailedResponseToCommand; private _createRequest; private static _handleConflict; private _spawnHealthChecks; private _checkNodeStatusCallback; protected _performHealthCheck(serverNode: ServerNode, nodeIndex: number): Promise; private _setDefaultRequestOptions; dispose(): void; }