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.ConfigurationChangeListener;
024
025
026
027/**
028 * A server-side interface for querying Replication Server settings.
029 * <p>
030 * Replication Servers publish updates to Directory Servers within a
031 * Replication Domain.
032 */
033public interface ReplicationServerCfg extends Configuration {
034
035  /**
036   * Gets the configuration class associated with this Replication Server.
037   *
038   * @return Returns the configuration class associated with this Replication Server.
039   */
040  Class<? extends ReplicationServerCfg> configurationClass();
041
042
043
044  /**
045   * Register to be notified when this Replication Server is changed.
046   *
047   * @param listener
048   *          The Replication Server configuration change listener.
049   */
050  void addChangeListener(ConfigurationChangeListener<ReplicationServerCfg> listener);
051
052
053
054  /**
055   * Deregister an existing Replication Server configuration change listener.
056   *
057   * @param listener
058   *          The Replication Server configuration change listener.
059   */
060  void removeChangeListener(ConfigurationChangeListener<ReplicationServerCfg> listener);
061
062
063
064  /**
065   * Gets the "assured-timeout" property.
066   * <p>
067   * The timeout value when waiting for assured mode acknowledgments.
068   * <p>
069   * Defines the number of milliseconds that the replication server
070   * will wait for assured acknowledgments (in either Safe Data or Safe
071   * Read assured sub modes) before forgetting them and answer to the
072   * entity that sent an update and is waiting for acknowledgment.
073   *
074   * @return Returns the value of the "assured-timeout" property.
075   */
076  long getAssuredTimeout();
077
078
079
080  /**
081   * Gets the "cipher-key-length" property.
082   * <p>
083   * Specifies the key length in bits for the preferred cipher.
084   *
085   * @return Returns the value of the "cipher-key-length" property.
086   */
087  int getCipherKeyLength();
088
089
090
091  /**
092   * Gets the "cipher-transformation" property.
093   * <p>
094   * Specifies the cipher for the directory server. The syntax is
095   * "algorithm/mode/padding".
096   * <p>
097   * The full transformation is required: specifying only an algorithm
098   * and allowing the cipher provider to supply the default mode and
099   * padding is not supported, because there is no guarantee these
100   * default values are the same among different implementations. Some
101   * cipher algorithms, including RC4 and ARCFOUR, do not have a mode
102   * or padding, and hence must be specified using NONE for the mode
103   * field and NoPadding for the padding field. For example,
104   * RC4/NONE/NoPadding.
105   *
106   * @return Returns the value of the "cipher-transformation" property.
107   */
108  String getCipherTransformation();
109
110
111
112  /**
113   * Gets the "compute-change-number" property.
114   * <p>
115   * Whether the replication server will compute change numbers.
116   * <p>
117   * This boolean tells the replication server to compute change
118   * numbers for each replicated change by maintaining a change number
119   * index database. Changenumbers are computed according to
120   * http://tools.ietf.org/html/draft-good-ldap-changelog-04. Note this
121   * functionality has an impact on CPU, disk accesses and storage. If
122   * changenumbers are not required, it is advisable to set this value
123   * to false.
124   *
125   * @return Returns the value of the "compute-change-number" property.
126   */
127  boolean isComputeChangeNumber();
128
129
130
131  /**
132   * Gets the "confidentiality-enabled" property.
133   * <p>
134   * Indicates whether the replication change-log should make records
135   * readable only by Directory Server. Throughput and disk space are
136   * affected by the more expensive operations taking place.
137   * <p>
138   * Confidentiality is achieved by encrypting records on all domains
139   * managed by this replication server. Encrypting the records
140   * prevents unauthorized parties from accessing contents of LDAP
141   * operations. For complete protection, consider enabling secure
142   * communications between servers. Change number indexing is not
143   * affected by the setting.
144   *
145   * @return Returns the value of the "confidentiality-enabled" property.
146   */
147  boolean isConfidentialityEnabled();
148
149
150
151  /**
152   * Gets the "degraded-status-threshold" property.
153   * <p>
154   * The number of pending changes as threshold value for putting a
155   * directory server in degraded status.
156   * <p>
157   * This value represents a number of pending changes a replication
158   * server has in queue for sending to a directory server. Once this
159   * value is crossed, the matching directory server goes in degraded
160   * status. When number of pending changes goes back under this value,
161   * the directory server is put back in normal status. 0 means status
162   * analyzer is disabled and directory servers are never put in
163   * degraded status.
164   *
165   * @return Returns the value of the "degraded-status-threshold" property.
166   */
167  int getDegradedStatusThreshold();
168
169
170
171  /**
172   * Gets the "disk-full-threshold" property.
173   * <p>
174   * The free disk space threshold at which point a warning alert
175   * notification will be triggered and the replication server will
176   * disconnect from the rest of the replication topology.
177   * <p>
178   * When the available free space on the disk used by the replication
179   * changelog falls below the value specified, this replication server
180   * will stop. Connected Directory Servers will fail over to another
181   * RS. The replication server will restart again as soon as free
182   * space rises above the low threshold.
183   *
184   * @return Returns the value of the "disk-full-threshold" property.
185   */
186  long getDiskFullThreshold();
187
188
189
190  /**
191   * Gets the "disk-low-threshold" property.
192   * <p>
193   * The free disk space threshold at which point a warning alert
194   * notification will be triggered.
195   * <p>
196   * When the available free space on the disk used by the replication
197   * changelog falls below the value specified, a warning is sent and
198   * logged. Normal operation will continue but administrators are
199   * advised to take action to free some disk space.
200   *
201   * @return Returns the value of the "disk-low-threshold" property.
202   */
203  long getDiskLowThreshold();
204
205
206
207  /**
208   * Gets the "group-id" property.
209   * <p>
210   * The group id for the replication server.
211   * <p>
212   * This value defines the group id of the replication server. The
213   * replication system of a LDAP server uses the group id of the
214   * replicated domain and tries to connect, if possible, to a
215   * replication with the same group id.
216   *
217   * @return Returns the value of the "group-id" property.
218   */
219  int getGroupId();
220
221
222
223  /**
224   * Gets the "monitoring-period" property.
225   * <p>
226   * The period between sending of monitoring messages.
227   * <p>
228   * Defines the duration that the replication server will wait before
229   * sending new monitoring messages to its peers (replication servers
230   * and directory servers). Larger values increase the length of time
231   * it takes for a directory server to detect and switch to a more
232   * suitable replication server, whereas smaller values increase the
233   * amount of background network traffic.
234   *
235   * @return Returns the value of the "monitoring-period" property.
236   */
237  long getMonitoringPeriod();
238
239
240
241  /**
242   * Gets the "queue-size" property.
243   * <p>
244   * Specifies the number of changes that are kept in memory for each
245   * directory server in the Replication Domain.
246   *
247   * @return Returns the value of the "queue-size" property.
248   */
249  int getQueueSize();
250
251
252
253  /**
254   * Gets the "replication-db-directory" property.
255   * <p>
256   * The path where the Replication Server stores all persistent
257   * information.
258   *
259   * @return Returns the value of the "replication-db-directory" property.
260   */
261  String getReplicationDBDirectory();
262
263
264
265  /**
266   * Gets the "replication-port" property.
267   * <p>
268   * The port on which this Replication Server waits for connections
269   * from other Replication Servers or Directory Servers.
270   *
271   * @return Returns the value of the "replication-port" property.
272   */
273  int getReplicationPort();
274
275
276
277  /**
278   * Gets the "replication-purge-delay" property.
279   * <p>
280   * The time (in seconds) after which the Replication Server erases
281   * all persistent information.
282   *
283   * @return Returns the value of the "replication-purge-delay" property.
284   */
285  long getReplicationPurgeDelay();
286
287
288
289  /**
290   * Gets the "replication-server" property.
291   * <p>
292   * Specifies the addresses of other Replication Servers to which
293   * this Replication Server tries to connect at startup time.
294   * <p>
295   * Addresses must be specified using the syntax: "hostname:port". If
296   * IPv6 addresses are used as the hostname, they must be specified
297   * using the syntax "[IPv6Address]:port".
298   *
299   * @return Returns an unmodifiable set containing the values of the "replication-server" property.
300   */
301  SortedSet<String> getReplicationServer();
302
303
304
305  /**
306   * Gets the "replication-server-id" property.
307   * <p>
308   * Specifies a unique identifier for the Replication Server.
309   * <p>
310   * Each Replication Server must have a different server ID.
311   *
312   * @return Returns the value of the "replication-server-id" property.
313   */
314  int getReplicationServerId();
315
316
317
318  /**
319   * Gets the "source-address" property.
320   * <p>
321   * If specified, the server will bind to the address before
322   * connecting to the remote server.
323   * <p>
324   * The address must be one assigned to an existing network
325   * interface.
326   *
327   * @return Returns the value of the "source-address" property.
328   */
329  InetAddress getSourceAddress();
330
331
332
333  /**
334   * Gets the "weight" property.
335   * <p>
336   * The weight of the replication server.
337   * <p>
338   * The weight affected to the replication server. Each replication
339   * server of the topology has a weight. When combined together, the
340   * weights of the replication servers of a same group can be
341   * translated to a percentage that determines the quantity of
342   * directory servers of the topology that should be connected to a
343   * replication server. For instance imagine a topology with 3
344   * replication servers (with the same group id) with the following
345   * weights: RS1=1, RS2=1, RS3=2. This means that RS1 should have 25%
346   * of the directory servers connected in the topology, RS2 25%, and
347   * RS3 50%. This may be useful if the replication servers of the
348   * topology have a different power and one wants to spread the load
349   * between the replication servers according to their power.
350   *
351   * @return Returns the value of the "weight" property.
352   */
353  int getWeight();
354
355
356
357  /**
358   * Gets the "window-size" property.
359   * <p>
360   * Specifies the window size that the Replication Server uses when
361   * communicating with other Replication Servers.
362   * <p>
363   * This option may be deprecated and removed in future releases.
364   *
365   * @return Returns the value of the "window-size" property.
366   */
367  int getWindowSize();
368
369}