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 java.net.InetAddress;
021import java.util.SortedSet;
022import org.forgerock.opendj.config.Configuration;
023import org.forgerock.opendj.config.server.ConfigException;
024import org.forgerock.opendj.config.server.ConfigurationChangeListener;
025import org.forgerock.opendj.ldap.DN;
026import org.forgerock.opendj.server.config.meta.ReplicationDomainCfgDefn.AssuredType;
027import org.forgerock.opendj.server.config.meta.ReplicationDomainCfgDefn.IsolationPolicy;
028
029
030
031/**
032 * A server-side interface for querying Replication Domain settings.
033 * <p>
034 * A Replication Domain comprises of several Directory Servers sharing
035 * the same synchronized set of data.
036 */
037public interface ReplicationDomainCfg extends Configuration {
038
039  /**
040   * Gets the configuration class associated with this Replication Domain.
041   *
042   * @return Returns the configuration class associated with this Replication Domain.
043   */
044  Class<? extends ReplicationDomainCfg> configurationClass();
045
046
047
048  /**
049   * Register to be notified when this Replication Domain is changed.
050   *
051   * @param listener
052   *          The Replication Domain configuration change listener.
053   */
054  void addChangeListener(ConfigurationChangeListener<ReplicationDomainCfg> listener);
055
056
057
058  /**
059   * Deregister an existing Replication Domain configuration change listener.
060   *
061   * @param listener
062   *          The Replication Domain configuration change listener.
063   */
064  void removeChangeListener(ConfigurationChangeListener<ReplicationDomainCfg> listener);
065
066
067
068  /**
069   * Gets the "assured-sd-level" property.
070   * <p>
071   * The level of acknowledgment for Safe Data assured sub mode.
072   * <p>
073   * When assured replication is configured in Safe Data mode, this
074   * value defines the number of replication servers (with the same
075   * group ID of the local server) that should acknowledge the sent
076   * update before the LDAP client call can return.
077   *
078   * @return Returns the value of the "assured-sd-level" property.
079   */
080  int getAssuredSdLevel();
081
082
083
084  /**
085   * Gets the "assured-timeout" property.
086   * <p>
087   * The timeout value when waiting for assured replication
088   * acknowledgments.
089   * <p>
090   * Defines the amount of milliseconds the server will wait for
091   * assured acknowledgments (in either Safe Data or Safe Read assured
092   * replication modes) before returning anyway the LDAP client call.
093   *
094   * @return Returns the value of the "assured-timeout" property.
095   */
096  long getAssuredTimeout();
097
098
099
100  /**
101   * Gets the "assured-type" property.
102   * <p>
103   * Defines the assured replication mode of the replicated domain.
104   * <p>
105   * The assured replication can be disabled or enabled. When enabled,
106   * two modes are available: Safe Data or Safe Read modes.
107   *
108   * @return Returns the value of the "assured-type" property.
109   */
110  AssuredType getAssuredType();
111
112
113
114  /**
115   * Gets the "base-dn" property.
116   * <p>
117   * Specifies the base DN of the replicated data.
118   *
119   * @return Returns the value of the "base-dn" property.
120   */
121  DN getBaseDN();
122
123
124
125  /**
126   * Gets the "changetime-heartbeat-interval" property.
127   * <p>
128   * Specifies the heart-beat interval that the directory server will
129   * use when sending its local change time to the Replication Server.
130   * <p>
131   * The directory server sends a regular heart-beat to the
132   * Replication within the specified interval. The heart-beat
133   * indicates the change time of the directory server to the
134   * Replication Server.
135   *
136   * @return Returns the value of the "changetime-heartbeat-interval" property.
137   */
138  long getChangetimeHeartbeatInterval();
139
140
141
142  /**
143   * Gets the "conflicts-historical-purge-delay" property.
144   * <p>
145   * This delay indicates the time (in minutes) the domain keeps the
146   * historical information necessary to solve conflicts.When a change
147   * stored in the historical part of the user entry has a date (from
148   * its replication ChangeNumber) older than this delay, it is
149   * candidate to be purged. The purge is applied on 2 events: modify
150   * of the entry, dedicated purge task.
151   *
152   * @return Returns the value of the "conflicts-historical-purge-delay" property.
153   */
154  long getConflictsHistoricalPurgeDelay();
155
156
157
158  /**
159   * Gets the "fractional-exclude" property.
160   * <p>
161   * Allows to exclude some attributes to replicate to this server.
162   * <p>
163   * If fractional-exclude configuration attribute is used, attributes
164   * specified in this attribute will be ignored (not
165   * added/modified/deleted) when an operation performed from another
166   * directory server is being replayed in the local server. Note that
167   * the usage of this configuration attribute is mutually exclusive
168   * with the usage of the fractional-include attribute.
169   *
170   * @return Returns an unmodifiable set containing the values of the "fractional-exclude" property.
171   */
172  SortedSet<String> getFractionalExclude();
173
174
175
176  /**
177   * Gets the "fractional-include" property.
178   * <p>
179   * Allows to include some attributes to replicate to this server.
180   * <p>
181   * If fractional-include configuration attribute is used, only
182   * attributes specified in this attribute will be
183   * added/modified/deleted when an operation performed from another
184   * directory server is being replayed in the local server. Note that
185   * the usage of this configuration attribute is mutually exclusive
186   * with the usage of the fractional-exclude attribute.
187   *
188   * @return Returns an unmodifiable set containing the values of the "fractional-include" property.
189   */
190  SortedSet<String> getFractionalInclude();
191
192
193
194  /**
195   * Gets the "group-id" property.
196   * <p>
197   * The group ID associated with this replicated domain.
198   * <p>
199   * This value defines the group ID of the replicated domain. The
200   * replication system will preferably connect and send updates to
201   * replicate to a replication server with the same group ID as its
202   * own one (the local server group ID).
203   *
204   * @return Returns the value of the "group-id" property.
205   */
206  int getGroupId();
207
208
209
210  /**
211   * Gets the "heartbeat-interval" property.
212   * <p>
213   * Specifies the heart-beat interval that the directory server will
214   * use when communicating with Replication Servers.
215   * <p>
216   * The directory server expects a regular heart-beat coming from the
217   * Replication Server within the specified interval. If a heartbeat
218   * is not received within the interval, the Directory Server closes
219   * its connection and connects to another Replication Server.
220   *
221   * @return Returns the value of the "heartbeat-interval" property.
222   */
223  long getHeartbeatInterval();
224
225
226
227  /**
228   * Gets the "initialization-window-size" property.
229   * <p>
230   * Specifies the window size that this directory server may use when
231   * communicating with remote Directory Servers for initialization.
232   *
233   * @return Returns the value of the "initialization-window-size" property.
234   */
235  int getInitializationWindowSize();
236
237
238
239  /**
240   * Gets the "isolation-policy" property.
241   * <p>
242   * Specifies the behavior of the directory server if a write
243   * operation is attempted on the data within the Replication Domain
244   * when none of the configured Replication Servers are available.
245   *
246   * @return Returns the value of the "isolation-policy" property.
247   */
248  IsolationPolicy getIsolationPolicy();
249
250
251
252  /**
253   * Gets the "log-changenumber" property.
254   * <p>
255   * Indicates if this server logs the ChangeNumber in access log.
256   * <p>
257   * This boolean indicates if the domain should log the ChangeNumber
258   * of replicated operations in the access log.
259   *
260   * @return Returns the value of the "log-changenumber" property.
261   */
262  boolean isLogChangenumber();
263
264
265
266  /**
267   * Gets the "referrals-url" property.
268   * <p>
269   * The URLs other LDAP servers should use to refer to the local
270   * server.
271   * <p>
272   * URLs used by peer servers in the topology to refer to the local
273   * server through LDAP referrals. If this attribute is not defined,
274   * every URLs available to access this server will be used. If
275   * defined, only URLs specified here will be used.
276   *
277   * @return Returns an unmodifiable set containing the values of the "referrals-url" property.
278   */
279  SortedSet<String> getReferralsUrl();
280
281
282
283  /**
284   * Gets the "replication-server" property.
285   * <p>
286   * Specifies the addresses of the Replication Servers within the
287   * Replication Domain to which the directory server should try to
288   * connect at startup time.
289   * <p>
290   * Addresses must be specified using the syntax: hostname:port
291   *
292   * @return Returns an unmodifiable set containing the values of the "replication-server" property.
293   */
294  SortedSet<String> getReplicationServer();
295
296
297
298  /**
299   * Gets the "server-id" property.
300   * <p>
301   * Specifies a unique identifier for the directory server within the
302   * Replication Domain.
303   * <p>
304   * Each directory server within the same Replication Domain must
305   * have a different server ID. A directory server which is a member
306   * of multiple Replication Domains may use the same server ID for
307   * each of its Replication Domain configurations.
308   *
309   * @return Returns the value of the "server-id" property.
310   */
311  int getServerId();
312
313
314
315  /**
316   * Gets the "solve-conflicts" property.
317   * <p>
318   * Indicates if this server solves conflict.
319   * <p>
320   * This boolean indicates if this domain keeps the historical
321   * information necessary to solve conflicts. When set to false the
322   * server will not maintain historical information and will therefore
323   * not be able to solve conflict. This should therefore be done only
324   * if the replication is used in a single master type of deployment.
325   *
326   * @return Returns the value of the "solve-conflicts" property.
327   */
328  boolean isSolveConflicts();
329
330
331
332  /**
333   * Gets the "source-address" property.
334   * <p>
335   * If specified, the server will bind to the address before
336   * connecting to the remote server.
337   * <p>
338   * The address must be one assigned to an existing network
339   * interface.
340   *
341   * @return Returns the value of the "source-address" property.
342   */
343  InetAddress getSourceAddress();
344
345
346
347  /**
348   * Gets the "window-size" property.
349   * <p>
350   * Specifies the window size that the directory server will use when
351   * communicating with Replication Servers.
352   * <p>
353   * This option may be deprecated and removed in future releases.
354   *
355   * @return Returns the value of the "window-size" property.
356   */
357  int getWindowSize();
358
359
360
361  /**
362   * Gets the External Changelog Domain.
363   *
364   * @return Returns the External Changelog Domain.
365   * @throws ConfigException
366   *           If the External Changelog Domain could not be found or it could not
367   *           be successfully decoded.
368   */
369  ExternalChangelogDomainCfg getExternalChangelogDomain() throws ConfigException;
370
371}