001/**
002 * Logback: the reliable, generic, fast and flexible logging framework.
003 * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
004 *
005 * This program and the accompanying materials are dual-licensed under
006 * either the terms of the Eclipse Public License v1.0 as published by
007 * the Eclipse Foundation
008 *
009 *   or (per the licensee's choosing)
010 *
011 * under the terms of the GNU Lesser General Public License version 2.1
012 * as published by the Free Software Foundation.
013 */
014package ch.qos.logback.core.status;
015
016import java.util.List;
017
018/**
019 * Internal error messages (statii) are managed by instances of this interface.
020 * 
021 * @author Ceki Gülcü
022 */
023public interface StatusManager {
024
025    /**
026     * Add a new status message.
027     * 
028     * @param status
029     */
030    void add(Status status);
031
032    /**
033     * Obtain a copy of the status list maintained by this StatusManager.
034     * 
035     * @return
036     */
037    List<Status> getCopyOfStatusList();
038
039    /**
040     * Return the highest level of all the statii.
041     * 
042     * @return
043     */
044    // int getLevel();
045
046    /**
047     * Return the number of status entries.
048     * 
049     * @return
050     */
051    int getCount();
052
053    /**
054     * Add a status listener.
055     * 
056     * @param listener
057     */
058
059    /**
060     * Add a status listener. The StatusManager may decide to skip installation if
061     * an earlier instance was already installed.
062     * 
063     * @param listener
064     * @return true if actually added, false if skipped
065     */
066    boolean add(StatusListener listener);
067
068    /**
069     * ); Remove a status listener.
070     * 
071     * @param listener
072     */
073    void remove(StatusListener listener);
074
075    /**
076     * Clear the list of status messages.
077     */
078    void clear();
079
080    /**
081     * Obtain a copy of the status listener list maintained by this StatusManager
082     * 
083     * @return
084     */
085    List<StatusListener> getCopyOfStatusListenerList();
086
087}