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.meta;
017
018
019
020import java.net.InetAddress;
021import java.util.Collection;
022import java.util.SortedSet;
023import org.forgerock.opendj.config.AdministratorAction;
024import org.forgerock.opendj.config.AliasDefaultBehaviorProvider;
025import org.forgerock.opendj.config.BooleanPropertyDefinition;
026import org.forgerock.opendj.config.client.ConcurrentModificationException;
027import org.forgerock.opendj.config.client.ManagedObject;
028import org.forgerock.opendj.config.client.MissingMandatoryPropertiesException;
029import org.forgerock.opendj.config.client.OperationRejectedException;
030import org.forgerock.opendj.config.DefaultBehaviorProvider;
031import org.forgerock.opendj.config.DefinedDefaultBehaviorProvider;
032import org.forgerock.opendj.config.DurationPropertyDefinition;
033import org.forgerock.opendj.config.IntegerPropertyDefinition;
034import org.forgerock.opendj.config.IPAddressPropertyDefinition;
035import org.forgerock.opendj.config.ManagedObjectAlreadyExistsException;
036import org.forgerock.opendj.config.ManagedObjectDefinition;
037import org.forgerock.opendj.config.PropertyException;
038import org.forgerock.opendj.config.PropertyOption;
039import org.forgerock.opendj.config.PropertyProvider;
040import org.forgerock.opendj.config.server.ConfigurationChangeListener;
041import org.forgerock.opendj.config.server.ServerManagedObject;
042import org.forgerock.opendj.config.StringPropertyDefinition;
043import org.forgerock.opendj.config.Tag;
044import org.forgerock.opendj.config.TopCfgDefn;
045import org.forgerock.opendj.config.UndefinedDefaultBehaviorProvider;
046import org.forgerock.opendj.ldap.DN;
047import org.forgerock.opendj.ldap.LdapException;
048import org.forgerock.opendj.server.config.client.ReplicationServerCfgClient;
049import org.forgerock.opendj.server.config.server.ReplicationServerCfg;
050
051
052
053/**
054 * An interface for querying the Replication Server managed object
055 * definition meta information.
056 * <p>
057 * Replication Servers publish updates to Directory Servers within a
058 * Replication Domain.
059 */
060public final class ReplicationServerCfgDefn extends ManagedObjectDefinition<ReplicationServerCfgClient, ReplicationServerCfg> {
061
062  /** The singleton configuration definition instance. */
063  private static final ReplicationServerCfgDefn INSTANCE = new ReplicationServerCfgDefn();
064
065
066
067  /** The "assured-timeout" property definition. */
068  private static final DurationPropertyDefinition PD_ASSURED_TIMEOUT;
069
070
071
072  /** The "compute-change-number" property definition. */
073  private static final BooleanPropertyDefinition PD_COMPUTE_CHANGE_NUMBER;
074
075
076
077  /** The "degraded-status-threshold" property definition. */
078  private static final IntegerPropertyDefinition PD_DEGRADED_STATUS_THRESHOLD;
079
080
081
082  /** The "group-id" property definition. */
083  private static final IntegerPropertyDefinition PD_GROUP_ID;
084
085
086
087  /** The "monitoring-period" property definition. */
088  private static final DurationPropertyDefinition PD_MONITORING_PERIOD;
089
090
091
092  /** The "queue-size" property definition. */
093  private static final IntegerPropertyDefinition PD_QUEUE_SIZE;
094
095
096
097  /** The "replication-db-directory" property definition. */
098  private static final StringPropertyDefinition PD_REPLICATION_DB_DIRECTORY;
099
100
101
102  /** The "replication-port" property definition. */
103  private static final IntegerPropertyDefinition PD_REPLICATION_PORT;
104
105
106
107  /** The "replication-purge-delay" property definition. */
108  private static final DurationPropertyDefinition PD_REPLICATION_PURGE_DELAY;
109
110
111
112  /** The "replication-server" property definition. */
113  private static final StringPropertyDefinition PD_REPLICATION_SERVER;
114
115
116
117  /** The "replication-server-id" property definition. */
118  private static final IntegerPropertyDefinition PD_REPLICATION_SERVER_ID;
119
120
121
122  /** The "source-address" property definition. */
123  private static final IPAddressPropertyDefinition PD_SOURCE_ADDRESS;
124
125
126
127  /** The "weight" property definition. */
128  private static final IntegerPropertyDefinition PD_WEIGHT;
129
130
131
132  /** The "window-size" property definition. */
133  private static final IntegerPropertyDefinition PD_WINDOW_SIZE;
134
135
136
137  /** Build the "assured-timeout" property definition. */
138  static {
139      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "assured-timeout");
140      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "assured-timeout"));
141      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("1000ms");
142      builder.setDefaultBehaviorProvider(provider);
143      builder.setBaseUnit("ms");
144      builder.setLowerLimit("1");
145      PD_ASSURED_TIMEOUT = builder.getInstance();
146      INSTANCE.registerPropertyDefinition(PD_ASSURED_TIMEOUT);
147  }
148
149
150
151  /** Build the "compute-change-number" property definition. */
152  static {
153      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "compute-change-number");
154      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "compute-change-number"));
155      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true");
156      builder.setDefaultBehaviorProvider(provider);
157      PD_COMPUTE_CHANGE_NUMBER = builder.getInstance();
158      INSTANCE.registerPropertyDefinition(PD_COMPUTE_CHANGE_NUMBER);
159  }
160
161
162
163  /** Build the "degraded-status-threshold" property definition. */
164  static {
165      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "degraded-status-threshold");
166      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "degraded-status-threshold"));
167      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("5000");
168      builder.setDefaultBehaviorProvider(provider);
169      builder.setLowerLimit(0);
170      PD_DEGRADED_STATUS_THRESHOLD = builder.getInstance();
171      INSTANCE.registerPropertyDefinition(PD_DEGRADED_STATUS_THRESHOLD);
172  }
173
174
175
176  /** Build the "group-id" property definition. */
177  static {
178      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "group-id");
179      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "group-id"));
180      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("1");
181      builder.setDefaultBehaviorProvider(provider);
182      builder.setUpperLimit(127);
183      builder.setLowerLimit(1);
184      PD_GROUP_ID = builder.getInstance();
185      INSTANCE.registerPropertyDefinition(PD_GROUP_ID);
186  }
187
188
189
190  /** Build the "monitoring-period" property definition. */
191  static {
192      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "monitoring-period");
193      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "monitoring-period"));
194      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("60s");
195      builder.setDefaultBehaviorProvider(provider);
196      builder.setBaseUnit("ms");
197      builder.setLowerLimit("0");
198      PD_MONITORING_PERIOD = builder.getInstance();
199      INSTANCE.registerPropertyDefinition(PD_MONITORING_PERIOD);
200  }
201
202
203
204  /** Build the "queue-size" property definition. */
205  static {
206      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "queue-size");
207      builder.setOption(PropertyOption.ADVANCED);
208      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "queue-size"));
209      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("10000");
210      builder.setDefaultBehaviorProvider(provider);
211      PD_QUEUE_SIZE = builder.getInstance();
212      INSTANCE.registerPropertyDefinition(PD_QUEUE_SIZE);
213  }
214
215
216
217  /** Build the "replication-db-directory" property definition. */
218  static {
219      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "replication-db-directory");
220      builder.setOption(PropertyOption.READ_ONLY);
221      builder.setOption(PropertyOption.MANDATORY);
222      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "replication-db-directory"));
223      DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("changelogDb");
224      builder.setDefaultBehaviorProvider(provider);
225      PD_REPLICATION_DB_DIRECTORY = builder.getInstance();
226      INSTANCE.registerPropertyDefinition(PD_REPLICATION_DB_DIRECTORY);
227  }
228
229
230
231  /** Build the "replication-port" property definition. */
232  static {
233      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "replication-port");
234      builder.setOption(PropertyOption.MANDATORY);
235      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "replication-port"));
236      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<Integer>());
237      builder.setUpperLimit(65535);
238      builder.setLowerLimit(1);
239      PD_REPLICATION_PORT = builder.getInstance();
240      INSTANCE.registerPropertyDefinition(PD_REPLICATION_PORT);
241  }
242
243
244
245  /** Build the "replication-purge-delay" property definition. */
246  static {
247      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "replication-purge-delay");
248      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "replication-purge-delay"));
249      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("3 days");
250      builder.setDefaultBehaviorProvider(provider);
251      builder.setAllowUnlimited(false);
252      builder.setBaseUnit("s");
253      PD_REPLICATION_PURGE_DELAY = builder.getInstance();
254      INSTANCE.registerPropertyDefinition(PD_REPLICATION_PURGE_DELAY);
255  }
256
257
258
259  /** Build the "replication-server" property definition. */
260  static {
261      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "replication-server");
262      builder.setOption(PropertyOption.MULTI_VALUED);
263      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "replication-server"));
264      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
265      builder.setPattern("^.+:[0-9]+$", "HOST:PORT");
266      PD_REPLICATION_SERVER = builder.getInstance();
267      INSTANCE.registerPropertyDefinition(PD_REPLICATION_SERVER);
268  }
269
270
271
272  /** Build the "replication-server-id" property definition. */
273  static {
274      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "replication-server-id");
275      builder.setOption(PropertyOption.READ_ONLY);
276      builder.setOption(PropertyOption.MANDATORY);
277      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "replication-server-id"));
278      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<Integer>());
279      builder.setUpperLimit(65535);
280      builder.setLowerLimit(1);
281      PD_REPLICATION_SERVER_ID = builder.getInstance();
282      INSTANCE.registerPropertyDefinition(PD_REPLICATION_SERVER_ID);
283  }
284
285
286
287  /** Build the "source-address" property definition. */
288  static {
289      IPAddressPropertyDefinition.Builder builder = IPAddressPropertyDefinition.createBuilder(INSTANCE, "source-address");
290      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "source-address"));
291      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<InetAddress>(INSTANCE, "source-address"));
292      PD_SOURCE_ADDRESS = builder.getInstance();
293      INSTANCE.registerPropertyDefinition(PD_SOURCE_ADDRESS);
294  }
295
296
297
298  /** Build the "weight" property definition. */
299  static {
300      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "weight");
301      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "weight"));
302      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("1");
303      builder.setDefaultBehaviorProvider(provider);
304      builder.setLowerLimit(1);
305      PD_WEIGHT = builder.getInstance();
306      INSTANCE.registerPropertyDefinition(PD_WEIGHT);
307  }
308
309
310
311  /** Build the "window-size" property definition. */
312  static {
313      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "window-size");
314      builder.setOption(PropertyOption.ADVANCED);
315      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "window-size"));
316      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("100000");
317      builder.setDefaultBehaviorProvider(provider);
318      PD_WINDOW_SIZE = builder.getInstance();
319      INSTANCE.registerPropertyDefinition(PD_WINDOW_SIZE);
320  }
321
322
323
324  // Register the tags associated with this managed object definition.
325  static {
326    INSTANCE.registerTag(Tag.valueOf("replication"));
327  }
328
329
330
331  /**
332   * Get the Replication Server configuration definition singleton.
333   *
334   * @return Returns the Replication Server configuration definition
335   *         singleton.
336   */
337  public static ReplicationServerCfgDefn getInstance() {
338    return INSTANCE;
339  }
340
341
342
343  /**
344   * Private constructor.
345   */
346  private ReplicationServerCfgDefn() {
347    super("replication-server", TopCfgDefn.getInstance());
348  }
349
350
351
352  /** {@inheritDoc} */
353  public ReplicationServerCfgClient createClientConfiguration(
354      ManagedObject<? extends ReplicationServerCfgClient> impl) {
355    return new ReplicationServerCfgClientImpl(impl);
356  }
357
358
359
360  /** {@inheritDoc} */
361  public ReplicationServerCfg createServerConfiguration(
362      ServerManagedObject<? extends ReplicationServerCfg> impl) {
363    return new ReplicationServerCfgServerImpl(impl);
364  }
365
366
367
368  /** {@inheritDoc} */
369  public Class<ReplicationServerCfg> getServerConfigurationClass() {
370    return ReplicationServerCfg.class;
371  }
372
373
374
375  /**
376   * Get the "assured-timeout" property definition.
377   * <p>
378   * The timeout value when waiting for assured mode acknowledgments.
379   * <p>
380   * Defines the number of milliseconds that the replication server
381   * will wait for assured acknowledgments (in either Safe Data or Safe
382   * Read assured sub modes) before forgetting them and answer to the
383   * entity that sent an update and is waiting for acknowledgment.
384   *
385   * @return Returns the "assured-timeout" property definition.
386   */
387  public DurationPropertyDefinition getAssuredTimeoutPropertyDefinition() {
388    return PD_ASSURED_TIMEOUT;
389  }
390
391
392
393  /**
394   * Get the "compute-change-number" property definition.
395   * <p>
396   * Whether the replication server will compute change numbers.
397   * <p>
398   * This boolean tells the replication server to compute change
399   * numbers for each replicated change by maintaining a change number
400   * index database. Changenumbers are computed according to
401   * http://tools.ietf.org/html/draft-good-ldap-changelog-04. Note this
402   * functionality has an impact on CPU, disk accesses and storage. If
403   * changenumbers are not required, it is advisable to set this value
404   * to false.
405   *
406   * @return Returns the "compute-change-number" property definition.
407   */
408  public BooleanPropertyDefinition getComputeChangeNumberPropertyDefinition() {
409    return PD_COMPUTE_CHANGE_NUMBER;
410  }
411
412
413
414  /**
415   * Get the "degraded-status-threshold" property definition.
416   * <p>
417   * The number of pending changes as threshold value for putting a
418   * directory server in degraded status.
419   * <p>
420   * This value represents a number of pending changes a replication
421   * server has in queue for sending to a directory server. Once this
422   * value is crossed, the matching directory server goes in degraded
423   * status. When number of pending changes goes back under this value,
424   * the directory server is put back in normal status. 0 means status
425   * analyzer is disabled and directory servers are never put in
426   * degraded status.
427   *
428   * @return Returns the "degraded-status-threshold" property definition.
429   */
430  public IntegerPropertyDefinition getDegradedStatusThresholdPropertyDefinition() {
431    return PD_DEGRADED_STATUS_THRESHOLD;
432  }
433
434
435
436  /**
437   * Get the "group-id" property definition.
438   * <p>
439   * The group id for the replication server.
440   * <p>
441   * This value defines the group id of the replication server. The
442   * replication system of a LDAP server uses the group id of the
443   * replicated domain and tries to connect, if possible, to a
444   * replication with the same group id.
445   *
446   * @return Returns the "group-id" property definition.
447   */
448  public IntegerPropertyDefinition getGroupIdPropertyDefinition() {
449    return PD_GROUP_ID;
450  }
451
452
453
454  /**
455   * Get the "monitoring-period" property definition.
456   * <p>
457   * The period between sending of monitoring messages.
458   * <p>
459   * Defines the duration that the replication server will wait before
460   * sending new monitoring messages to its peers (replication servers
461   * and directory servers). Larger values increase the length of time
462   * it takes for a directory server to detect and switch to a more
463   * suitable replication server, whereas smaller values increase the
464   * amount of background network traffic.
465   *
466   * @return Returns the "monitoring-period" property definition.
467   */
468  public DurationPropertyDefinition getMonitoringPeriodPropertyDefinition() {
469    return PD_MONITORING_PERIOD;
470  }
471
472
473
474  /**
475   * Get the "queue-size" property definition.
476   * <p>
477   * Specifies the number of changes that are kept in memory for each
478   * directory server in the Replication Domain.
479   *
480   * @return Returns the "queue-size" property definition.
481   */
482  public IntegerPropertyDefinition getQueueSizePropertyDefinition() {
483    return PD_QUEUE_SIZE;
484  }
485
486
487
488  /**
489   * Get the "replication-db-directory" property definition.
490   * <p>
491   * The path where the Replication Server stores all persistent
492   * information.
493   *
494   * @return Returns the "replication-db-directory" property definition.
495   */
496  public StringPropertyDefinition getReplicationDBDirectoryPropertyDefinition() {
497    return PD_REPLICATION_DB_DIRECTORY;
498  }
499
500
501
502  /**
503   * Get the "replication-port" property definition.
504   * <p>
505   * The port on which this Replication Server waits for connections
506   * from other Replication Servers or Directory Servers.
507   *
508   * @return Returns the "replication-port" property definition.
509   */
510  public IntegerPropertyDefinition getReplicationPortPropertyDefinition() {
511    return PD_REPLICATION_PORT;
512  }
513
514
515
516  /**
517   * Get the "replication-purge-delay" property definition.
518   * <p>
519   * The time (in seconds) after which the Replication Server erases
520   * all persistent information.
521   *
522   * @return Returns the "replication-purge-delay" property definition.
523   */
524  public DurationPropertyDefinition getReplicationPurgeDelayPropertyDefinition() {
525    return PD_REPLICATION_PURGE_DELAY;
526  }
527
528
529
530  /**
531   * Get the "replication-server" property definition.
532   * <p>
533   * Specifies the addresses of other Replication Servers to which
534   * this Replication Server tries to connect at startup time.
535   * <p>
536   * Addresses must be specified using the syntax: "hostname:port". If
537   * IPv6 addresses are used as the hostname, they must be specified
538   * using the syntax "[IPv6Address]:port".
539   *
540   * @return Returns the "replication-server" property definition.
541   */
542  public StringPropertyDefinition getReplicationServerPropertyDefinition() {
543    return PD_REPLICATION_SERVER;
544  }
545
546
547
548  /**
549   * Get the "replication-server-id" property definition.
550   * <p>
551   * Specifies a unique identifier for the Replication Server.
552   * <p>
553   * Each Replication Server must have a different server ID.
554   *
555   * @return Returns the "replication-server-id" property definition.
556   */
557  public IntegerPropertyDefinition getReplicationServerIdPropertyDefinition() {
558    return PD_REPLICATION_SERVER_ID;
559  }
560
561
562
563  /**
564   * Get the "source-address" property definition.
565   * <p>
566   * If specified, the server will bind to the address before
567   * connecting to the remote server.
568   * <p>
569   * The address must be one assigned to an existing network
570   * interface.
571   *
572   * @return Returns the "source-address" property definition.
573   */
574  public IPAddressPropertyDefinition getSourceAddressPropertyDefinition() {
575    return PD_SOURCE_ADDRESS;
576  }
577
578
579
580  /**
581   * Get the "weight" property definition.
582   * <p>
583   * The weight of the replication server.
584   * <p>
585   * The weight affected to the replication server. Each replication
586   * server of the topology has a weight. When combined together, the
587   * weights of the replication servers of a same group can be
588   * translated to a percentage that determines the quantity of
589   * directory servers of the topology that should be connected to a
590   * replication server. For instance imagine a topology with 3
591   * replication servers (with the same group id) with the following
592   * weights: RS1=1, RS2=1, RS3=2. This means that RS1 should have 25%
593   * of the directory servers connected in the topology, RS2 25%, and
594   * RS3 50%. This may be useful if the replication servers of the
595   * topology have a different power and one wants to spread the load
596   * between the replication servers according to their power.
597   *
598   * @return Returns the "weight" property definition.
599   */
600  public IntegerPropertyDefinition getWeightPropertyDefinition() {
601    return PD_WEIGHT;
602  }
603
604
605
606  /**
607   * Get the "window-size" property definition.
608   * <p>
609   * Specifies the window size that the Replication Server uses when
610   * communicating with other Replication Servers.
611   * <p>
612   * This option may be deprecated and removed in future releases.
613   *
614   * @return Returns the "window-size" property definition.
615   */
616  public IntegerPropertyDefinition getWindowSizePropertyDefinition() {
617    return PD_WINDOW_SIZE;
618  }
619
620
621
622  /**
623   * Managed object client implementation.
624   */
625  private static class ReplicationServerCfgClientImpl implements
626    ReplicationServerCfgClient {
627
628    /** Private implementation. */
629    private ManagedObject<? extends ReplicationServerCfgClient> impl;
630
631
632
633    /** Private constructor. */
634    private ReplicationServerCfgClientImpl(
635        ManagedObject<? extends ReplicationServerCfgClient> impl) {
636      this.impl = impl;
637    }
638
639
640
641    /** {@inheritDoc} */
642    public long getAssuredTimeout() {
643      return impl.getPropertyValue(INSTANCE.getAssuredTimeoutPropertyDefinition());
644    }
645
646
647
648    /** {@inheritDoc} */
649    public void setAssuredTimeout(Long value) {
650      impl.setPropertyValue(INSTANCE.getAssuredTimeoutPropertyDefinition(), value);
651    }
652
653
654
655    /** {@inheritDoc} */
656    public boolean isComputeChangeNumber() {
657      return impl.getPropertyValue(INSTANCE.getComputeChangeNumberPropertyDefinition());
658    }
659
660
661
662    /** {@inheritDoc} */
663    public void setComputeChangeNumber(Boolean value) {
664      impl.setPropertyValue(INSTANCE.getComputeChangeNumberPropertyDefinition(), value);
665    }
666
667
668
669    /** {@inheritDoc} */
670    public int getDegradedStatusThreshold() {
671      return impl.getPropertyValue(INSTANCE.getDegradedStatusThresholdPropertyDefinition());
672    }
673
674
675
676    /** {@inheritDoc} */
677    public void setDegradedStatusThreshold(Integer value) {
678      impl.setPropertyValue(INSTANCE.getDegradedStatusThresholdPropertyDefinition(), value);
679    }
680
681
682
683    /** {@inheritDoc} */
684    public int getGroupId() {
685      return impl.getPropertyValue(INSTANCE.getGroupIdPropertyDefinition());
686    }
687
688
689
690    /** {@inheritDoc} */
691    public void setGroupId(Integer value) {
692      impl.setPropertyValue(INSTANCE.getGroupIdPropertyDefinition(), value);
693    }
694
695
696
697    /** {@inheritDoc} */
698    public long getMonitoringPeriod() {
699      return impl.getPropertyValue(INSTANCE.getMonitoringPeriodPropertyDefinition());
700    }
701
702
703
704    /** {@inheritDoc} */
705    public void setMonitoringPeriod(Long value) {
706      impl.setPropertyValue(INSTANCE.getMonitoringPeriodPropertyDefinition(), value);
707    }
708
709
710
711    /** {@inheritDoc} */
712    public int getQueueSize() {
713      return impl.getPropertyValue(INSTANCE.getQueueSizePropertyDefinition());
714    }
715
716
717
718    /** {@inheritDoc} */
719    public void setQueueSize(Integer value) {
720      impl.setPropertyValue(INSTANCE.getQueueSizePropertyDefinition(), value);
721    }
722
723
724
725    /** {@inheritDoc} */
726    public String getReplicationDBDirectory() {
727      return impl.getPropertyValue(INSTANCE.getReplicationDBDirectoryPropertyDefinition());
728    }
729
730
731
732    /** {@inheritDoc} */
733    public void setReplicationDBDirectory(String value) throws PropertyException {
734      impl.setPropertyValue(INSTANCE.getReplicationDBDirectoryPropertyDefinition(), value);
735    }
736
737
738
739    /** {@inheritDoc} */
740    public Integer getReplicationPort() {
741      return impl.getPropertyValue(INSTANCE.getReplicationPortPropertyDefinition());
742    }
743
744
745
746    /** {@inheritDoc} */
747    public void setReplicationPort(int value) {
748      impl.setPropertyValue(INSTANCE.getReplicationPortPropertyDefinition(), value);
749    }
750
751
752
753    /** {@inheritDoc} */
754    public long getReplicationPurgeDelay() {
755      return impl.getPropertyValue(INSTANCE.getReplicationPurgeDelayPropertyDefinition());
756    }
757
758
759
760    /** {@inheritDoc} */
761    public void setReplicationPurgeDelay(Long value) {
762      impl.setPropertyValue(INSTANCE.getReplicationPurgeDelayPropertyDefinition(), value);
763    }
764
765
766
767    /** {@inheritDoc} */
768    public SortedSet<String> getReplicationServer() {
769      return impl.getPropertyValues(INSTANCE.getReplicationServerPropertyDefinition());
770    }
771
772
773
774    /** {@inheritDoc} */
775    public void setReplicationServer(Collection<String> values) {
776      impl.setPropertyValues(INSTANCE.getReplicationServerPropertyDefinition(), values);
777    }
778
779
780
781    /** {@inheritDoc} */
782    public Integer getReplicationServerId() {
783      return impl.getPropertyValue(INSTANCE.getReplicationServerIdPropertyDefinition());
784    }
785
786
787
788    /** {@inheritDoc} */
789    public void setReplicationServerId(int value) throws PropertyException {
790      impl.setPropertyValue(INSTANCE.getReplicationServerIdPropertyDefinition(), value);
791    }
792
793
794
795    /** {@inheritDoc} */
796    public InetAddress getSourceAddress() {
797      return impl.getPropertyValue(INSTANCE.getSourceAddressPropertyDefinition());
798    }
799
800
801
802    /** {@inheritDoc} */
803    public void setSourceAddress(InetAddress value) {
804      impl.setPropertyValue(INSTANCE.getSourceAddressPropertyDefinition(), value);
805    }
806
807
808
809    /** {@inheritDoc} */
810    public int getWeight() {
811      return impl.getPropertyValue(INSTANCE.getWeightPropertyDefinition());
812    }
813
814
815
816    /** {@inheritDoc} */
817    public void setWeight(Integer value) {
818      impl.setPropertyValue(INSTANCE.getWeightPropertyDefinition(), value);
819    }
820
821
822
823    /** {@inheritDoc} */
824    public int getWindowSize() {
825      return impl.getPropertyValue(INSTANCE.getWindowSizePropertyDefinition());
826    }
827
828
829
830    /** {@inheritDoc} */
831    public void setWindowSize(Integer value) {
832      impl.setPropertyValue(INSTANCE.getWindowSizePropertyDefinition(), value);
833    }
834
835
836
837    /** {@inheritDoc} */
838    public ManagedObjectDefinition<? extends ReplicationServerCfgClient, ? extends ReplicationServerCfg> definition() {
839      return INSTANCE;
840    }
841
842
843
844    /** {@inheritDoc} */
845    public PropertyProvider properties() {
846      return impl;
847    }
848
849
850
851    /** {@inheritDoc} */
852    public void commit() throws ManagedObjectAlreadyExistsException,
853        MissingMandatoryPropertiesException, ConcurrentModificationException,
854        OperationRejectedException, LdapException {
855      impl.commit();
856    }
857
858
859
860    /** {@inheritDoc} */
861    public String toString() {
862      return impl.toString();
863    }
864  }
865
866
867
868  /**
869   * Managed object server implementation.
870   */
871  private static class ReplicationServerCfgServerImpl implements
872    ReplicationServerCfg {
873
874    /** Private implementation. */
875    private ServerManagedObject<? extends ReplicationServerCfg> impl;
876
877    /** The value of the "assured-timeout" property. */
878    private final long pAssuredTimeout;
879
880    /** The value of the "compute-change-number" property. */
881    private final boolean pComputeChangeNumber;
882
883    /** The value of the "degraded-status-threshold" property. */
884    private final int pDegradedStatusThreshold;
885
886    /** The value of the "group-id" property. */
887    private final int pGroupId;
888
889    /** The value of the "monitoring-period" property. */
890    private final long pMonitoringPeriod;
891
892    /** The value of the "queue-size" property. */
893    private final int pQueueSize;
894
895    /** The value of the "replication-db-directory" property. */
896    private final String pReplicationDBDirectory;
897
898    /** The value of the "replication-port" property. */
899    private final int pReplicationPort;
900
901    /** The value of the "replication-purge-delay" property. */
902    private final long pReplicationPurgeDelay;
903
904    /** The value of the "replication-server" property. */
905    private final SortedSet<String> pReplicationServer;
906
907    /** The value of the "replication-server-id" property. */
908    private final int pReplicationServerId;
909
910    /** The value of the "source-address" property. */
911    private final InetAddress pSourceAddress;
912
913    /** The value of the "weight" property. */
914    private final int pWeight;
915
916    /** The value of the "window-size" property. */
917    private final int pWindowSize;
918
919
920
921    /** Private constructor. */
922    private ReplicationServerCfgServerImpl(ServerManagedObject<? extends ReplicationServerCfg> impl) {
923      this.impl = impl;
924      this.pAssuredTimeout = impl.getPropertyValue(INSTANCE.getAssuredTimeoutPropertyDefinition());
925      this.pComputeChangeNumber = impl.getPropertyValue(INSTANCE.getComputeChangeNumberPropertyDefinition());
926      this.pDegradedStatusThreshold = impl.getPropertyValue(INSTANCE.getDegradedStatusThresholdPropertyDefinition());
927      this.pGroupId = impl.getPropertyValue(INSTANCE.getGroupIdPropertyDefinition());
928      this.pMonitoringPeriod = impl.getPropertyValue(INSTANCE.getMonitoringPeriodPropertyDefinition());
929      this.pQueueSize = impl.getPropertyValue(INSTANCE.getQueueSizePropertyDefinition());
930      this.pReplicationDBDirectory = impl.getPropertyValue(INSTANCE.getReplicationDBDirectoryPropertyDefinition());
931      this.pReplicationPort = impl.getPropertyValue(INSTANCE.getReplicationPortPropertyDefinition());
932      this.pReplicationPurgeDelay = impl.getPropertyValue(INSTANCE.getReplicationPurgeDelayPropertyDefinition());
933      this.pReplicationServer = impl.getPropertyValues(INSTANCE.getReplicationServerPropertyDefinition());
934      this.pReplicationServerId = impl.getPropertyValue(INSTANCE.getReplicationServerIdPropertyDefinition());
935      this.pSourceAddress = impl.getPropertyValue(INSTANCE.getSourceAddressPropertyDefinition());
936      this.pWeight = impl.getPropertyValue(INSTANCE.getWeightPropertyDefinition());
937      this.pWindowSize = impl.getPropertyValue(INSTANCE.getWindowSizePropertyDefinition());
938    }
939
940
941
942    /** {@inheritDoc} */
943    public void addChangeListener(
944        ConfigurationChangeListener<ReplicationServerCfg> listener) {
945      impl.registerChangeListener(listener);
946    }
947
948
949
950    /** {@inheritDoc} */
951    public void removeChangeListener(
952        ConfigurationChangeListener<ReplicationServerCfg> listener) {
953      impl.deregisterChangeListener(listener);
954    }
955
956
957
958    /** {@inheritDoc} */
959    public long getAssuredTimeout() {
960      return pAssuredTimeout;
961    }
962
963
964
965    /** {@inheritDoc} */
966    public boolean isComputeChangeNumber() {
967      return pComputeChangeNumber;
968    }
969
970
971
972    /** {@inheritDoc} */
973    public int getDegradedStatusThreshold() {
974      return pDegradedStatusThreshold;
975    }
976
977
978
979    /** {@inheritDoc} */
980    public int getGroupId() {
981      return pGroupId;
982    }
983
984
985
986    /** {@inheritDoc} */
987    public long getMonitoringPeriod() {
988      return pMonitoringPeriod;
989    }
990
991
992
993    /** {@inheritDoc} */
994    public int getQueueSize() {
995      return pQueueSize;
996    }
997
998
999
1000    /** {@inheritDoc} */
1001    public String getReplicationDBDirectory() {
1002      return pReplicationDBDirectory;
1003    }
1004
1005
1006
1007    /** {@inheritDoc} */
1008    public int getReplicationPort() {
1009      return pReplicationPort;
1010    }
1011
1012
1013
1014    /** {@inheritDoc} */
1015    public long getReplicationPurgeDelay() {
1016      return pReplicationPurgeDelay;
1017    }
1018
1019
1020
1021    /** {@inheritDoc} */
1022    public SortedSet<String> getReplicationServer() {
1023      return pReplicationServer;
1024    }
1025
1026
1027
1028    /** {@inheritDoc} */
1029    public int getReplicationServerId() {
1030      return pReplicationServerId;
1031    }
1032
1033
1034
1035    /** {@inheritDoc} */
1036    public InetAddress getSourceAddress() {
1037      return pSourceAddress;
1038    }
1039
1040
1041
1042    /** {@inheritDoc} */
1043    public int getWeight() {
1044      return pWeight;
1045    }
1046
1047
1048
1049    /** {@inheritDoc} */
1050    public int getWindowSize() {
1051      return pWindowSize;
1052    }
1053
1054
1055
1056    /** {@inheritDoc} */
1057    public Class<? extends ReplicationServerCfg> configurationClass() {
1058      return ReplicationServerCfg.class;
1059    }
1060
1061
1062
1063    /** {@inheritDoc} */
1064    public DN dn() {
1065      return impl.getDN();
1066    }
1067
1068
1069
1070    /** {@inheritDoc} */
1071    public String toString() {
1072      return impl.toString();
1073    }
1074  }
1075}