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 2009 Sun Microsystems, Inc.
025 *      Portions Copyright 2014-2015 ForgeRock AS
026 */
027package org.opends.server.api.plugin;
028
029import java.util.List;
030import java.util.Set;
031
032import org.forgerock.i18n.LocalizableMessage;
033import org.opends.server.admin.std.server.PluginCfg;
034import org.forgerock.opendj.config.server.ConfigException;
035import org.opends.server.types.DN;
036import org.opends.server.types.InitializationException;
037
038/**
039 * An internal directory server plugin which can be registered with
040 * the server without requiring any associated configuration.
041 */
042public abstract class InternalDirectoryServerPlugin extends
043    DirectoryServerPlugin<PluginCfg>
044{
045
046  /**
047   * Creates a new internal directory server plugin using the provided
048   * component name and plugin types.
049   *
050   * @param componentDN
051   *          The configuration entry name of the component associated
052   *          with this internal plugin.
053   * @param pluginTypes
054   *          The set of plugin types for which this internal plugin
055   *          is registered.
056   * @param invokeForInternalOps
057   *          Indicates whether this internal plugin should be invoked
058   *          for internal operations.
059   */
060  protected InternalDirectoryServerPlugin(DN componentDN,
061      Set<PluginType> pluginTypes, boolean invokeForInternalOps)
062  {
063    initializeInternal(componentDN, pluginTypes,
064        invokeForInternalOps);
065  }
066
067
068
069  /** {@inheritDoc} */
070  public final void initializePlugin(Set<PluginType> pluginTypes,
071      PluginCfg configuration) throws ConfigException,
072      InitializationException
073  {
074    // Unused.
075  }
076
077
078
079  /** {@inheritDoc} */
080  public final boolean isConfigurationAcceptable(
081      PluginCfg configuration, List<LocalizableMessage> unacceptableReasons)
082  {
083    // Unused.
084    return true;
085  }
086
087}