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.client;
028    
029    
030    
031    import java.util.Collection;
032    import org.opends.server.admin.client.AuthorizationException;
033    import org.opends.server.admin.client.CommunicationException;
034    import org.opends.server.admin.client.ConcurrentModificationException;
035    import org.opends.server.admin.client.IllegalManagedObjectNameException;
036    import org.opends.server.admin.client.ManagedObjectDecodingException;
037    import org.opends.server.admin.client.OperationRejectedException;
038    import org.opends.server.admin.DefaultBehaviorException;
039    import org.opends.server.admin.DefinitionDecodingException;
040    import org.opends.server.admin.IllegalPropertyValueException;
041    import org.opends.server.admin.ManagedObjectDefinition;
042    import org.opends.server.admin.ManagedObjectNotFoundException;
043    import org.opends.server.admin.std.server.ReplicationDomainCfg;
044    import org.opends.server.admin.std.server.ReplicationServerCfg;
045    import org.opends.server.admin.std.server.ReplicationSynchronizationProviderCfg;
046    
047    
048    
049    /**
050     * A client-side interface for reading and modifying Replication
051     * Synchronization Provider settings.
052     * <p>
053     * The Replication Synchronization Provider provides multi-master
054     * replication of data across multiple Directory Server instances.
055     */
056    public interface ReplicationSynchronizationProviderCfgClient extends SynchronizationProviderCfgClient {
057    
058      /**
059       * Get the configuration definition associated with this Replication Synchronization Provider.
060       *
061       * @return Returns the configuration definition associated with this Replication Synchronization Provider.
062       */
063      ManagedObjectDefinition<? extends ReplicationSynchronizationProviderCfgClient, ? extends ReplicationSynchronizationProviderCfg> definition();
064    
065    
066    
067      /**
068       * Gets the "java-class" property.
069       * <p>
070       * Specifies the fully-qualified name of the Java class that
071       * provides the Replication Synchronization Provider implementation.
072       *
073       * @return Returns the value of the "java-class" property.
074       */
075      String getJavaClass();
076    
077    
078    
079      /**
080       * Sets the "java-class" property.
081       * <p>
082       * Specifies the fully-qualified name of the Java class that
083       * provides the Replication Synchronization Provider implementation.
084       *
085       * @param value The value of the "java-class" property.
086       * @throws IllegalPropertyValueException
087       *           If the new value is invalid.
088       */
089      void setJavaClass(String value) throws IllegalPropertyValueException;
090    
091    
092    
093      /**
094       * Gets the "num-update-replay-threads" property.
095       * <p>
096       * Specifies the number of update replay threads.
097       * <p>
098       * This value is the number of threads created for replaying every
099       * updates received for all the replication domains.
100       *
101       * @return Returns the value of the "num-update-replay-threads" property.
102       */
103      int getNumUpdateReplayThreads();
104    
105    
106    
107      /**
108       * Sets the "num-update-replay-threads" property.
109       * <p>
110       * Specifies the number of update replay threads.
111       * <p>
112       * This value is the number of threads created for replaying every
113       * updates received for all the replication domains.
114       *
115       * @param value The value of the "num-update-replay-threads" property.
116       * @throws IllegalPropertyValueException
117       *           If the new value is invalid.
118       */
119      void setNumUpdateReplayThreads(Integer value) throws IllegalPropertyValueException;
120    
121    
122    
123      /**
124       * Lists the Replication Domains.
125       *
126       * @return Returns an array containing the names of the Replication
127       *         Domains.
128       * @throws ConcurrentModificationException
129       *           If this Replication Synchronization Provider has been
130       *           removed from the server by another client.
131       * @throws AuthorizationException
132       *           If the server refuses to list the Replication Domains
133       *           because the client does not have the correct privileges.
134       * @throws CommunicationException
135       *           If the client cannot contact the server due to an
136       *           underlying communication problem.
137       */
138      String[] listReplicationDomains() throws ConcurrentModificationException,
139          AuthorizationException, CommunicationException;
140    
141    
142    
143      /**
144       * Gets the named Replication Domain.
145       *
146       * @param name
147       *           The name of the Replication Domain to retrieve.
148       * @return Returns the named Replication Domain.
149       * @throws DefinitionDecodingException
150       *           If the named Replication Domain was found but its type
151       *           could not be determined.
152       * @throws ManagedObjectDecodingException
153       *           If the named Replication Domain was found but one or
154       *           more of its properties could not be decoded.
155       * @throws ManagedObjectNotFoundException
156       *           If the named Replication Domain was not found on the
157       *           server.
158       * @throws ConcurrentModificationException
159       *           If this Replication Synchronization Provider has been
160       *           removed from the server by another client.
161       * @throws AuthorizationException
162       *           If the server refuses to retrieve the named Replication
163       *           Domain because the client does not have the correct
164       *           privileges.
165       * @throws CommunicationException
166       *           If the client cannot contact the server due to an
167       *           underlying communication problem.
168       */
169      ReplicationDomainCfgClient getReplicationDomain(String name)
170          throws DefinitionDecodingException, ManagedObjectDecodingException,
171          ManagedObjectNotFoundException, ConcurrentModificationException,
172          AuthorizationException, CommunicationException;
173    
174    
175    
176      /**
177       * Creates a new Replication Domain. The new Replication Domain will
178       * initially not contain any property values (including mandatory
179       * properties). Once the Replication Domain has been configured it
180       * can be added to the server using the {@link #commit()} method.
181       *
182       * @param <C>
183       *          The type of the Replication Domain being created.
184       * @param d
185       *          The definition of the Replication Domain to be created.
186       * @param name
187       *          The name of the new Replication Domain.
188       * @param exceptions
189       *          An optional collection in which to place any {@link
190       *          DefaultBehaviorException}s that occurred whilst
191       *          attempting to determine the default values of the
192       *          Replication Domain. This argument can be
193       *          <code>null<code>.
194       * @return Returns a new Replication Domain configuration instance.
195       * @throws IllegalManagedObjectNameException
196       *          If the name of the new Replication Domain is invalid.
197       */
198      <C extends ReplicationDomainCfgClient> C createReplicationDomain(
199          ManagedObjectDefinition<C, ? extends ReplicationDomainCfg> d, String name, Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException;
200    
201    
202    
203      /**
204       * Removes the named Replication Domain.
205       *
206       * @param name
207       *          The name of the Replication Domain to remove.
208       * @throws ManagedObjectNotFoundException
209       *           If the Replication Domain does not exist.
210       * @throws OperationRejectedException
211       *           If the server refuses to remove the Replication Domain
212       *           due to some server-side constraint which cannot be
213       *           satisfied (for example, if it is referenced by another
214       *           managed object).
215       * @throws ConcurrentModificationException
216       *           If this Replication Synchronization Provider has been
217       *           removed from the server by another client.
218       * @throws AuthorizationException
219       *           If the server refuses to remove the Replication Domain
220       *           because the client does not have the correct privileges.
221       * @throws CommunicationException
222       *           If the client cannot contact the server due to an
223       *           underlying communication problem.
224       */
225      void removeReplicationDomain(String name)
226          throws ManagedObjectNotFoundException, OperationRejectedException,
227          ConcurrentModificationException, AuthorizationException,
228          CommunicationException;
229    
230    
231    
232      /**
233       * Determines whether or not the Replication Server exists.
234       *
235       * @return Returns <true> if the Replication Server exists.
236       * @throws ConcurrentModificationException
237       *           If this Replication Synchronization Provider has been
238       *           removed from the server by another client.
239       * @throws AuthorizationException
240       *           If the server refuses to make the determination because
241       *           the client does not have the correct privileges.
242       * @throws CommunicationException
243       *           If the client cannot contact the server due to an
244       *           underlying communication problem.
245       */
246      boolean hasReplicationServer() throws ConcurrentModificationException,
247          AuthorizationException, CommunicationException;
248    
249    
250    
251      /**
252       * Gets the Replication Server if it is present.
253       *
254       * @return Returns the Replication Server if it is present.
255       * @throws DefinitionDecodingException
256       *           If the Replication Server was found but its type could
257       *           not be determined.
258       * @throws ManagedObjectDecodingException
259       *           If the Replication Server was found but one or more of
260       *           its properties could not be decoded.
261       * @throws ManagedObjectNotFoundException
262       *           If the Replication Server is not present.
263       * @throws ConcurrentModificationException
264       *           If this Replication Synchronization Provider has been
265       *           removed from the server by another client.
266       * @throws AuthorizationException
267       *           If the server refuses to retrieve the Replication
268       *           Server because the client does not have the correct
269       *           privileges.
270       * @throws CommunicationException
271       *           If the client cannot contact the server due to an
272       *           underlying communication problem.
273       */
274      ReplicationServerCfgClient getReplicationServer()
275          throws DefinitionDecodingException, ManagedObjectDecodingException,
276          ManagedObjectNotFoundException, ConcurrentModificationException,
277          AuthorizationException, CommunicationException;
278    
279    
280    
281      /**
282       * Creates a new Replication Server. The new Replication Server will
283       * initially not contain any property values (including mandatory
284       * properties). Once the Replication Server has been configured it
285       * can be added to the server using the {@link #commit()} method.
286       *
287       * @param <C>
288       *          The type of the Replication Server being created.
289       * @param d
290       *          The definition of the Replication Server to be created.
291       * @param exceptions
292       *          An optional collection in which to place any {@link
293       *          DefaultBehaviorException}s that occurred whilst
294       *          attempting to determine the default values of the
295       *          Replication Server. This argument can be
296       *          <code>null<code>.
297       * @return Returns a new Replication Server configuration instance.
298       */
299      <C extends ReplicationServerCfgClient> C createReplicationServer(
300          ManagedObjectDefinition<C, ? extends ReplicationServerCfg> d, Collection<DefaultBehaviorException> exceptions);
301    
302    
303    
304      /**
305       * Removes the Replication Server if it exists.
306       *
307       * @throws ManagedObjectNotFoundException
308       *           If the Replication Server does not exist.
309       * @throws OperationRejectedException
310       *           If the server refuses to remove the Replication Server
311       *           due to some server-side constraint which cannot be
312       *           satisfied (for example, if it is referenced by another
313       *           managed object).
314       * @throws ConcurrentModificationException
315       *           If this Replication Synchronization Provider has been
316       *           removed from the server by another client.
317       * @throws AuthorizationException
318       *           If the server refuses to remove the Replication Server
319       *           because the client does not have the correct privileges.
320       * @throws CommunicationException
321       *           If the client cannot contact the server due to an
322       *           underlying communication problem.
323       */
324      void removeReplicationServer()
325          throws ManagedObjectNotFoundException, OperationRejectedException,
326          ConcurrentModificationException, AuthorizationException,
327          CommunicationException;
328    
329    }