001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 */
016package org.forgerock.opendj.server.config.server;
017
018
019
020import org.forgerock.opendj.config.server.ConfigException;
021import org.forgerock.opendj.config.server.ConfigurationAddListener;
022import org.forgerock.opendj.config.server.ConfigurationChangeListener;
023import org.forgerock.opendj.config.server.ConfigurationDeleteListener;
024
025
026
027/**
028 * A server-side interface for querying Replication Synchronization
029 * Provider settings.
030 * <p>
031 * The Replication Synchronization Provider provides multi-master
032 * replication of data across multiple directory server instances.
033 */
034public interface ReplicationSynchronizationProviderCfg extends SynchronizationProviderCfg {
035
036  /**
037   * Gets the configuration class associated with this Replication Synchronization Provider.
038   *
039   * @return Returns the configuration class associated with this Replication Synchronization Provider.
040   */
041  Class<? extends ReplicationSynchronizationProviderCfg> configurationClass();
042
043
044
045  /**
046   * Register to be notified when this Replication Synchronization Provider is changed.
047   *
048   * @param listener
049   *          The Replication Synchronization Provider configuration change listener.
050   */
051  void addReplicationChangeListener(ConfigurationChangeListener<ReplicationSynchronizationProviderCfg> listener);
052
053
054
055  /**
056   * Deregister an existing Replication Synchronization Provider configuration change listener.
057   *
058   * @param listener
059   *          The Replication Synchronization Provider configuration change listener.
060   */
061  void removeReplicationChangeListener(ConfigurationChangeListener<ReplicationSynchronizationProviderCfg> listener);
062
063
064
065  /**
066   * Gets the "connection-timeout" property.
067   * <p>
068   * Specifies the timeout used when connecting to peers and when
069   * performing SSL negotiation.
070   *
071   * @return Returns the value of the "connection-timeout" property.
072   */
073  long getConnectionTimeout();
074
075
076
077  /**
078   * Gets the "java-class" property.
079   * <p>
080   * Specifies the fully-qualified name of the Java class that
081   * provides the Replication Synchronization Provider implementation.
082   *
083   * @return Returns the value of the "java-class" property.
084   */
085  String getJavaClass();
086
087
088
089  /**
090   * Gets the "num-update-replay-threads" property.
091   * <p>
092   * Specifies the number of update replay threads.
093   * <p>
094   * This value is the number of threads created for replaying every
095   * updates received for all the replication domains.
096   *
097   * @return Returns the value of the "num-update-replay-threads" property.
098   */
099  Integer getNumUpdateReplayThreads();
100
101
102
103  /**
104   * Lists the Replication Domains.
105   *
106   * @return Returns an array containing the names of the
107   *         Replication Domains.
108   */
109  String[] listReplicationDomains();
110
111
112
113  /**
114   * Gets the named Replication Domain.
115   *
116   * @param name
117   *          The name of the Replication Domain to retrieve.
118   * @return Returns the named Replication Domain.
119   * @throws ConfigException
120   *           If the Replication Domain could not be found or it
121   *           could not be successfully decoded.
122   */
123  ReplicationDomainCfg getReplicationDomain(String name) throws ConfigException;
124
125
126
127  /**
128   * Registers to be notified when new Replication Domains are added.
129   *
130   * @param listener
131   *          The Replication Domain configuration add listener.
132   * @throws ConfigException
133   *          If the add listener could not be registered.
134   */
135  void addReplicationDomainAddListener(ConfigurationAddListener<ReplicationDomainCfg> listener) throws ConfigException;
136
137
138
139  /**
140   * Deregisters an existing Replication Domain configuration add listener.
141   *
142   * @param listener
143   *          The Replication Domain configuration add listener.
144   */
145  void removeReplicationDomainAddListener(ConfigurationAddListener<ReplicationDomainCfg> listener);
146
147
148
149  /**
150   * Registers to be notified when existing Replication Domains are deleted.
151   *
152   * @param listener
153   *          The Replication Domain configuration delete listener.
154   * @throws ConfigException
155   *          If the delete listener could not be registered.
156   */
157  void addReplicationDomainDeleteListener(ConfigurationDeleteListener<ReplicationDomainCfg> listener) throws ConfigException;
158
159
160
161  /**
162   * Deregisters an existing Replication Domain configuration delete listener.
163   *
164   * @param listener
165   *          The Replication Domain configuration delete listener.
166   */
167  void removeReplicationDomainDeleteListener(ConfigurationDeleteListener<ReplicationDomainCfg> listener);
168
169
170
171  /**
172   * Determines whether the Replication Server exists.
173   *
174   * @return Returns <true> if the Replication Server exists.
175   */
176  boolean hasReplicationServer();
177
178
179
180  /**
181   * Gets the Replication Server if it is present.
182   *
183   * @return Returns the Replication Server if it is present.
184   * @throws ConfigException
185   *           If the Replication Server does not exist or it could not
186   *           be successfully decoded.
187   */
188  ReplicationServerCfg getReplicationServer() throws ConfigException;
189
190
191
192  /**
193   * Registers to be notified when the Replication Server is added.
194   *
195   * @param listener
196   *          The Replication Server configuration add listener.
197   * @throws ConfigException
198   *          If the add listener could not be registered.
199   */
200  void addReplicationServerAddListener(ConfigurationAddListener<ReplicationServerCfg> listener) throws ConfigException;
201
202
203
204  /**
205   * Deregisters an existing Replication Server configuration add listener.
206   *
207   * @param listener
208   *          The Replication Server configuration add listener.
209   */
210  void removeReplicationServerAddListener(ConfigurationAddListener<ReplicationServerCfg> listener);
211
212
213
214  /**
215   * Registers to be notified the Replication Server is deleted.
216   *
217   * @param listener
218   *          The Replication Server configuration delete listener.
219   * @throws ConfigException
220   *          If the delete listener could not be registered.
221   */
222  void addReplicationServerDeleteListener(ConfigurationDeleteListener<ReplicationServerCfg> listener) throws ConfigException;
223
224
225
226  /**
227   * Deregisters an existing Replication Server configuration delete listener.
228   *
229   * @param listener
230   *          The Replication Server configuration delete listener.
231   */
232  void removeReplicationServerDeleteListener(ConfigurationDeleteListener<ReplicationServerCfg> listener);
233
234}