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.Configuration;
033    import org.opends.server.admin.server.ConfigurationAddListener;
034    import org.opends.server.admin.server.ConfigurationChangeListener;
035    import org.opends.server.admin.server.ConfigurationDeleteListener;
036    import org.opends.server.admin.std.meta.RootDNCfgDefn.DefaultRootPrivilegeName;
037    import org.opends.server.config.ConfigException;
038    
039    
040    
041    /**
042     * A server-side interface for querying Root DN settings.
043     * <p>
044     * The Root DN configuration contains all the Root DN Users defined in
045     * the Directory Server. In addition, it also defines the default set
046     * of privileges that Root DN Users automatically inherit.
047     */
048    public interface RootDNCfg extends Configuration {
049    
050      /**
051       * Gets the configuration class associated with this Root DN.
052       *
053       * @return Returns the configuration class associated with this Root DN.
054       */
055      Class<? extends RootDNCfg> configurationClass();
056    
057    
058    
059      /**
060       * Register to be notified when this Root DN is changed.
061       *
062       * @param listener
063       *          The Root DN configuration change listener.
064       */
065      void addChangeListener(ConfigurationChangeListener<RootDNCfg> listener);
066    
067    
068    
069      /**
070       * Deregister an existing Root DN configuration change listener.
071       *
072       * @param listener
073       *          The Root DN configuration change listener.
074       */
075      void removeChangeListener(ConfigurationChangeListener<RootDNCfg> listener);
076    
077    
078    
079      /**
080       * Gets the "default-root-privilege-name" property.
081       * <p>
082       * Specifies the names of the privileges that root users will be
083       * granted by default.
084       *
085       * @return Returns an unmodifiable set containing the values of the "default-root-privilege-name" property.
086       */
087      SortedSet<DefaultRootPrivilegeName> getDefaultRootPrivilegeName();
088    
089    
090    
091      /**
092       * Lists the Root DN Users.
093       *
094       * @return Returns an array containing the names of the
095       *         Root DN Users.
096       */
097      String[] listRootDNUsers();
098    
099    
100    
101      /**
102       * Gets the named Root DN User.
103       *
104       * @param name
105       *          The name of the Root DN User to retrieve.
106       * @return Returns the named Root DN User.
107       * @throws ConfigException
108       *           If the Root DN User could not be found or it
109       *           could not be successfully decoded.
110       */
111      RootDNUserCfg getRootDNUser(String name) throws ConfigException;
112    
113    
114    
115      /**
116       * Registers to be notified when new Root DN Users are added.
117       *
118       * @param listener
119       *          The Root DN User configuration add listener.
120       * @throws ConfigException
121       *          If the add listener could not be registered.
122       */
123      void addRootDNUserAddListener(ConfigurationAddListener<RootDNUserCfg> listener) throws ConfigException;
124    
125    
126    
127      /**
128       * Deregisters an existing Root DN User configuration add listener.
129       *
130       * @param listener
131       *          The Root DN User configuration add listener.
132       */
133      void removeRootDNUserAddListener(ConfigurationAddListener<RootDNUserCfg> listener);
134    
135    
136    
137      /**
138       * Registers to be notified when existing Root DN Users are deleted.
139       *
140       * @param listener
141       *          The Root DN User configuration delete listener.
142       * @throws ConfigException
143       *          If the delete listener could not be registered.
144       */
145      void addRootDNUserDeleteListener(ConfigurationDeleteListener<RootDNUserCfg> listener) throws ConfigException;
146    
147    
148    
149      /**
150       * Deregisters an existing Root DN User configuration delete listener.
151       *
152       * @param listener
153       *          The Root DN User configuration delete listener.
154       */
155      void removeRootDNUserDeleteListener(ConfigurationDeleteListener<RootDNUserCfg> listener);
156    
157    }