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