001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2015 ForgeRock AS.
015 */
016package org.forgerock.audit.handlers.syslog;
017
018/**
019 * Defines the standard Syslog message severities.
020 *
021 * @see <a href="https://tools.ietf.org/html/rfc5424#section-6.2.1">RFC-5424 section 6.2.1</a>
022 */
023public enum Severity {
024
025    /**
026     * System is unusable.
027     */
028    EMERGENCY(0),
029    /**
030     * Action must be taken immediately.
031     */
032    ALERT(1),
033    /**
034     * Critical conditions.
035     */
036    CRITICAL(2),
037    /**
038     * Error conditions.
039     */
040    ERROR(3),
041    /**
042     * Warning conditions.
043     */
044    WARNING(4),
045    /**
046     * Normal but significant condition.
047     */
048    NOTICE(5),
049    /**
050     * Informational messages.
051     */
052    INFORMATIONAL(6),
053    /**
054     * Debug-level messages.
055     */
056    DEBUG(7);
057
058    private final int code;
059
060    Severity(int code) {
061        this.code = code;
062    }
063
064    public int getCode() {
065        return code;
066    }
067}