View Javadoc

1   /*
2    * This file is part of Domingo
3    * an Open Source Java-API to Lotus Notes/Domino
4    * hosted at http://domingo.sourceforge.net
5    *
6    * Copyright (c) 2003-2007 Beck et al. projects GmbH Munich, Germany (http://www.bea.de)
7    *
8    * This library is free software; you can redistribute it and/or
9    * modify it under the terms of the GNU Lesser General Public
10   * License as published by the Free Software Foundation; either
11   * version 2.1 of the License, or (at your option) any later version.
12   *
13   * This library is distributed in the hope that it will be useful,
14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   * Lesser General Public License for more details.
17   *
18   * You should have received a copy of the GNU Lesser General Public
19   * License along with this library; if not, write to the Free Software
20   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21   */
22  
23  package de.bea.domingo;
24  
25  /***
26   * Interface to monitor notes threads.
27   *
28   * <p>Applications that use the domingo API can write an Adapter
29   * to the application specific logging or can use one of the build-in
30   * implementations of this interface.</p>
31   *
32   * @author <a href=mailto:kriede@users.sourceforge.net>Kurt Riede</a>
33   */
34  public interface DNotesMonitor {
35  
36      /*** constant to indicate debug messages. */
37      int DEBUG = 50;
38  
39      /*** constant to indicate info messages. */
40      int INFO  = 40;
41  
42      /*** constant to indicate warn messages. */
43      int WARN  = 30;
44  
45      /*** constant to indicate error messages. */
46      int ERROR = 20;
47  
48      /*** constant to indicate fatal error messages. */
49      int FATAL = 10;
50  
51      /*** constant to indicate fatal error messages. */
52      int NONE = 0;
53  
54      /*** default monitoring level. */
55      int DEFAULT_LEVEL = WARN;
56  
57      /***
58       * debug output.
59       *
60       * @param message the message
61       */
62      void debug(String message);
63  
64      /***
65       * debug output.
66       *
67       * @param message the message
68       * @param throwable the throwable
69       */
70      void debug(String message, Throwable throwable);
71  
72      /***
73       * Checks if debug output is enabled or not.
74       *
75       * @return <code>true</code>if enabled, else <code>false</code>
76       */
77      boolean isDebugEnabled();
78  
79      /***
80       * info output.
81       *
82       * @param message the message
83       */
84      void info(String message);
85  
86      /***
87       * info output.
88       *
89       * @param message the message
90       * @param throwable the throwable
91       */
92      void info(String message, Throwable throwable);
93  
94      /***
95       * Checks if info output is enabled or not.
96       *
97       * @return <code>true</code>if enabled, else <code>false</code>
98       */
99      boolean isInfoEnabled();
100 
101     /***
102      * warn output.
103      *
104      * @param message the message
105      */
106     void warn(String message);
107 
108     /***
109      * warn output.
110      *
111      * @param message the message
112      * @param throwable the throwable
113      */
114     void warn(String message, Throwable throwable);
115 
116     /***
117      * Checks if warn output is enabled or not.
118      *
119      * @return <code>true</code>if enabled, else <code>false</code>
120      */
121     boolean isWarnEnabled();
122 
123     /***
124      * error output.
125      *
126      * @param message the message
127      */
128     void error(String message);
129 
130     /***
131      * error output.
132      *
133      * @param message the message
134      * @param throwable the throwable
135      */
136     void error(String message, Throwable throwable);
137 
138     /***
139      * Checks if error output is enabled or not.
140      *
141      * @return <code>true</code>if enabled, else <code>false</code>
142      */
143     boolean isErrorEnabled();
144 
145     /***
146      * fatal error output.
147      *
148      * @param message the message
149      */
150     void fatalError(String message);
151 
152     /***
153      * fatal error output.
154      *
155      * @param message the message
156      * @param throwable the throwable
157      */
158     void fatalError(String message, Throwable throwable);
159 
160     /***
161      * Checks if fatal error output is enabled or not.
162      *
163      * @return <code>true</code>if enabled, else <code>false</code>
164      */
165     boolean isFatalErrorEnabled();
166 }