View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.core.status;
15  
16  import java.util.List;
17  
18  /**
19   * Internal error messages (statii) are managed by instances of this interface.
20   * 
21   * @author Ceki Gülcü
22   */
23  public interface StatusManager {
24  
25      /**
26       * Add a new status message.
27       * 
28       * @param status
29       */
30      void add(Status status);
31  
32      /**
33       * Obtain a copy of the status list maintained by this StatusManager.
34       * 
35       * @return
36       */
37      List<Status> getCopyOfStatusList();
38  
39      /**
40       * Return the highest level of all the statii.
41       * 
42       * @return
43       */
44      // int getLevel();
45  
46      /**
47       * Return the number of status entries.
48       * 
49       * @return
50       */
51      int getCount();
52  
53      /**
54       * Add a status listener.
55       * @param listener
56       */
57  
58      /**
59       * Add a status listener. The StatusManager may decide to skip installation if an 
60       * earlier instance was already installed.
61       * 
62       * @param listener
63       * @return true if actually added, false if skipped
64       */
65      boolean add(StatusListener listener);
66  
67      /**);
68       * Remove a status listener.
69       * 
70       * @param listener
71       */
72      void remove(StatusListener listener);
73  
74      /**
75       * Clear the list of status messages.
76       */
77      void clear();
78  
79      /**
80       * Obtain a copy of the status listener list maintained by this StatusManager
81       * 
82       * @return
83       */
84      List<StatusListener> getCopyOfStatusListenerList();
85  
86  }