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 org.opends.server.admin.server.ConfigurationAddListener;
032    import org.opends.server.admin.server.ConfigurationChangeListener;
033    import org.opends.server.admin.server.ConfigurationDeleteListener;
034    import org.opends.server.config.ConfigException;
035    
036    
037    
038    /**
039     * A server-side interface for querying Replication Synchronization
040     * Provider settings.
041     * <p>
042     * The Replication Synchronization Provider provides multi-master
043     * replication of data across multiple Directory Server instances.
044     */
045    public interface ReplicationSynchronizationProviderCfg extends SynchronizationProviderCfg {
046    
047      /**
048       * Gets the configuration class associated with this Replication Synchronization Provider.
049       *
050       * @return Returns the configuration class associated with this Replication Synchronization Provider.
051       */
052      Class<? extends ReplicationSynchronizationProviderCfg> configurationClass();
053    
054    
055    
056      /**
057       * Register to be notified when this Replication Synchronization Provider is changed.
058       *
059       * @param listener
060       *          The Replication Synchronization Provider configuration change listener.
061       */
062      void addReplicationChangeListener(ConfigurationChangeListener<ReplicationSynchronizationProviderCfg> listener);
063    
064    
065    
066      /**
067       * Deregister an existing Replication Synchronization Provider configuration change listener.
068       *
069       * @param listener
070       *          The Replication Synchronization Provider configuration change listener.
071       */
072      void removeReplicationChangeListener(ConfigurationChangeListener<ReplicationSynchronizationProviderCfg> listener);
073    
074    
075    
076      /**
077       * Gets the "java-class" property.
078       * <p>
079       * Specifies the fully-qualified name of the Java class that
080       * provides the Replication Synchronization Provider implementation.
081       *
082       * @return Returns the value of the "java-class" property.
083       */
084      String getJavaClass();
085    
086    
087    
088      /**
089       * Gets the "num-update-replay-threads" property.
090       * <p>
091       * Specifies the number of update replay threads.
092       * <p>
093       * This value is the number of threads created for replaying every
094       * updates received for all the replication domains.
095       *
096       * @return Returns the value of the "num-update-replay-threads" property.
097       */
098      int getNumUpdateReplayThreads();
099    
100    
101    
102      /**
103       * Lists the Replication Domains.
104       *
105       * @return Returns an array containing the names of the
106       *         Replication Domains.
107       */
108      String[] listReplicationDomains();
109    
110    
111    
112      /**
113       * Gets the named Replication Domain.
114       *
115       * @param name
116       *          The name of the Replication Domain to retrieve.
117       * @return Returns the named Replication Domain.
118       * @throws ConfigException
119       *           If the Replication Domain could not be found or it
120       *           could not be successfully decoded.
121       */
122      ReplicationDomainCfg getReplicationDomain(String name) throws ConfigException;
123    
124    
125    
126      /**
127       * Registers to be notified when new Replication Domains are added.
128       *
129       * @param listener
130       *          The Replication Domain configuration add listener.
131       * @throws ConfigException
132       *          If the add listener could not be registered.
133       */
134      void addReplicationDomainAddListener(ConfigurationAddListener<ReplicationDomainCfg> listener) throws ConfigException;
135    
136    
137    
138      /**
139       * Deregisters an existing Replication Domain configuration add listener.
140       *
141       * @param listener
142       *          The Replication Domain configuration add listener.
143       */
144      void removeReplicationDomainAddListener(ConfigurationAddListener<ReplicationDomainCfg> listener);
145    
146    
147    
148      /**
149       * Registers to be notified when existing Replication Domains are deleted.
150       *
151       * @param listener
152       *          The Replication Domain configuration delete listener.
153       * @throws ConfigException
154       *          If the delete listener could not be registered.
155       */
156      void addReplicationDomainDeleteListener(ConfigurationDeleteListener<ReplicationDomainCfg> listener) throws ConfigException;
157    
158    
159    
160      /**
161       * Deregisters an existing Replication Domain configuration delete listener.
162       *
163       * @param listener
164       *          The Replication Domain configuration delete listener.
165       */
166      void removeReplicationDomainDeleteListener(ConfigurationDeleteListener<ReplicationDomainCfg> listener);
167    
168    
169    
170      /**
171       * Determines whether or not the Replication Server exists.
172       *
173       * @return Returns <true> if the Replication Server exists.
174       */
175      boolean hasReplicationServer();
176    
177    
178    
179      /**
180       * Gets the Replication Server if it is present.
181       *
182       * @return Returns the Replication Server if it is present.
183       * @throws ConfigException
184       *           If the Replication Server does not exist or it could not
185       *           be successfully decoded.
186       */
187      ReplicationServerCfg getReplicationServer() throws ConfigException;
188    
189    
190    
191      /**
192       * Registers to be notified when the Replication Server is added.
193       *
194       * @param listener
195       *          The Replication Server configuration add listener.
196       * @throws ConfigException
197       *          If the add listener could not be registered.
198       */
199      void addReplicationServerAddListener(ConfigurationAddListener<ReplicationServerCfg> listener) throws ConfigException;
200    
201    
202    
203      /**
204       * Deregisters an existing Replication Server configuration add listener.
205       *
206       * @param listener
207       *          The Replication Server configuration add listener.
208       */
209      void removeReplicationServerAddListener(ConfigurationAddListener<ReplicationServerCfg> listener);
210    
211    
212    
213      /**
214       * Registers to be notified the Replication Server is deleted.
215       *
216       * @param listener
217       *          The Replication Server configuration delete listener.
218       * @throws ConfigException
219       *          If the delete listener could not be registered.
220       */
221      void addReplicationServerDeleteListener(ConfigurationDeleteListener<ReplicationServerCfg> listener) throws ConfigException;
222    
223    
224    
225      /**
226       * Deregisters an existing Replication Server configuration delete listener.
227       *
228       * @param listener
229       *          The Replication Server configuration delete listener.
230       */
231      void removeReplicationServerDeleteListener(ConfigurationDeleteListener<ReplicationServerCfg> listener);
232    
233    }