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

net.sf.eBusx.monitor.ActionLevel Maven / Gradle / Ivy

//
// Copyright 2011, 2019 Charles W. Rapp
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package net.sf.eBusx.monitor;

/**
 * The unique action levels reported in the PersistentStatus and
 * TransientStatus notifications. The levels are arranged from
 * an information-only report ({@link #NO_ACTION}) to a problem
 * which precludes the application from operating
 * ({@link #FATAL_ERROR}).
 *
 * @author Charles Rapp
 */

public enum ActionLevel
{
    /**
     * Nominal operation. Reported for informational purposes
     * only.
     */
    NO_ACTION("No Action"),

    /**
     * A problem is occurring which may require
     * operator intervention since the application has the
     * ability to automatically recover from this problem.
     */
    POSSIBLE_ACTION("Possible Action"),

    /**
     * A problem is occurring which requires operator
     * intervention.
     */
    ACTION_REQUIRED("Action Required"),

    /**
     * A problem has caused unrecoverable failure and
     * system shutdown.
     */
    FATAL_ERROR("Fatal Error");

//---------------------------------------------------------------
// Member data.
//

    //-----------------------------------------------------------
    // Locals.
    //

    /**
     * The action level human-readable text.
     */
    private final String mText;

//---------------------------------------------------------------
// Member methods.
//

    //-----------------------------------------------------------
    // Constructors.
    //

    /**
     * Creates a new action level instance with the given
     * human-readable name.
     * @param text the human-readable name for this action level.
     */
    private ActionLevel(final String text)
    {
        mText =text;
    } // end of ActionLevel(String)

    //
    // end of Constructors.
    //-----------------------------------------------------------

    //-----------------------------------------------------------
    // Get methods.
    //

    /**
     * Returns the human-readable text.
     * @return the human-readable text.
     */
    public String text()
    {
        return (mText);
    } // end fo text()

    //
    // end of Get methods.
    //-----------------------------------------------------------

    /**
     * Returns the human-readable text.
     * @return the action level textual representation.
     */
    @Override
    public String toString()
    {
        return (mText);
    } // end of toString()
} // end of enum ActionLevel




© 2015 - 2024 Weber Informatics LLC | Privacy Policy