/**
 * SIEM Connector Base
 *
 * Abstract base class and interface for SIEM connectors providing:
 * - Connection lifecycle management
 * - Retry logic with exponential backoff
 * - Health checks
 * - Common utilities
 *
 * @packageDocumentation
 * @module security/siem/connector
 */
import { createLogger } from '../../common/logger.js';
import type { SecurityEvent, SendResult, BaseConnectorConfig } from './types.js';
/**
 * Interface for SIEM connectors
 */
export interface SIEMConnector {
    /** Connector name */
    readonly name: string;
    /** Connector type */
    readonly type: string;
    /**
     * Connect to the SIEM system
     */
    connect(): Promise<void>;
    /**
     * Disconnect from the SIEM system
     */
    disconnect(): Promise<void>;
    /**
     * Send events to the SIEM system
     * @param events Events to send
     * @returns Send result
     */
    send(events: SecurityEvent[]): Promise<SendResult>;
    /**
     * Check if the connector is healthy
     * @returns True if healthy
     */
    healthCheck(): Promise<boolean>;
    /**
     * Check if currently connected
     */
    isConnected(): boolean;
}
/**
 * Abstract base class for SIEM connectors
 *
 * Provides common functionality:
 * - Retry logic with exponential backoff
 * - Connection state management
 * - Logging
 * - Error handling
 */
export declare abstract class BaseSIEMConnector implements SIEMConnector {
    readonly name: string;
    abstract readonly type: string;
    protected readonly timeout: number;
    protected readonly maxRetries: number;
    protected readonly retryDelayMs: number;
    protected readonly maxRetryDelayMs: number;
    protected readonly batchSize: number;
    protected connected: boolean;
    protected readonly logger: ReturnType<typeof createLogger>;
    constructor(config: BaseConnectorConfig);
    /**
     * Connect to the SIEM system
     */
    connect(): Promise<void>;
    /**
     * Disconnect from the SIEM system
     */
    disconnect(): Promise<void>;
    /**
     * Send events to the SIEM system with retry logic
     */
    send(events: SecurityEvent[]): Promise<SendResult>;
    /**
     * Health check with timeout
     */
    healthCheck(): Promise<boolean>;
    /**
     * Check if connected
     */
    isConnected(): boolean;
    /**
     * Connector-specific connect logic
     */
    protected abstract doConnect(): Promise<void>;
    /**
     * Connector-specific disconnect logic
     */
    protected abstract doDisconnect(): Promise<void>;
    /**
     * Connector-specific send logic
     */
    protected abstract doSend(events: SecurityEvent[]): Promise<SendResult>;
    /**
     * Connector-specific health check logic
     */
    protected abstract doHealthCheck(): Promise<boolean>;
    /**
     * Calculate exponential backoff delay
     */
    protected calculateBackoff(attempt: number): number;
    /**
     * Sleep for specified milliseconds
     */
    protected sleep(ms: number): Promise<void>;
    /**
     * Make HTTP request with timeout
     */
    protected httpRequest<T>(options: {
        url: string;
        method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
        headers?: Record<string, string>;
        body?: unknown;
        timeout?: number;
    }): Promise<{
        status: number;
        ok: boolean;
        data: T;
        text: string;
    }>;
    /**
     * Split events into batches
     */
    protected splitIntoBatches(events: SecurityEvent[]): SecurityEvent[][];
}
/**
 * Factory function type for creating connectors
 */
export type ConnectorFactory<T extends SIEMConnector = SIEMConnector> = (config: BaseConnectorConfig) => T;
/**
 * Register a connector factory
 */
export declare function registerConnectorFactory(type: string, factory: ConnectorFactory): void;
/**
 * Get a connector factory by type
 */
export declare function getConnectorFactory(type: string): ConnectorFactory | undefined;
/**
 * Get all registered connector types
 */
export declare function getRegisteredConnectorTypes(): string[];
//# sourceMappingURL=connector.d.ts.map