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.client;
027
028
029
030import java.net.InetAddress;
031import java.util.Collection;
032import java.util.SortedSet;
033import org.opends.server.admin.ConfigurationClient;
034import org.opends.server.admin.ManagedObjectDefinition;
035import org.opends.server.admin.PropertyException;
036import org.opends.server.admin.std.meta.ReplicationServerCfgDefn.ReplicationDBImplementation;
037import org.opends.server.admin.std.server.ReplicationServerCfg;
038
039
040
041/**
042 * A client-side interface for reading and modifying Replication
043 * Server settings.
044 * <p>
045 * Replication Servers publish updates to Directory Servers within a
046 * Replication Domain.
047 */
048public interface ReplicationServerCfgClient extends ConfigurationClient {
049
050  /**
051   * Get the configuration definition associated with this Replication Server.
052   *
053   * @return Returns the configuration definition associated with this Replication Server.
054   */
055  ManagedObjectDefinition<? extends ReplicationServerCfgClient, ? extends ReplicationServerCfg> definition();
056
057
058
059  /**
060   * Gets the "assured-timeout" property.
061   * <p>
062   * The timeout value when waiting for assured mode acknowledgments.
063   * <p>
064   * Defines the number of milliseconds that the replication server
065   * will wait for assured acknowledgments (in either Safe Data or Safe
066   * Read assured sub modes) before forgetting them and answer to the
067   * entity that sent an update and is waiting for acknowledgment.
068   *
069   * @return Returns the value of the "assured-timeout" property.
070   */
071  long getAssuredTimeout();
072
073
074
075  /**
076   * Sets the "assured-timeout" property.
077   * <p>
078   * The timeout value when waiting for assured mode acknowledgments.
079   * <p>
080   * Defines the number of milliseconds that the replication server
081   * will wait for assured acknowledgments (in either Safe Data or Safe
082   * Read assured sub modes) before forgetting them and answer to the
083   * entity that sent an update and is waiting for acknowledgment.
084   *
085   * @param value The value of the "assured-timeout" property.
086   * @throws PropertyException
087   *           If the new value is invalid.
088   */
089  void setAssuredTimeout(Long value) throws PropertyException;
090
091
092
093  /**
094   * Gets the "compute-change-number" property.
095   * <p>
096   * Whether the replication server will compute change numbers.
097   * <p>
098   * This boolean tells the replication server to compute change
099   * numbers for each replicated change by maintaining a change number
100   * index database. Changenumbers are computed according to
101   * http://tools.ietf.org/html/draft-good-ldap-changelog-04. Note this
102   * functionality has an impact on CPU, disk accesses and storage. If
103   * changenumbers are not required, it is advisable to set this value
104   * to false.
105   *
106   * @return Returns the value of the "compute-change-number" property.
107   */
108  boolean isComputeChangeNumber();
109
110
111
112  /**
113   * Sets 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   * @param value The value of the "compute-change-number" property.
126   * @throws PropertyException
127   *           If the new value is invalid.
128   */
129  void setComputeChangeNumber(Boolean value) throws PropertyException;
130
131
132
133  /**
134   * Gets the "degraded-status-threshold" property.
135   * <p>
136   * The number of pending changes as threshold value for putting a
137   * directory server in degraded status.
138   * <p>
139   * This value represents a number of pending changes a replication
140   * server has in queue for sending to a directory server. Once this
141   * value is crossed, the matching directory server goes in degraded
142   * status. When number of pending changes goes back under this value,
143   * the directory server is put back in normal status. 0 means status
144   * analyzer is disabled and directory servers are never put in
145   * degraded status.
146   *
147   * @return Returns the value of the "degraded-status-threshold" property.
148   */
149  int getDegradedStatusThreshold();
150
151
152
153  /**
154   * Sets the "degraded-status-threshold" property.
155   * <p>
156   * The number of pending changes as threshold value for putting a
157   * directory server in degraded status.
158   * <p>
159   * This value represents a number of pending changes a replication
160   * server has in queue for sending to a directory server. Once this
161   * value is crossed, the matching directory server goes in degraded
162   * status. When number of pending changes goes back under this value,
163   * the directory server is put back in normal status. 0 means status
164   * analyzer is disabled and directory servers are never put in
165   * degraded status.
166   *
167   * @param value The value of the "degraded-status-threshold" property.
168   * @throws PropertyException
169   *           If the new value is invalid.
170   */
171  void setDegradedStatusThreshold(Integer value) throws PropertyException;
172
173
174
175  /**
176   * Gets the "group-id" property.
177   * <p>
178   * The group id for the replication server.
179   * <p>
180   * This value defines the group id of the replication server. The
181   * replication system of a LDAP server uses the group id of the
182   * replicated domain and tries to connect, if possible, to a
183   * replication with the same group id.
184   *
185   * @return Returns the value of the "group-id" property.
186   */
187  int getGroupId();
188
189
190
191  /**
192   * Sets the "group-id" property.
193   * <p>
194   * The group id for the replication server.
195   * <p>
196   * This value defines the group id of the replication server. The
197   * replication system of a LDAP server uses the group id of the
198   * replicated domain and tries to connect, if possible, to a
199   * replication with the same group id.
200   *
201   * @param value The value of the "group-id" property.
202   * @throws PropertyException
203   *           If the new value is invalid.
204   */
205  void setGroupId(Integer value) throws PropertyException;
206
207
208
209  /**
210   * Gets the "monitoring-period" property.
211   * <p>
212   * The period between sending of monitoring messages.
213   * <p>
214   * Defines the duration that the replication server will wait before
215   * sending new monitoring messages to its peers (replication servers
216   * and directory servers). Larger values increase the length of time
217   * it takes for a directory server to detect and switch to a more
218   * suitable replication server, whereas smaller values increase the
219   * amount of background network traffic.
220   *
221   * @return Returns the value of the "monitoring-period" property.
222   */
223  long getMonitoringPeriod();
224
225
226
227  /**
228   * Sets the "monitoring-period" property.
229   * <p>
230   * The period between sending of monitoring messages.
231   * <p>
232   * Defines the duration that the replication server will wait before
233   * sending new monitoring messages to its peers (replication servers
234   * and directory servers). Larger values increase the length of time
235   * it takes for a directory server to detect and switch to a more
236   * suitable replication server, whereas smaller values increase the
237   * amount of background network traffic.
238   *
239   * @param value The value of the "monitoring-period" property.
240   * @throws PropertyException
241   *           If the new value is invalid.
242   */
243  void setMonitoringPeriod(Long value) throws PropertyException;
244
245
246
247  /**
248   * Gets the "queue-size" property.
249   * <p>
250   * Specifies the number of changes that are kept in memory for each
251   * directory server in the Replication Domain.
252   *
253   * @return Returns the value of the "queue-size" property.
254   */
255  int getQueueSize();
256
257
258
259  /**
260   * Sets the "queue-size" property.
261   * <p>
262   * Specifies the number of changes that are kept in memory for each
263   * directory server in the Replication Domain.
264   *
265   * @param value The value of the "queue-size" property.
266   * @throws PropertyException
267   *           If the new value is invalid.
268   */
269  void setQueueSize(Integer value) throws PropertyException;
270
271
272
273  /**
274   * Gets the "replication-db-directory" property.
275   * <p>
276   * The path where the Replication Server stores all persistent
277   * information.
278   *
279   * @return Returns the value of the "replication-db-directory" property.
280   */
281  String getReplicationDBDirectory();
282
283
284
285  /**
286   * Sets the "replication-db-directory" property.
287   * <p>
288   * The path where the Replication Server stores all persistent
289   * information.
290   * <p>
291   * This property is read-only and can only be modified during
292   * creation of a Replication Server.
293   *
294   * @param value The value of the "replication-db-directory" property.
295   * @throws PropertyException
296   *           If the new value is invalid.
297   * @throws PropertyException
298   *           If this Replication Server is not being initialized.
299   */
300  void setReplicationDBDirectory(String value) throws PropertyException, PropertyException;
301
302
303
304  /**
305   * Gets the "replication-db-implementation" property.
306   * <p>
307   * The Replication Server database implementation that stores all
308   * persistent information.
309   *
310   * @return Returns the value of the "replication-db-implementation" property.
311   */
312  ReplicationDBImplementation getReplicationDBImplementation();
313
314
315
316  /**
317   * Sets the "replication-db-implementation" property.
318   * <p>
319   * The Replication Server database implementation that stores all
320   * persistent information.
321   *
322   * @param value The value of the "replication-db-implementation" property.
323   * @throws PropertyException
324   *           If the new value is invalid.
325   */
326  void setReplicationDBImplementation(ReplicationDBImplementation value) throws PropertyException;
327
328
329
330  /**
331   * Gets the "replication-port" property.
332   * <p>
333   * The port on which this Replication Server waits for connections
334   * from other Replication Servers or Directory Servers.
335   *
336   * @return Returns the value of the "replication-port" property.
337   */
338  Integer getReplicationPort();
339
340
341
342  /**
343   * Sets the "replication-port" property.
344   * <p>
345   * The port on which this Replication Server waits for connections
346   * from other Replication Servers or Directory Servers.
347   *
348   * @param value The value of the "replication-port" property.
349   * @throws PropertyException
350   *           If the new value is invalid.
351   */
352  void setReplicationPort(int value) throws PropertyException;
353
354
355
356  /**
357   * Gets the "replication-purge-delay" property.
358   * <p>
359   * The time (in seconds) after which the Replication Server erases
360   * all persistent information.
361   *
362   * @return Returns the value of the "replication-purge-delay" property.
363   */
364  long getReplicationPurgeDelay();
365
366
367
368  /**
369   * Sets the "replication-purge-delay" property.
370   * <p>
371   * The time (in seconds) after which the Replication Server erases
372   * all persistent information.
373   *
374   * @param value The value of the "replication-purge-delay" property.
375   * @throws PropertyException
376   *           If the new value is invalid.
377   */
378  void setReplicationPurgeDelay(Long value) throws PropertyException;
379
380
381
382  /**
383   * Gets the "replication-server" property.
384   * <p>
385   * Specifies the addresses of other Replication Servers to which
386   * this Replication Server tries to connect at startup time.
387   * <p>
388   * Addresses must be specified using the syntax: "hostname:port". If
389   * IPv6 addresses are used as the hostname, they must be specified
390   * using the syntax "[IPv6Address]:port".
391   *
392   * @return Returns the values of the "replication-server" property.
393   */
394  SortedSet<String> getReplicationServer();
395
396
397
398  /**
399   * Sets the "replication-server" property.
400   * <p>
401   * Specifies the addresses of other Replication Servers to which
402   * this Replication Server tries to connect at startup time.
403   * <p>
404   * Addresses must be specified using the syntax: "hostname:port". If
405   * IPv6 addresses are used as the hostname, they must be specified
406   * using the syntax "[IPv6Address]:port".
407   *
408   * @param values The values of the "replication-server" property.
409   * @throws PropertyException
410   *           If one or more of the new values are invalid.
411   */
412  void setReplicationServer(Collection<String> values) throws PropertyException;
413
414
415
416  /**
417   * Gets the "replication-server-id" property.
418   * <p>
419   * Specifies a unique identifier for the Replication Server.
420   * <p>
421   * Each Replication Server must have a different server ID.
422   *
423   * @return Returns the value of the "replication-server-id" property.
424   */
425  Integer getReplicationServerId();
426
427
428
429  /**
430   * Sets the "replication-server-id" property.
431   * <p>
432   * Specifies a unique identifier for the Replication Server.
433   * <p>
434   * Each Replication Server must have a different server ID.
435   * <p>
436   * This property is read-only and can only be modified during
437   * creation of a Replication Server.
438   *
439   * @param value The value of the "replication-server-id" property.
440   * @throws PropertyException
441   *           If the new value is invalid.
442   * @throws PropertyException
443   *           If this Replication Server is not being initialized.
444   */
445  void setReplicationServerId(int value) throws PropertyException, PropertyException;
446
447
448
449  /**
450   * Gets the "source-address" property.
451   * <p>
452   * If specified, the server will bind to the address before
453   * connecting to the remote server.
454   * <p>
455   * The address must be one assigned to an existing network
456   * interface.
457   *
458   * @return Returns the value of the "source-address" property.
459   */
460  InetAddress getSourceAddress();
461
462
463
464  /**
465   * Sets the "source-address" property.
466   * <p>
467   * If specified, the server will bind to the address before
468   * connecting to the remote server.
469   * <p>
470   * The address must be one assigned to an existing network
471   * interface.
472   *
473   * @param value The value of the "source-address" property.
474   * @throws PropertyException
475   *           If the new value is invalid.
476   */
477  void setSourceAddress(InetAddress value) throws PropertyException;
478
479
480
481  /**
482   * Gets the "weight" property.
483   * <p>
484   * The weight of the replication server.
485   * <p>
486   * The weight affected to the replication server. Each replication
487   * server of the topology has a weight. When combined together, the
488   * weights of the replication servers of a same group can be
489   * translated to a percentage that determines the quantity of
490   * directory servers of the topology that should be connected to a
491   * replication server. For instance imagine a topology with 3
492   * replication servers (with the same group id) with the following
493   * weights: RS1=1, RS2=1, RS3=2. This means that RS1 should have 25%
494   * of the directory servers connected in the topology, RS2 25%, and
495   * RS3 50%. This may be useful if the replication servers of the
496   * topology have a different power and one wants to spread the load
497   * between the replication servers according to their power.
498   *
499   * @return Returns the value of the "weight" property.
500   */
501  int getWeight();
502
503
504
505  /**
506   * Sets the "weight" property.
507   * <p>
508   * The weight of the replication server.
509   * <p>
510   * The weight affected to the replication server. Each replication
511   * server of the topology has a weight. When combined together, the
512   * weights of the replication servers of a same group can be
513   * translated to a percentage that determines the quantity of
514   * directory servers of the topology that should be connected to a
515   * replication server. For instance imagine a topology with 3
516   * replication servers (with the same group id) with the following
517   * weights: RS1=1, RS2=1, RS3=2. This means that RS1 should have 25%
518   * of the directory servers connected in the topology, RS2 25%, and
519   * RS3 50%. This may be useful if the replication servers of the
520   * topology have a different power and one wants to spread the load
521   * between the replication servers according to their power.
522   *
523   * @param value The value of the "weight" property.
524   * @throws PropertyException
525   *           If the new value is invalid.
526   */
527  void setWeight(Integer value) throws PropertyException;
528
529
530
531  /**
532   * Gets the "window-size" property.
533   * <p>
534   * Specifies the window size that the Replication Server uses when
535   * communicating with other Replication Servers.
536   * <p>
537   * This option may be deprecated and removed in future releases.
538   *
539   * @return Returns the value of the "window-size" property.
540   */
541  int getWindowSize();
542
543
544
545  /**
546   * Sets the "window-size" property.
547   * <p>
548   * Specifies the window size that the Replication Server uses when
549   * communicating with other Replication Servers.
550   * <p>
551   * This option may be deprecated and removed in future releases.
552   *
553   * @param value The value of the "window-size" property.
554   * @throws PropertyException
555   *           If the new value is invalid.
556   */
557  void setWindowSize(Integer value) throws PropertyException;
558
559}