001 /*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License"). You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at
010 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012 * See the License for the specific language governing permissions
013 * and limitations under the License.
014 *
015 * When distributing Covered Code, include this CDDL HEADER in each
016 * file and include the License file at
017 * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
018 * add the following below this CDDL HEADER, with the fields enclosed
019 * by brackets "[]" replaced with your own identifying information:
020 * Portions Copyright [yyyy] [name of copyright owner]
021 *
022 * CDDL HEADER END
023 *
024 *
025 * Copyright 2008 Sun Microsystems, Inc.
026 */
027 package org.opends.server.admin.std.server;
028
029
030
031 import java.util.SortedSet;
032 import org.opends.server.admin.server.ConfigurationAddListener;
033 import org.opends.server.admin.server.ConfigurationChangeListener;
034 import org.opends.server.admin.server.ConfigurationDeleteListener;
035 import org.opends.server.admin.std.meta.DebugLogPublisherCfgDefn.DefaultDebugCategory;
036 import org.opends.server.admin.std.meta.DebugLogPublisherCfgDefn.DefaultDebugLevel;
037 import org.opends.server.config.ConfigException;
038
039
040
041 /**
042 * A server-side interface for querying Debug Log Publisher settings.
043 * <p>
044 * Debug Log Publishers are responsible for distributing debug log
045 * messages from the debug logger to a destination.
046 */
047 public interface DebugLogPublisherCfg extends LogPublisherCfg {
048
049 /**
050 * Gets the configuration class associated with this Debug Log Publisher.
051 *
052 * @return Returns the configuration class associated with this Debug Log Publisher.
053 */
054 Class<? extends DebugLogPublisherCfg> configurationClass();
055
056
057
058 /**
059 * Register to be notified when this Debug Log Publisher is changed.
060 *
061 * @param listener
062 * The Debug Log Publisher configuration change listener.
063 */
064 void addDebugChangeListener(ConfigurationChangeListener<DebugLogPublisherCfg> listener);
065
066
067
068 /**
069 * Deregister an existing Debug Log Publisher configuration change listener.
070 *
071 * @param listener
072 * The Debug Log Publisher configuration change listener.
073 */
074 void removeDebugChangeListener(ConfigurationChangeListener<DebugLogPublisherCfg> listener);
075
076
077
078 /**
079 * Gets the "default-debug-category" property.
080 * <p>
081 * The debug message categories to be logged when none of the
082 * defined targets match the message.
083 *
084 * @return Returns an unmodifiable set containing the values of the "default-debug-category" property.
085 */
086 SortedSet<DefaultDebugCategory> getDefaultDebugCategory();
087
088
089
090 /**
091 * Gets the "default-debug-level" property.
092 * <p>
093 * The lowest severity level of debug messages to log when none of
094 * the defined targets match the message.
095 *
096 * @return Returns the value of the "default-debug-level" property.
097 */
098 DefaultDebugLevel getDefaultDebugLevel();
099
100
101
102 /**
103 * Gets the "default-include-throwable-cause" property.
104 * <p>
105 * Indicates whether to include the cause of exceptions in exception
106 * thrown and caught messages logged by default.
107 *
108 * @return Returns the value of the "default-include-throwable-cause" property.
109 */
110 boolean isDefaultIncludeThrowableCause();
111
112
113
114 /**
115 * Gets the "default-omit-method-entry-arguments" property.
116 * <p>
117 * Indicates whether to include method arguments in debug messages
118 * logged by default.
119 *
120 * @return Returns the value of the "default-omit-method-entry-arguments" property.
121 */
122 boolean isDefaultOmitMethodEntryArguments();
123
124
125
126 /**
127 * Gets the "default-omit-method-return-value" property.
128 * <p>
129 * Indicates whether to include the return value in debug messages
130 * logged by default.
131 *
132 * @return Returns the value of the "default-omit-method-return-value" property.
133 */
134 boolean isDefaultOmitMethodReturnValue();
135
136
137
138 /**
139 * Gets the "default-throwable-stack-frames" property.
140 * <p>
141 * Indicates the number of stack frames to include in the stack
142 * trace for method entry and exception thrown messages.
143 *
144 * @return Returns the value of the "default-throwable-stack-frames" property.
145 */
146 int getDefaultThrowableStackFrames();
147
148
149
150 /**
151 * Gets the "java-class" property.
152 * <p>
153 * The fully-qualified name of the Java class that provides the
154 * Debug Log Publisher implementation.
155 *
156 * @return Returns the value of the "java-class" property.
157 */
158 String getJavaClass();
159
160
161
162 /**
163 * Lists the Debug Targets.
164 *
165 * @return Returns an array containing the names of the
166 * Debug Targets.
167 */
168 String[] listDebugTargets();
169
170
171
172 /**
173 * Gets the named Debug Target.
174 *
175 * @param name
176 * The name of the Debug Target to retrieve.
177 * @return Returns the named Debug Target.
178 * @throws ConfigException
179 * If the Debug Target could not be found or it
180 * could not be successfully decoded.
181 */
182 DebugTargetCfg getDebugTarget(String name) throws ConfigException;
183
184
185
186 /**
187 * Registers to be notified when new Debug Targets are added.
188 *
189 * @param listener
190 * The Debug Target configuration add listener.
191 * @throws ConfigException
192 * If the add listener could not be registered.
193 */
194 void addDebugTargetAddListener(ConfigurationAddListener<DebugTargetCfg> listener) throws ConfigException;
195
196
197
198 /**
199 * Deregisters an existing Debug Target configuration add listener.
200 *
201 * @param listener
202 * The Debug Target configuration add listener.
203 */
204 void removeDebugTargetAddListener(ConfigurationAddListener<DebugTargetCfg> listener);
205
206
207
208 /**
209 * Registers to be notified when existing Debug Targets are deleted.
210 *
211 * @param listener
212 * The Debug Target configuration delete listener.
213 * @throws ConfigException
214 * If the delete listener could not be registered.
215 */
216 void addDebugTargetDeleteListener(ConfigurationDeleteListener<DebugTargetCfg> listener) throws ConfigException;
217
218
219
220 /**
221 * Deregisters an existing Debug Target configuration delete listener.
222 *
223 * @param listener
224 * The Debug Target configuration delete listener.
225 */
226 void removeDebugTargetDeleteListener(ConfigurationDeleteListener<DebugTargetCfg> listener);
227
228 }