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