All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.cosmos.implementation.changefeed.HealthMonitoringRecord Maven / Gradle / Ivy

Go to download

This Package contains Microsoft Azure Cosmos SDK (with Reactive Extension Reactor support) for Azure Cosmos DB SQL API

There is a newer version: 4.60.0
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.cosmos.implementation.changefeed;

/**
 * A record used in the health monitoring.
 */
public class HealthMonitoringRecord {
    public final HealthSeverity severity;
    public final MonitoredOperation operation;
    public final Lease lease;
    public final Throwable throwable;

    /**
     * Initializes a new instance of the {@link HealthMonitoringRecord} class.
     *
     * @param severity the health severity level.
     * @param operation the operation.
     * @param lease the lease.
     * @param throwable the exception.
     */
    public HealthMonitoringRecord(HealthSeverity severity, MonitoredOperation operation, Lease lease, Throwable throwable) {
        if (lease == null) throw new IllegalArgumentException("lease");
        this.severity = severity;
        this.operation = operation;
        this.lease = lease;
        this.throwable = throwable;
    }

    /**
     * @return the severity of this monitoring record.
     */
    public HealthSeverity getSeverity() {
        return this.severity;
    }

    /**
     * The health severity level.
     */
    public enum HealthSeverity {
        /**
         * Critical level.
         */
        CRITICAL(10),

        /**
         * Error level.
         */
        ERROR(20),

        /**
         * Information level.
         */
        INFORMATIONAL(30);

        public final int value;

        HealthSeverity(int value){
            this.value = value;
        }
    }

    /**
     * The health monitoring phase.
     */
    public enum MonitoredOperation {
        /**
         * A phase when the instance tries to acquire the lease.
         */
        ACQUIRE_LEASE,
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy