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 java.util.SortedSet;
031import org.opends.server.admin.Configuration;
032import org.opends.server.admin.server.ConfigurationChangeListener;
033import org.opends.server.admin.std.meta.PluginCfgDefn.PluginType;
034
035
036
037/**
038 * A server-side interface for querying Plugin settings.
039 * <p>
040 * Plugins provide a mechanism for executing custom code at specified
041 * points in operation processing and in the course of other events
042 * like connection establishment and termination, server startup and
043 * shutdown, and LDIF import and export.
044 */
045public interface PluginCfg extends Configuration {
046
047  /**
048   * Gets the configuration class associated with this Plugin.
049   *
050   * @return Returns the configuration class associated with this Plugin.
051   */
052  Class<? extends PluginCfg> configurationClass();
053
054
055
056  /**
057   * Register to be notified when this Plugin is changed.
058   *
059   * @param listener
060   *          The Plugin configuration change listener.
061   */
062  void addChangeListener(ConfigurationChangeListener<PluginCfg> listener);
063
064
065
066  /**
067   * Deregister an existing Plugin configuration change listener.
068   *
069   * @param listener
070   *          The Plugin configuration change listener.
071   */
072  void removeChangeListener(ConfigurationChangeListener<PluginCfg> listener);
073
074
075
076  /**
077   * Gets the "enabled" property.
078   * <p>
079   * Indicates whether the plug-in is enabled for use.
080   *
081   * @return Returns the value of the "enabled" property.
082   */
083  boolean isEnabled();
084
085
086
087  /**
088   * Gets the "invoke-for-internal-operations" property.
089   * <p>
090   * Indicates whether the plug-in should be invoked for internal
091   * operations.
092   * <p>
093   * Any plug-in that can be invoked for internal operations must
094   * ensure that it does not create any new internal operatons that can
095   * cause the same plug-in to be re-invoked.
096   *
097   * @return Returns the value of the "invoke-for-internal-operations" property.
098   */
099  boolean isInvokeForInternalOperations();
100
101
102
103  /**
104   * Gets the "java-class" property.
105   * <p>
106   * Specifies the fully-qualified name of the Java class that
107   * provides the plug-in implementation.
108   *
109   * @return Returns the value of the "java-class" property.
110   */
111  String getJavaClass();
112
113
114
115  /**
116   * Gets the "plugin-type" property.
117   * <p>
118   * Specifies the set of plug-in types for the plug-in, which
119   * specifies the times at which the plug-in is invoked.
120   *
121   * @return Returns an unmodifiable set containing the values of the "plugin-type" property.
122   */
123  SortedSet<PluginType> getPluginType();
124
125}