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