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.ConfigurationChangeListener;
033 import org.opends.server.admin.std.meta.PluginCfgDefn.PluginType;
034 import org.opends.server.admin.std.meta.ProfilerPluginCfgDefn.ProfileAction;
035
036
037
038 /**
039 * A server-side interface for querying Profiler Plugin settings.
040 * <p>
041 * The Profiler plug-in captures profiling information about
042 * operations performed inside the JVM while the Directory Server is
043 * running.
044 */
045 public interface ProfilerPluginCfg extends PluginCfg {
046
047 /**
048 * Gets the configuration class associated with this Profiler Plugin.
049 *
050 * @return Returns the configuration class associated with this Profiler Plugin.
051 */
052 Class<? extends ProfilerPluginCfg> configurationClass();
053
054
055
056 /**
057 * Register to be notified when this Profiler Plugin is changed.
058 *
059 * @param listener
060 * The Profiler Plugin configuration change listener.
061 */
062 void addProfilerChangeListener(ConfigurationChangeListener<ProfilerPluginCfg> listener);
063
064
065
066 /**
067 * Deregister an existing Profiler Plugin configuration change listener.
068 *
069 * @param listener
070 * The Profiler Plugin configuration change listener.
071 */
072 void removeProfilerChangeListener(ConfigurationChangeListener<ProfilerPluginCfg> listener);
073
074
075
076 /**
077 * Gets the "enable-profiling-on-startup" property.
078 * <p>
079 * Indicates whether the profiler plug-in is to start collecting
080 * data automatically when the Directory Server is started.
081 * <p>
082 * This property is read only when the server is started, and any
083 * changes take effect on the next restart. This property is
084 * typically set to "false" unless startup profiling is required,
085 * because otherwise the volume of data that can be collected can
086 * cause the server to run out of memory if it is not turned off in a
087 * timely manner.
088 *
089 * @return Returns the value of the "enable-profiling-on-startup" property.
090 */
091 boolean isEnableProfilingOnStartup();
092
093
094
095 /**
096 * Gets the "invoke-for-internal-operations" property.
097 * <p>
098 * Indicates whether the plug-in should be invoked for internal
099 * operations.
100 * <p>
101 * Any plug-in that can be invoked for internal operations must
102 * ensure that it does not create any new internal operatons that can
103 * cause the same plug-in to be re-invoked.
104 *
105 * @return Returns the value of the "invoke-for-internal-operations" property.
106 */
107 boolean isInvokeForInternalOperations();
108
109
110
111 /**
112 * Gets the "java-class" property.
113 * <p>
114 * Specifies the fully-qualified name of the Java class that
115 * provides the plug-in implementation.
116 *
117 * @return Returns the value of the "java-class" property.
118 */
119 String getJavaClass();
120
121
122
123 /**
124 * Gets the "plugin-type" property.
125 * <p>
126 * Specifies the set of plug-in types for the plug-in, which
127 * specifies the times at which the plug-in is invoked.
128 *
129 * @return Returns an unmodifiable set containing the values of the "plugin-type" property.
130 */
131 SortedSet<PluginType> getPluginType();
132
133
134
135 /**
136 * Gets the "profile-action" property.
137 * <p>
138 * Specifies the action that should be taken by the profiler.
139 * <p>
140 * A value of "start" causes the profiler thread to start collecting
141 * data if it is not already active. A value of "stop" causes the
142 * profiler thread to stop collecting data and write it to disk, and
143 * a value of "cancel" causes the profiler thread to stop collecting
144 * data and discard anything that has been captured. These operations
145 * occur immediately.
146 *
147 * @return Returns the value of the "profile-action" property.
148 */
149 ProfileAction getProfileAction();
150
151
152
153 /**
154 * Gets the "profile-directory" property.
155 * <p>
156 * Specifies the path to the directory where profile information is
157 * to be written. This path may be either an absolute path or a path
158 * that is relative to the root of the OpenDS Directory Server
159 * instance.
160 * <p>
161 * The directory must exist and the Directory Server must have
162 * permission to create new files in it.
163 *
164 * @return Returns the value of the "profile-directory" property.
165 */
166 String getProfileDirectory();
167
168
169
170 /**
171 * Gets the "profile-sample-interval" property.
172 * <p>
173 * Specifies the sample interval in milliseconds to be used when
174 * capturing profiling information in the server.
175 * <p>
176 * When capturing data, the profiler thread sleeps for this length
177 * of time between calls to obtain traces for all threads running in
178 * the JVM.
179 *
180 * @return Returns the value of the "profile-sample-interval" property.
181 */
182 long getProfileSampleInterval();
183
184 }