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.client;
017
018
019
020import java.net.InetAddress;
021import java.util.Collection;
022import java.util.SortedSet;
023import org.forgerock.opendj.config.ConfigurationClient;
024import org.forgerock.opendj.config.ManagedObjectDefinition;
025import org.forgerock.opendj.config.PropertyException;
026import org.forgerock.opendj.server.config.server.ReplicationServerCfg;
027
028
029
030/**
031 * A client-side interface for reading and modifying Replication
032 * Server settings.
033 * <p>
034 * Replication Servers publish updates to Directory Servers within a
035 * Replication Domain.
036 */
037public interface ReplicationServerCfgClient extends ConfigurationClient {
038
039  /**
040   * Get the configuration definition associated with this Replication Server.
041   *
042   * @return Returns the configuration definition associated with this Replication Server.
043   */
044  ManagedObjectDefinition<? extends ReplicationServerCfgClient, ? extends ReplicationServerCfg> definition();
045
046
047
048  /**
049   * Gets the "assured-timeout" property.
050   * <p>
051   * The timeout value when waiting for assured mode acknowledgments.
052   * <p>
053   * Defines the number of milliseconds that the replication server
054   * will wait for assured acknowledgments (in either Safe Data or Safe
055   * Read assured sub modes) before forgetting them and answer to the
056   * entity that sent an update and is waiting for acknowledgment.
057   *
058   * @return Returns the value of the "assured-timeout" property.
059   */
060  long getAssuredTimeout();
061
062
063
064  /**
065   * Sets 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   * @param value The value of the "assured-timeout" property.
075   * @throws PropertyException
076   *           If the new value is invalid.
077   */
078  void setAssuredTimeout(Long value) throws PropertyException;
079
080
081
082  /**
083   * Gets the "cipher-key-length" property.
084   * <p>
085   * Specifies the key length in bits for the preferred cipher.
086   *
087   * @return Returns the value of the "cipher-key-length" property.
088   */
089  int getCipherKeyLength();
090
091
092
093  /**
094   * Sets the "cipher-key-length" property.
095   * <p>
096   * Specifies the key length in bits for the preferred cipher.
097   *
098   * @param value The value of the "cipher-key-length" property.
099   * @throws PropertyException
100   *           If the new value is invalid.
101   */
102  void setCipherKeyLength(Integer value) throws PropertyException;
103
104
105
106  /**
107   * Gets the "cipher-transformation" property.
108   * <p>
109   * Specifies the cipher for the directory server. The syntax is
110   * "algorithm/mode/padding".
111   * <p>
112   * The full transformation is required: specifying only an algorithm
113   * and allowing the cipher provider to supply the default mode and
114   * padding is not supported, because there is no guarantee these
115   * default values are the same among different implementations. Some
116   * cipher algorithms, including RC4 and ARCFOUR, do not have a mode
117   * or padding, and hence must be specified using NONE for the mode
118   * field and NoPadding for the padding field. For example,
119   * RC4/NONE/NoPadding.
120   *
121   * @return Returns the value of the "cipher-transformation" property.
122   */
123  String getCipherTransformation();
124
125
126
127  /**
128   * Sets the "cipher-transformation" property.
129   * <p>
130   * Specifies the cipher for the directory server. The syntax is
131   * "algorithm/mode/padding".
132   * <p>
133   * The full transformation is required: specifying only an algorithm
134   * and allowing the cipher provider to supply the default mode and
135   * padding is not supported, because there is no guarantee these
136   * default values are the same among different implementations. Some
137   * cipher algorithms, including RC4 and ARCFOUR, do not have a mode
138   * or padding, and hence must be specified using NONE for the mode
139   * field and NoPadding for the padding field. For example,
140   * RC4/NONE/NoPadding.
141   *
142   * @param value The value of the "cipher-transformation" property.
143   * @throws PropertyException
144   *           If the new value is invalid.
145   */
146  void setCipherTransformation(String value) throws PropertyException;
147
148
149
150  /**
151   * Gets the "compute-change-number" property.
152   * <p>
153   * Whether the replication server will compute change numbers.
154   * <p>
155   * This boolean tells the replication server to compute change
156   * numbers for each replicated change by maintaining a change number
157   * index database. Changenumbers are computed according to
158   * http://tools.ietf.org/html/draft-good-ldap-changelog-04. Note this
159   * functionality has an impact on CPU, disk accesses and storage. If
160   * changenumbers are not required, it is advisable to set this value
161   * to false.
162   *
163   * @return Returns the value of the "compute-change-number" property.
164   */
165  boolean isComputeChangeNumber();
166
167
168
169  /**
170   * Sets the "compute-change-number" property.
171   * <p>
172   * Whether the replication server will compute change numbers.
173   * <p>
174   * This boolean tells the replication server to compute change
175   * numbers for each replicated change by maintaining a change number
176   * index database. Changenumbers are computed according to
177   * http://tools.ietf.org/html/draft-good-ldap-changelog-04. Note this
178   * functionality has an impact on CPU, disk accesses and storage. If
179   * changenumbers are not required, it is advisable to set this value
180   * to false.
181   *
182   * @param value The value of the "compute-change-number" property.
183   * @throws PropertyException
184   *           If the new value is invalid.
185   */
186  void setComputeChangeNumber(Boolean value) throws PropertyException;
187
188
189
190  /**
191   * Gets the "confidentiality-enabled" property.
192   * <p>
193   * Indicates whether the replication change-log should make records
194   * readable only by Directory Server. Throughput and disk space are
195   * affected by the more expensive operations taking place.
196   * <p>
197   * Confidentiality is achieved by encrypting records on all domains
198   * managed by this replication server. Encrypting the records
199   * prevents unauthorized parties from accessing contents of LDAP
200   * operations. For complete protection, consider enabling secure
201   * communications between servers. Change number indexing is not
202   * affected by the setting.
203   *
204   * @return Returns the value of the "confidentiality-enabled" property.
205   */
206  boolean isConfidentialityEnabled();
207
208
209
210  /**
211   * Sets the "confidentiality-enabled" property.
212   * <p>
213   * Indicates whether the replication change-log should make records
214   * readable only by Directory Server. Throughput and disk space are
215   * affected by the more expensive operations taking place.
216   * <p>
217   * Confidentiality is achieved by encrypting records on all domains
218   * managed by this replication server. Encrypting the records
219   * prevents unauthorized parties from accessing contents of LDAP
220   * operations. For complete protection, consider enabling secure
221   * communications between servers. Change number indexing is not
222   * affected by the setting.
223   *
224   * @param value The value of the "confidentiality-enabled" property.
225   * @throws PropertyException
226   *           If the new value is invalid.
227   */
228  void setConfidentialityEnabled(Boolean value) throws PropertyException;
229
230
231
232  /**
233   * Gets the "degraded-status-threshold" property.
234   * <p>
235   * The number of pending changes as threshold value for putting a
236   * directory server in degraded status.
237   * <p>
238   * This value represents a number of pending changes a replication
239   * server has in queue for sending to a directory server. Once this
240   * value is crossed, the matching directory server goes in degraded
241   * status. When number of pending changes goes back under this value,
242   * the directory server is put back in normal status. 0 means status
243   * analyzer is disabled and directory servers are never put in
244   * degraded status.
245   *
246   * @return Returns the value of the "degraded-status-threshold" property.
247   */
248  int getDegradedStatusThreshold();
249
250
251
252  /**
253   * Sets the "degraded-status-threshold" property.
254   * <p>
255   * The number of pending changes as threshold value for putting a
256   * directory server in degraded status.
257   * <p>
258   * This value represents a number of pending changes a replication
259   * server has in queue for sending to a directory server. Once this
260   * value is crossed, the matching directory server goes in degraded
261   * status. When number of pending changes goes back under this value,
262   * the directory server is put back in normal status. 0 means status
263   * analyzer is disabled and directory servers are never put in
264   * degraded status.
265   *
266   * @param value The value of the "degraded-status-threshold" property.
267   * @throws PropertyException
268   *           If the new value is invalid.
269   */
270  void setDegradedStatusThreshold(Integer value) throws PropertyException;
271
272
273
274  /**
275   * Gets the "disk-full-threshold" property.
276   * <p>
277   * The free disk space threshold at which point a warning alert
278   * notification will be triggered and the replication server will
279   * disconnect from the rest of the replication topology.
280   * <p>
281   * When the available free space on the disk used by the replication
282   * changelog falls below the value specified, this replication server
283   * will stop. Connected Directory Servers will fail over to another
284   * RS. The replication server will restart again as soon as free
285   * space rises above the low threshold.
286   *
287   * @return Returns the value of the "disk-full-threshold" property.
288   */
289  long getDiskFullThreshold();
290
291
292
293  /**
294   * Sets the "disk-full-threshold" property.
295   * <p>
296   * The free disk space threshold at which point a warning alert
297   * notification will be triggered and the replication server will
298   * disconnect from the rest of the replication topology.
299   * <p>
300   * When the available free space on the disk used by the replication
301   * changelog falls below the value specified, this replication server
302   * will stop. Connected Directory Servers will fail over to another
303   * RS. The replication server will restart again as soon as free
304   * space rises above the low threshold.
305   *
306   * @param value The value of the "disk-full-threshold" property.
307   * @throws PropertyException
308   *           If the new value is invalid.
309   */
310  void setDiskFullThreshold(Long value) throws PropertyException;
311
312
313
314  /**
315   * Gets the "disk-low-threshold" property.
316   * <p>
317   * The free disk space threshold at which point a warning alert
318   * notification will be triggered.
319   * <p>
320   * When the available free space on the disk used by the replication
321   * changelog falls below the value specified, a warning is sent and
322   * logged. Normal operation will continue but administrators are
323   * advised to take action to free some disk space.
324   *
325   * @return Returns the value of the "disk-low-threshold" property.
326   */
327  long getDiskLowThreshold();
328
329
330
331  /**
332   * Sets the "disk-low-threshold" property.
333   * <p>
334   * The free disk space threshold at which point a warning alert
335   * notification will be triggered.
336   * <p>
337   * When the available free space on the disk used by the replication
338   * changelog falls below the value specified, a warning is sent and
339   * logged. Normal operation will continue but administrators are
340   * advised to take action to free some disk space.
341   *
342   * @param value The value of the "disk-low-threshold" property.
343   * @throws PropertyException
344   *           If the new value is invalid.
345   */
346  void setDiskLowThreshold(Long value) throws PropertyException;
347
348
349
350  /**
351   * Gets the "group-id" property.
352   * <p>
353   * The group id for the replication server.
354   * <p>
355   * This value defines the group id of the replication server. The
356   * replication system of a LDAP server uses the group id of the
357   * replicated domain and tries to connect, if possible, to a
358   * replication with the same group id.
359   *
360   * @return Returns the value of the "group-id" property.
361   */
362  int getGroupId();
363
364
365
366  /**
367   * Sets the "group-id" property.
368   * <p>
369   * The group id for the replication server.
370   * <p>
371   * This value defines the group id of the replication server. The
372   * replication system of a LDAP server uses the group id of the
373   * replicated domain and tries to connect, if possible, to a
374   * replication with the same group id.
375   *
376   * @param value The value of the "group-id" property.
377   * @throws PropertyException
378   *           If the new value is invalid.
379   */
380  void setGroupId(Integer value) throws PropertyException;
381
382
383
384  /**
385   * Gets the "monitoring-period" property.
386   * <p>
387   * The period between sending of monitoring messages.
388   * <p>
389   * Defines the duration that the replication server will wait before
390   * sending new monitoring messages to its peers (replication servers
391   * and directory servers). Larger values increase the length of time
392   * it takes for a directory server to detect and switch to a more
393   * suitable replication server, whereas smaller values increase the
394   * amount of background network traffic.
395   *
396   * @return Returns the value of the "monitoring-period" property.
397   */
398  long getMonitoringPeriod();
399
400
401
402  /**
403   * Sets the "monitoring-period" property.
404   * <p>
405   * The period between sending of monitoring messages.
406   * <p>
407   * Defines the duration that the replication server will wait before
408   * sending new monitoring messages to its peers (replication servers
409   * and directory servers). Larger values increase the length of time
410   * it takes for a directory server to detect and switch to a more
411   * suitable replication server, whereas smaller values increase the
412   * amount of background network traffic.
413   *
414   * @param value The value of the "monitoring-period" property.
415   * @throws PropertyException
416   *           If the new value is invalid.
417   */
418  void setMonitoringPeriod(Long value) throws PropertyException;
419
420
421
422  /**
423   * Gets the "queue-size" property.
424   * <p>
425   * Specifies the number of changes that are kept in memory for each
426   * directory server in the Replication Domain.
427   *
428   * @return Returns the value of the "queue-size" property.
429   */
430  int getQueueSize();
431
432
433
434  /**
435   * Sets the "queue-size" property.
436   * <p>
437   * Specifies the number of changes that are kept in memory for each
438   * directory server in the Replication Domain.
439   *
440   * @param value The value of the "queue-size" property.
441   * @throws PropertyException
442   *           If the new value is invalid.
443   */
444  void setQueueSize(Integer value) throws PropertyException;
445
446
447
448  /**
449   * Gets the "replication-db-directory" property.
450   * <p>
451   * The path where the Replication Server stores all persistent
452   * information.
453   *
454   * @return Returns the value of the "replication-db-directory" property.
455   */
456  String getReplicationDBDirectory();
457
458
459
460  /**
461   * Sets the "replication-db-directory" property.
462   * <p>
463   * The path where the Replication Server stores all persistent
464   * information.
465   * <p>
466   * This property is read-only and can only be modified during
467   * creation of a Replication Server.
468   *
469   * @param value The value of the "replication-db-directory" property.
470   * @throws PropertyException
471   *           If the new value is invalid.
472   * @throws PropertyException
473   *           If this Replication Server is not being initialized.
474   */
475  void setReplicationDBDirectory(String value) throws PropertyException, PropertyException;
476
477
478
479  /**
480   * Gets the "replication-port" property.
481   * <p>
482   * The port on which this Replication Server waits for connections
483   * from other Replication Servers or Directory Servers.
484   *
485   * @return Returns the value of the "replication-port" property.
486   */
487  Integer getReplicationPort();
488
489
490
491  /**
492   * Sets the "replication-port" property.
493   * <p>
494   * The port on which this Replication Server waits for connections
495   * from other Replication Servers or Directory Servers.
496   *
497   * @param value The value of the "replication-port" property.
498   * @throws PropertyException
499   *           If the new value is invalid.
500   */
501  void setReplicationPort(int value) throws PropertyException;
502
503
504
505  /**
506   * Gets the "replication-purge-delay" property.
507   * <p>
508   * The time (in seconds) after which the Replication Server erases
509   * all persistent information.
510   *
511   * @return Returns the value of the "replication-purge-delay" property.
512   */
513  long getReplicationPurgeDelay();
514
515
516
517  /**
518   * Sets the "replication-purge-delay" property.
519   * <p>
520   * The time (in seconds) after which the Replication Server erases
521   * all persistent information.
522   *
523   * @param value The value of the "replication-purge-delay" property.
524   * @throws PropertyException
525   *           If the new value is invalid.
526   */
527  void setReplicationPurgeDelay(Long value) throws PropertyException;
528
529
530
531  /**
532   * Gets the "replication-server" property.
533   * <p>
534   * Specifies the addresses of other Replication Servers to which
535   * this Replication Server tries to connect at startup time.
536   * <p>
537   * Addresses must be specified using the syntax: "hostname:port". If
538   * IPv6 addresses are used as the hostname, they must be specified
539   * using the syntax "[IPv6Address]:port".
540   *
541   * @return Returns the values of the "replication-server" property.
542   */
543  SortedSet<String> getReplicationServer();
544
545
546
547  /**
548   * Sets the "replication-server" property.
549   * <p>
550   * Specifies the addresses of other Replication Servers to which
551   * this Replication Server tries to connect at startup time.
552   * <p>
553   * Addresses must be specified using the syntax: "hostname:port". If
554   * IPv6 addresses are used as the hostname, they must be specified
555   * using the syntax "[IPv6Address]:port".
556   *
557   * @param values The values of the "replication-server" property.
558   * @throws PropertyException
559   *           If one or more of the new values are invalid.
560   */
561  void setReplicationServer(Collection<String> values) throws PropertyException;
562
563
564
565  /**
566   * Gets the "replication-server-id" property.
567   * <p>
568   * Specifies a unique identifier for the Replication Server.
569   * <p>
570   * Each Replication Server must have a different server ID.
571   *
572   * @return Returns the value of the "replication-server-id" property.
573   */
574  Integer getReplicationServerId();
575
576
577
578  /**
579   * Sets the "replication-server-id" property.
580   * <p>
581   * Specifies a unique identifier for the Replication Server.
582   * <p>
583   * Each Replication Server must have a different server ID.
584   * <p>
585   * This property is read-only and can only be modified during
586   * creation of a Replication Server.
587   *
588   * @param value The value of the "replication-server-id" property.
589   * @throws PropertyException
590   *           If the new value is invalid.
591   * @throws PropertyException
592   *           If this Replication Server is not being initialized.
593   */
594  void setReplicationServerId(int value) throws PropertyException, PropertyException;
595
596
597
598  /**
599   * Gets the "source-address" property.
600   * <p>
601   * If specified, the server will bind to the address before
602   * connecting to the remote server.
603   * <p>
604   * The address must be one assigned to an existing network
605   * interface.
606   *
607   * @return Returns the value of the "source-address" property.
608   */
609  InetAddress getSourceAddress();
610
611
612
613  /**
614   * Sets the "source-address" property.
615   * <p>
616   * If specified, the server will bind to the address before
617   * connecting to the remote server.
618   * <p>
619   * The address must be one assigned to an existing network
620   * interface.
621   *
622   * @param value The value of the "source-address" property.
623   * @throws PropertyException
624   *           If the new value is invalid.
625   */
626  void setSourceAddress(InetAddress value) throws PropertyException;
627
628
629
630  /**
631   * Gets the "weight" property.
632   * <p>
633   * The weight of the replication server.
634   * <p>
635   * The weight affected to the replication server. Each replication
636   * server of the topology has a weight. When combined together, the
637   * weights of the replication servers of a same group can be
638   * translated to a percentage that determines the quantity of
639   * directory servers of the topology that should be connected to a
640   * replication server. For instance imagine a topology with 3
641   * replication servers (with the same group id) with the following
642   * weights: RS1=1, RS2=1, RS3=2. This means that RS1 should have 25%
643   * of the directory servers connected in the topology, RS2 25%, and
644   * RS3 50%. This may be useful if the replication servers of the
645   * topology have a different power and one wants to spread the load
646   * between the replication servers according to their power.
647   *
648   * @return Returns the value of the "weight" property.
649   */
650  int getWeight();
651
652
653
654  /**
655   * Sets the "weight" property.
656   * <p>
657   * The weight of the replication server.
658   * <p>
659   * The weight affected to the replication server. Each replication
660   * server of the topology has a weight. When combined together, the
661   * weights of the replication servers of a same group can be
662   * translated to a percentage that determines the quantity of
663   * directory servers of the topology that should be connected to a
664   * replication server. For instance imagine a topology with 3
665   * replication servers (with the same group id) with the following
666   * weights: RS1=1, RS2=1, RS3=2. This means that RS1 should have 25%
667   * of the directory servers connected in the topology, RS2 25%, and
668   * RS3 50%. This may be useful if the replication servers of the
669   * topology have a different power and one wants to spread the load
670   * between the replication servers according to their power.
671   *
672   * @param value The value of the "weight" property.
673   * @throws PropertyException
674   *           If the new value is invalid.
675   */
676  void setWeight(Integer value) throws PropertyException;
677
678
679
680  /**
681   * Gets the "window-size" property.
682   * <p>
683   * Specifies the window size that the Replication Server uses when
684   * communicating with other Replication Servers.
685   * <p>
686   * This option may be deprecated and removed in future releases.
687   *
688   * @return Returns the value of the "window-size" property.
689   */
690  int getWindowSize();
691
692
693
694  /**
695   * Sets the "window-size" property.
696   * <p>
697   * Specifies the window size that the Replication Server uses when
698   * communicating with other Replication Servers.
699   * <p>
700   * This option may be deprecated and removed in future releases.
701   *
702   * @param value The value of the "window-size" property.
703   * @throws PropertyException
704   *           If the new value is invalid.
705   */
706  void setWindowSize(Integer value) throws PropertyException;
707
708}