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.ManagedObjectDecodingException;
029import org.forgerock.opendj.config.client.MissingMandatoryPropertiesException;
030import org.forgerock.opendj.config.client.OperationRejectedException;
031import org.forgerock.opendj.config.DefaultBehaviorProvider;
032import org.forgerock.opendj.config.DefinedDefaultBehaviorProvider;
033import org.forgerock.opendj.config.DefinitionDecodingException;
034import org.forgerock.opendj.config.DNPropertyDefinition;
035import org.forgerock.opendj.config.DurationPropertyDefinition;
036import org.forgerock.opendj.config.EnumPropertyDefinition;
037import org.forgerock.opendj.config.IntegerPropertyDefinition;
038import org.forgerock.opendj.config.IPAddressPropertyDefinition;
039import org.forgerock.opendj.config.ManagedObjectAlreadyExistsException;
040import org.forgerock.opendj.config.ManagedObjectDefinition;
041import org.forgerock.opendj.config.ManagedObjectNotFoundException;
042import org.forgerock.opendj.config.PropertyException;
043import org.forgerock.opendj.config.PropertyOption;
044import org.forgerock.opendj.config.PropertyProvider;
045import org.forgerock.opendj.config.server.ConfigException;
046import org.forgerock.opendj.config.server.ConfigurationChangeListener;
047import org.forgerock.opendj.config.server.ServerManagedObject;
048import org.forgerock.opendj.config.SingletonRelationDefinition;
049import org.forgerock.opendj.config.StringPropertyDefinition;
050import org.forgerock.opendj.config.Tag;
051import org.forgerock.opendj.config.TopCfgDefn;
052import org.forgerock.opendj.config.UndefinedDefaultBehaviorProvider;
053import org.forgerock.opendj.ldap.DN;
054import org.forgerock.opendj.ldap.LdapException;
055import org.forgerock.opendj.server.config.client.ExternalChangelogDomainCfgClient;
056import org.forgerock.opendj.server.config.client.ReplicationDomainCfgClient;
057import org.forgerock.opendj.server.config.server.ExternalChangelogDomainCfg;
058import org.forgerock.opendj.server.config.server.ReplicationDomainCfg;
059
060
061
062/**
063 * An interface for querying the Replication Domain managed object
064 * definition meta information.
065 * <p>
066 * A Replication Domain comprises of several Directory Servers sharing
067 * the same synchronized set of data.
068 */
069public final class ReplicationDomainCfgDefn extends ManagedObjectDefinition<ReplicationDomainCfgClient, ReplicationDomainCfg> {
070
071  /** The singleton configuration definition instance. */
072  private static final ReplicationDomainCfgDefn INSTANCE = new ReplicationDomainCfgDefn();
073
074
075
076  /**
077   * Defines the set of permissable values for the "assured-type" property.
078   * <p>
079   * Defines the assured replication mode of the replicated domain.
080   * <p>
081   * The assured replication can be disabled or enabled. When enabled,
082   * two modes are available: Safe Data or Safe Read modes.
083   */
084  public static enum AssuredType {
085
086    /**
087     * Assured replication is not enabled. Updates sent for
088     * replication (for being replayed on other LDAP servers in the
089     * topology) are sent without waiting for any acknowledgment and
090     * the LDAP client call returns immediately.
091     */
092    NOT_ASSURED("not-assured"),
093
094
095
096    /**
097     * Assured replication is enabled in Safe Data mode: updates sent
098     * for replication are subject to acknowledgment from the
099     * replication servers that have the same group ID as the local
100     * server (defined with the group-id property). The number of
101     * acknowledgments to expect is defined by the assured-sd-level
102     * property. After acknowledgments are received, LDAP client call
103     * returns.
104     */
105    SAFE_DATA("safe-data"),
106
107
108
109    /**
110     * Assured replication is enabled in Safe Read mode: updates sent
111     * for replication are subject to acknowledgments from the LDAP
112     * servers in the topology that have the same group ID as the local
113     * server (defined with the group-id property). After
114     * acknowledgments are received, LDAP client call returns.
115     */
116    SAFE_READ("safe-read");
117
118
119
120    /** String representation of the value. */
121    private final String name;
122
123
124
125    /** Private constructor. */
126    private AssuredType(String name) { this.name = name; }
127
128
129
130    /** {@inheritDoc} */
131    public String toString() { return name; }
132
133  }
134
135
136
137  /**
138   * Defines the set of permissable values for the "isolation-policy" property.
139   * <p>
140   * Specifies the behavior of the directory server if a write
141   * operation is attempted on the data within the Replication Domain
142   * when none of the configured Replication Servers are available.
143   */
144  public static enum IsolationPolicy {
145
146    /**
147     * Indicates that updates should be accepted even though it is not
148     * possible to send them to any Replication Server. Best effort is
149     * made to re-send those updates to a Replication Servers when one
150     * of them is available, however those changes are at risk because
151     * they are only available from the historical information. This
152     * mode can also introduce high replication latency.
153     */
154    ACCEPT_ALL_UPDATES("accept-all-updates"),
155
156
157
158    /**
159     * Indicates that all updates attempted on this Replication Domain
160     * are rejected when no Replication Server is available.
161     */
162    REJECT_ALL_UPDATES("reject-all-updates");
163
164
165
166    /** String representation of the value. */
167    private final String name;
168
169
170
171    /** Private constructor. */
172    private IsolationPolicy(String name) { this.name = name; }
173
174
175
176    /** {@inheritDoc} */
177    public String toString() { return name; }
178
179  }
180
181
182
183  /** The "assured-sd-level" property definition. */
184  private static final IntegerPropertyDefinition PD_ASSURED_SD_LEVEL;
185
186
187
188  /** The "assured-timeout" property definition. */
189  private static final DurationPropertyDefinition PD_ASSURED_TIMEOUT;
190
191
192
193  /** The "assured-type" property definition. */
194  private static final EnumPropertyDefinition<AssuredType> PD_ASSURED_TYPE;
195
196
197
198  /** The "base-dn" property definition. */
199  private static final DNPropertyDefinition PD_BASE_DN;
200
201
202
203  /** The "changetime-heartbeat-interval" property definition. */
204  private static final DurationPropertyDefinition PD_CHANGETIME_HEARTBEAT_INTERVAL;
205
206
207
208  /** The "conflicts-historical-purge-delay" property definition. */
209  private static final DurationPropertyDefinition PD_CONFLICTS_HISTORICAL_PURGE_DELAY;
210
211
212
213  /** The "fractional-exclude" property definition. */
214  private static final StringPropertyDefinition PD_FRACTIONAL_EXCLUDE;
215
216
217
218  /** The "fractional-include" property definition. */
219  private static final StringPropertyDefinition PD_FRACTIONAL_INCLUDE;
220
221
222
223  /** The "group-id" property definition. */
224  private static final IntegerPropertyDefinition PD_GROUP_ID;
225
226
227
228  /** The "heartbeat-interval" property definition. */
229  private static final DurationPropertyDefinition PD_HEARTBEAT_INTERVAL;
230
231
232
233  /** The "initialization-window-size" property definition. */
234  private static final IntegerPropertyDefinition PD_INITIALIZATION_WINDOW_SIZE;
235
236
237
238  /** The "isolation-policy" property definition. */
239  private static final EnumPropertyDefinition<IsolationPolicy> PD_ISOLATION_POLICY;
240
241
242
243  /** The "log-changenumber" property definition. */
244  private static final BooleanPropertyDefinition PD_LOG_CHANGENUMBER;
245
246
247
248  /** The "referrals-url" property definition. */
249  private static final StringPropertyDefinition PD_REFERRALS_URL;
250
251
252
253  /** The "replication-server" property definition. */
254  private static final StringPropertyDefinition PD_REPLICATION_SERVER;
255
256
257
258  /** The "server-id" property definition. */
259  private static final IntegerPropertyDefinition PD_SERVER_ID;
260
261
262
263  /** The "solve-conflicts" property definition. */
264  private static final BooleanPropertyDefinition PD_SOLVE_CONFLICTS;
265
266
267
268  /** The "source-address" property definition. */
269  private static final IPAddressPropertyDefinition PD_SOURCE_ADDRESS;
270
271
272
273  /** The "window-size" property definition. */
274  private static final IntegerPropertyDefinition PD_WINDOW_SIZE;
275
276
277
278  /** The "external-changelog-domain" relation definition. */
279  private static final SingletonRelationDefinition<ExternalChangelogDomainCfgClient, ExternalChangelogDomainCfg> RD_EXTERNAL_CHANGELOG_DOMAIN;
280
281
282
283  /** Build the "assured-sd-level" property definition. */
284  static {
285      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "assured-sd-level");
286      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "assured-sd-level"));
287      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("1");
288      builder.setDefaultBehaviorProvider(provider);
289      builder.setUpperLimit(127);
290      builder.setLowerLimit(1);
291      PD_ASSURED_SD_LEVEL = builder.getInstance();
292      INSTANCE.registerPropertyDefinition(PD_ASSURED_SD_LEVEL);
293  }
294
295
296
297  /** Build the "assured-timeout" property definition. */
298  static {
299      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "assured-timeout");
300      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "assured-timeout"));
301      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("2000ms");
302      builder.setDefaultBehaviorProvider(provider);
303      builder.setBaseUnit("ms");
304      builder.setLowerLimit("1");
305      PD_ASSURED_TIMEOUT = builder.getInstance();
306      INSTANCE.registerPropertyDefinition(PD_ASSURED_TIMEOUT);
307  }
308
309
310
311  /** Build the "assured-type" property definition. */
312  static {
313      EnumPropertyDefinition.Builder<AssuredType> builder = EnumPropertyDefinition.createBuilder(INSTANCE, "assured-type");
314      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "assured-type"));
315      DefaultBehaviorProvider<AssuredType> provider = new DefinedDefaultBehaviorProvider<AssuredType>("not-assured");
316      builder.setDefaultBehaviorProvider(provider);
317      builder.setEnumClass(AssuredType.class);
318      PD_ASSURED_TYPE = builder.getInstance();
319      INSTANCE.registerPropertyDefinition(PD_ASSURED_TYPE);
320  }
321
322
323
324  /** Build the "base-dn" property definition. */
325  static {
326      DNPropertyDefinition.Builder builder = DNPropertyDefinition.createBuilder(INSTANCE, "base-dn");
327      builder.setOption(PropertyOption.READ_ONLY);
328      builder.setOption(PropertyOption.MANDATORY);
329      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "base-dn"));
330      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<DN>());
331      PD_BASE_DN = builder.getInstance();
332      INSTANCE.registerPropertyDefinition(PD_BASE_DN);
333  }
334
335
336
337  /** Build the "changetime-heartbeat-interval" property definition. */
338  static {
339      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "changetime-heartbeat-interval");
340      builder.setOption(PropertyOption.ADVANCED);
341      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "changetime-heartbeat-interval"));
342      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("1000ms");
343      builder.setDefaultBehaviorProvider(provider);
344      builder.setBaseUnit("ms");
345      builder.setLowerLimit("0");
346      PD_CHANGETIME_HEARTBEAT_INTERVAL = builder.getInstance();
347      INSTANCE.registerPropertyDefinition(PD_CHANGETIME_HEARTBEAT_INTERVAL);
348  }
349
350
351
352  /** Build the "conflicts-historical-purge-delay" property definition. */
353  static {
354      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "conflicts-historical-purge-delay");
355      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "conflicts-historical-purge-delay"));
356      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("1440m");
357      builder.setDefaultBehaviorProvider(provider);
358      builder.setAllowUnlimited(false);
359      builder.setBaseUnit("m");
360      PD_CONFLICTS_HISTORICAL_PURGE_DELAY = builder.getInstance();
361      INSTANCE.registerPropertyDefinition(PD_CONFLICTS_HISTORICAL_PURGE_DELAY);
362  }
363
364
365
366  /** Build the "fractional-exclude" property definition. */
367  static {
368      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "fractional-exclude");
369      builder.setOption(PropertyOption.MULTI_VALUED);
370      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "fractional-exclude"));
371      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
372      builder.setPattern("^((([a-zA-Z]([a-zA-Z]|[0-9]|-|;)*+)|(0|([1-9]([0-9])*+))(\\.(0|([1-9]([0-9])*+)))*+)|\\*):(([a-zA-Z]([a-zA-Z]|[0-9]|-|;)*+)|(0|([1-9]([0-9])*+))(\\.(0|([1-9]([0-9])*+)))*+)(,(([a-zA-Z]([a-zA-Z]|[0-9]|-|;)*+)|(0|([1-9]([0-9])*+))(\\.(0|([1-9]([0-9])*+)))*+))*+$", "OC:AT[,...,AT]");
373      PD_FRACTIONAL_EXCLUDE = builder.getInstance();
374      INSTANCE.registerPropertyDefinition(PD_FRACTIONAL_EXCLUDE);
375  }
376
377
378
379  /** Build the "fractional-include" property definition. */
380  static {
381      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "fractional-include");
382      builder.setOption(PropertyOption.MULTI_VALUED);
383      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "fractional-include"));
384      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
385      builder.setPattern("^((([a-zA-Z]([a-zA-Z]|[0-9]|-|;)*+)|(0|([1-9]([0-9])*+))(\\.(0|([1-9]([0-9])*+)))*+)|\\*):(([a-zA-Z]([a-zA-Z]|[0-9]|-|;)*+)|(0|([1-9]([0-9])*+))(\\.(0|([1-9]([0-9])*+)))*+)(,(([a-zA-Z]([a-zA-Z]|[0-9]|-|;)*+)|(0|([1-9]([0-9])*+))(\\.(0|([1-9]([0-9])*+)))*+))*+$", "OC:AT[,...,AT]");
386      PD_FRACTIONAL_INCLUDE = builder.getInstance();
387      INSTANCE.registerPropertyDefinition(PD_FRACTIONAL_INCLUDE);
388  }
389
390
391
392  /** Build the "group-id" property definition. */
393  static {
394      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "group-id");
395      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "group-id"));
396      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("1");
397      builder.setDefaultBehaviorProvider(provider);
398      builder.setUpperLimit(127);
399      builder.setLowerLimit(1);
400      PD_GROUP_ID = builder.getInstance();
401      INSTANCE.registerPropertyDefinition(PD_GROUP_ID);
402  }
403
404
405
406  /** Build the "heartbeat-interval" property definition. */
407  static {
408      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "heartbeat-interval");
409      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "heartbeat-interval"));
410      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("10000ms");
411      builder.setDefaultBehaviorProvider(provider);
412      builder.setBaseUnit("ms");
413      builder.setLowerLimit("100");
414      PD_HEARTBEAT_INTERVAL = builder.getInstance();
415      INSTANCE.registerPropertyDefinition(PD_HEARTBEAT_INTERVAL);
416  }
417
418
419
420  /** Build the "initialization-window-size" property definition. */
421  static {
422      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "initialization-window-size");
423      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "initialization-window-size"));
424      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("100");
425      builder.setDefaultBehaviorProvider(provider);
426      PD_INITIALIZATION_WINDOW_SIZE = builder.getInstance();
427      INSTANCE.registerPropertyDefinition(PD_INITIALIZATION_WINDOW_SIZE);
428  }
429
430
431
432  /** Build the "isolation-policy" property definition. */
433  static {
434      EnumPropertyDefinition.Builder<IsolationPolicy> builder = EnumPropertyDefinition.createBuilder(INSTANCE, "isolation-policy");
435      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "isolation-policy"));
436      DefaultBehaviorProvider<IsolationPolicy> provider = new DefinedDefaultBehaviorProvider<IsolationPolicy>("reject-all-updates");
437      builder.setDefaultBehaviorProvider(provider);
438      builder.setEnumClass(IsolationPolicy.class);
439      PD_ISOLATION_POLICY = builder.getInstance();
440      INSTANCE.registerPropertyDefinition(PD_ISOLATION_POLICY);
441  }
442
443
444
445  /** Build the "log-changenumber" property definition. */
446  static {
447      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "log-changenumber");
448      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "log-changenumber"));
449      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false");
450      builder.setDefaultBehaviorProvider(provider);
451      PD_LOG_CHANGENUMBER = builder.getInstance();
452      INSTANCE.registerPropertyDefinition(PD_LOG_CHANGENUMBER);
453  }
454
455
456
457  /** Build the "referrals-url" property definition. */
458  static {
459      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "referrals-url");
460      builder.setOption(PropertyOption.MULTI_VALUED);
461      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "referrals-url"));
462      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
463      builder.setPattern("^[lL][dD][aA][pP][sS]?://.+$", "LDAP URL");
464      PD_REFERRALS_URL = builder.getInstance();
465      INSTANCE.registerPropertyDefinition(PD_REFERRALS_URL);
466  }
467
468
469
470  /** Build the "replication-server" property definition. */
471  static {
472      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "replication-server");
473      builder.setOption(PropertyOption.MULTI_VALUED);
474      builder.setOption(PropertyOption.MANDATORY);
475      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "replication-server"));
476      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
477      builder.setPattern("^.+:[0-9]+$", "HOST:PORT");
478      PD_REPLICATION_SERVER = builder.getInstance();
479      INSTANCE.registerPropertyDefinition(PD_REPLICATION_SERVER);
480  }
481
482
483
484  /** Build the "server-id" property definition. */
485  static {
486      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "server-id");
487      builder.setOption(PropertyOption.READ_ONLY);
488      builder.setOption(PropertyOption.MANDATORY);
489      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "server-id"));
490      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<Integer>());
491      builder.setUpperLimit(65535);
492      builder.setLowerLimit(1);
493      PD_SERVER_ID = builder.getInstance();
494      INSTANCE.registerPropertyDefinition(PD_SERVER_ID);
495  }
496
497
498
499  /** Build the "solve-conflicts" property definition. */
500  static {
501      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "solve-conflicts");
502      builder.setOption(PropertyOption.ADVANCED);
503      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "solve-conflicts"));
504      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("true");
505      builder.setDefaultBehaviorProvider(provider);
506      PD_SOLVE_CONFLICTS = builder.getInstance();
507      INSTANCE.registerPropertyDefinition(PD_SOLVE_CONFLICTS);
508  }
509
510
511
512  /** Build the "source-address" property definition. */
513  static {
514      IPAddressPropertyDefinition.Builder builder = IPAddressPropertyDefinition.createBuilder(INSTANCE, "source-address");
515      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "source-address"));
516      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<InetAddress>(INSTANCE, "source-address"));
517      PD_SOURCE_ADDRESS = builder.getInstance();
518      INSTANCE.registerPropertyDefinition(PD_SOURCE_ADDRESS);
519  }
520
521
522
523  /** Build the "window-size" property definition. */
524  static {
525      IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "window-size");
526      builder.setOption(PropertyOption.ADVANCED);
527      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "window-size"));
528      DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("100000");
529      builder.setDefaultBehaviorProvider(provider);
530      PD_WINDOW_SIZE = builder.getInstance();
531      INSTANCE.registerPropertyDefinition(PD_WINDOW_SIZE);
532  }
533
534
535
536  // Build the "external-changelog-domain" relation definition.
537  static {
538    SingletonRelationDefinition.Builder<ExternalChangelogDomainCfgClient, ExternalChangelogDomainCfg> builder =
539      new SingletonRelationDefinition.Builder<ExternalChangelogDomainCfgClient, ExternalChangelogDomainCfg>(INSTANCE, "external-changelog-domain", ExternalChangelogDomainCfgDefn.getInstance());
540    RD_EXTERNAL_CHANGELOG_DOMAIN = builder.getInstance();
541    INSTANCE.registerRelationDefinition(RD_EXTERNAL_CHANGELOG_DOMAIN);
542  }
543
544
545
546  // Register the tags associated with this managed object definition.
547  static {
548    INSTANCE.registerTag(Tag.valueOf("replication"));
549  }
550
551
552
553  /**
554   * Get the Replication Domain configuration definition singleton.
555   *
556   * @return Returns the Replication Domain configuration definition
557   *         singleton.
558   */
559  public static ReplicationDomainCfgDefn getInstance() {
560    return INSTANCE;
561  }
562
563
564
565  /**
566   * Private constructor.
567   */
568  private ReplicationDomainCfgDefn() {
569    super("replication-domain", TopCfgDefn.getInstance());
570  }
571
572
573
574  /** {@inheritDoc} */
575  public ReplicationDomainCfgClient createClientConfiguration(
576      ManagedObject<? extends ReplicationDomainCfgClient> impl) {
577    return new ReplicationDomainCfgClientImpl(impl);
578  }
579
580
581
582  /** {@inheritDoc} */
583  public ReplicationDomainCfg createServerConfiguration(
584      ServerManagedObject<? extends ReplicationDomainCfg> impl) {
585    return new ReplicationDomainCfgServerImpl(impl);
586  }
587
588
589
590  /** {@inheritDoc} */
591  public Class<ReplicationDomainCfg> getServerConfigurationClass() {
592    return ReplicationDomainCfg.class;
593  }
594
595
596
597  /**
598   * Get the "assured-sd-level" property definition.
599   * <p>
600   * The level of acknowledgment for Safe Data assured sub mode.
601   * <p>
602   * When assured replication is configured in Safe Data mode, this
603   * value defines the number of replication servers (with the same
604   * group ID of the local server) that should acknowledge the sent
605   * update before the LDAP client call can return.
606   *
607   * @return Returns the "assured-sd-level" property definition.
608   */
609  public IntegerPropertyDefinition getAssuredSdLevelPropertyDefinition() {
610    return PD_ASSURED_SD_LEVEL;
611  }
612
613
614
615  /**
616   * Get the "assured-timeout" property definition.
617   * <p>
618   * The timeout value when waiting for assured replication
619   * acknowledgments.
620   * <p>
621   * Defines the amount of milliseconds the server will wait for
622   * assured acknowledgments (in either Safe Data or Safe Read assured
623   * replication modes) before returning anyway the LDAP client call.
624   *
625   * @return Returns the "assured-timeout" property definition.
626   */
627  public DurationPropertyDefinition getAssuredTimeoutPropertyDefinition() {
628    return PD_ASSURED_TIMEOUT;
629  }
630
631
632
633  /**
634   * Get the "assured-type" property definition.
635   * <p>
636   * Defines the assured replication mode of the replicated domain.
637   * <p>
638   * The assured replication can be disabled or enabled. When enabled,
639   * two modes are available: Safe Data or Safe Read modes.
640   *
641   * @return Returns the "assured-type" property definition.
642   */
643  public EnumPropertyDefinition<AssuredType> getAssuredTypePropertyDefinition() {
644    return PD_ASSURED_TYPE;
645  }
646
647
648
649  /**
650   * Get the "base-dn" property definition.
651   * <p>
652   * Specifies the base DN of the replicated data.
653   *
654   * @return Returns the "base-dn" property definition.
655   */
656  public DNPropertyDefinition getBaseDNPropertyDefinition() {
657    return PD_BASE_DN;
658  }
659
660
661
662  /**
663   * Get the "changetime-heartbeat-interval" property definition.
664   * <p>
665   * Specifies the heart-beat interval that the directory server will
666   * use when sending its local change time to the Replication Server.
667   * <p>
668   * The directory server sends a regular heart-beat to the
669   * Replication within the specified interval. The heart-beat
670   * indicates the change time of the directory server to the
671   * Replication Server.
672   *
673   * @return Returns the "changetime-heartbeat-interval" property definition.
674   */
675  public DurationPropertyDefinition getChangetimeHeartbeatIntervalPropertyDefinition() {
676    return PD_CHANGETIME_HEARTBEAT_INTERVAL;
677  }
678
679
680
681  /**
682   * Get the "conflicts-historical-purge-delay" property definition.
683   * <p>
684   * This delay indicates the time (in minutes) the domain keeps the
685   * historical information necessary to solve conflicts.When a change
686   * stored in the historical part of the user entry has a date (from
687   * its replication ChangeNumber) older than this delay, it is
688   * candidate to be purged. The purge is applied on 2 events: modify
689   * of the entry, dedicated purge task.
690   *
691   * @return Returns the "conflicts-historical-purge-delay" property definition.
692   */
693  public DurationPropertyDefinition getConflictsHistoricalPurgeDelayPropertyDefinition() {
694    return PD_CONFLICTS_HISTORICAL_PURGE_DELAY;
695  }
696
697
698
699  /**
700   * Get the "fractional-exclude" property definition.
701   * <p>
702   * Allows to exclude some attributes to replicate to this server.
703   * <p>
704   * If fractional-exclude configuration attribute is used, attributes
705   * specified in this attribute will be ignored (not
706   * added/modified/deleted) when an operation performed from another
707   * directory server is being replayed in the local server. Note that
708   * the usage of this configuration attribute is mutually exclusive
709   * with the usage of the fractional-include attribute.
710   *
711   * @return Returns the "fractional-exclude" property definition.
712   */
713  public StringPropertyDefinition getFractionalExcludePropertyDefinition() {
714    return PD_FRACTIONAL_EXCLUDE;
715  }
716
717
718
719  /**
720   * Get the "fractional-include" property definition.
721   * <p>
722   * Allows to include some attributes to replicate to this server.
723   * <p>
724   * If fractional-include configuration attribute is used, only
725   * attributes specified in this attribute will be
726   * added/modified/deleted when an operation performed from another
727   * directory server is being replayed in the local server. Note that
728   * the usage of this configuration attribute is mutually exclusive
729   * with the usage of the fractional-exclude attribute.
730   *
731   * @return Returns the "fractional-include" property definition.
732   */
733  public StringPropertyDefinition getFractionalIncludePropertyDefinition() {
734    return PD_FRACTIONAL_INCLUDE;
735  }
736
737
738
739  /**
740   * Get the "group-id" property definition.
741   * <p>
742   * The group ID associated with this replicated domain.
743   * <p>
744   * This value defines the group ID of the replicated domain. The
745   * replication system will preferably connect and send updates to
746   * replicate to a replication server with the same group ID as its
747   * own one (the local server group ID).
748   *
749   * @return Returns the "group-id" property definition.
750   */
751  public IntegerPropertyDefinition getGroupIdPropertyDefinition() {
752    return PD_GROUP_ID;
753  }
754
755
756
757  /**
758   * Get the "heartbeat-interval" property definition.
759   * <p>
760   * Specifies the heart-beat interval that the directory server will
761   * use when communicating with Replication Servers.
762   * <p>
763   * The directory server expects a regular heart-beat coming from the
764   * Replication Server within the specified interval. If a heartbeat
765   * is not received within the interval, the Directory Server closes
766   * its connection and connects to another Replication Server.
767   *
768   * @return Returns the "heartbeat-interval" property definition.
769   */
770  public DurationPropertyDefinition getHeartbeatIntervalPropertyDefinition() {
771    return PD_HEARTBEAT_INTERVAL;
772  }
773
774
775
776  /**
777   * Get the "initialization-window-size" property definition.
778   * <p>
779   * Specifies the window size that this directory server may use when
780   * communicating with remote Directory Servers for initialization.
781   *
782   * @return Returns the "initialization-window-size" property definition.
783   */
784  public IntegerPropertyDefinition getInitializationWindowSizePropertyDefinition() {
785    return PD_INITIALIZATION_WINDOW_SIZE;
786  }
787
788
789
790  /**
791   * Get the "isolation-policy" property definition.
792   * <p>
793   * Specifies the behavior of the directory server if a write
794   * operation is attempted on the data within the Replication Domain
795   * when none of the configured Replication Servers are available.
796   *
797   * @return Returns the "isolation-policy" property definition.
798   */
799  public EnumPropertyDefinition<IsolationPolicy> getIsolationPolicyPropertyDefinition() {
800    return PD_ISOLATION_POLICY;
801  }
802
803
804
805  /**
806   * Get the "log-changenumber" property definition.
807   * <p>
808   * Indicates if this server logs the ChangeNumber in access log.
809   * <p>
810   * This boolean indicates if the domain should log the ChangeNumber
811   * of replicated operations in the access log.
812   *
813   * @return Returns the "log-changenumber" property definition.
814   */
815  public BooleanPropertyDefinition getLogChangenumberPropertyDefinition() {
816    return PD_LOG_CHANGENUMBER;
817  }
818
819
820
821  /**
822   * Get the "referrals-url" property definition.
823   * <p>
824   * The URLs other LDAP servers should use to refer to the local
825   * server.
826   * <p>
827   * URLs used by peer servers in the topology to refer to the local
828   * server through LDAP referrals. If this attribute is not defined,
829   * every URLs available to access this server will be used. If
830   * defined, only URLs specified here will be used.
831   *
832   * @return Returns the "referrals-url" property definition.
833   */
834  public StringPropertyDefinition getReferralsUrlPropertyDefinition() {
835    return PD_REFERRALS_URL;
836  }
837
838
839
840  /**
841   * Get the "replication-server" property definition.
842   * <p>
843   * Specifies the addresses of the Replication Servers within the
844   * Replication Domain to which the directory server should try to
845   * connect at startup time.
846   * <p>
847   * Addresses must be specified using the syntax: hostname:port
848   *
849   * @return Returns the "replication-server" property definition.
850   */
851  public StringPropertyDefinition getReplicationServerPropertyDefinition() {
852    return PD_REPLICATION_SERVER;
853  }
854
855
856
857  /**
858   * Get the "server-id" property definition.
859   * <p>
860   * Specifies a unique identifier for the directory server within the
861   * Replication Domain.
862   * <p>
863   * Each directory server within the same Replication Domain must
864   * have a different server ID. A directory server which is a member
865   * of multiple Replication Domains may use the same server ID for
866   * each of its Replication Domain configurations.
867   *
868   * @return Returns the "server-id" property definition.
869   */
870  public IntegerPropertyDefinition getServerIdPropertyDefinition() {
871    return PD_SERVER_ID;
872  }
873
874
875
876  /**
877   * Get the "solve-conflicts" property definition.
878   * <p>
879   * Indicates if this server solves conflict.
880   * <p>
881   * This boolean indicates if this domain keeps the historical
882   * information necessary to solve conflicts. When set to false the
883   * server will not maintain historical information and will therefore
884   * not be able to solve conflict. This should therefore be done only
885   * if the replication is used in a single master type of deployment.
886   *
887   * @return Returns the "solve-conflicts" property definition.
888   */
889  public BooleanPropertyDefinition getSolveConflictsPropertyDefinition() {
890    return PD_SOLVE_CONFLICTS;
891  }
892
893
894
895  /**
896   * Get the "source-address" property definition.
897   * <p>
898   * If specified, the server will bind to the address before
899   * connecting to the remote server.
900   * <p>
901   * The address must be one assigned to an existing network
902   * interface.
903   *
904   * @return Returns the "source-address" property definition.
905   */
906  public IPAddressPropertyDefinition getSourceAddressPropertyDefinition() {
907    return PD_SOURCE_ADDRESS;
908  }
909
910
911
912  /**
913   * Get the "window-size" property definition.
914   * <p>
915   * Specifies the window size that the directory server will use when
916   * communicating with Replication Servers.
917   * <p>
918   * This option may be deprecated and removed in future releases.
919   *
920   * @return Returns the "window-size" property definition.
921   */
922  public IntegerPropertyDefinition getWindowSizePropertyDefinition() {
923    return PD_WINDOW_SIZE;
924  }
925
926
927
928  /**
929   * Get the "external-changelog-domain" relation definition.
930   *
931   * @return Returns the "external-changelog-domain" relation definition.
932   */
933  public SingletonRelationDefinition<ExternalChangelogDomainCfgClient,ExternalChangelogDomainCfg> getExternalChangelogDomainRelationDefinition() {
934    return RD_EXTERNAL_CHANGELOG_DOMAIN;
935  }
936
937
938
939  /**
940   * Managed object client implementation.
941   */
942  private static class ReplicationDomainCfgClientImpl implements
943    ReplicationDomainCfgClient {
944
945    /** Private implementation. */
946    private ManagedObject<? extends ReplicationDomainCfgClient> impl;
947
948
949
950    /** Private constructor. */
951    private ReplicationDomainCfgClientImpl(
952        ManagedObject<? extends ReplicationDomainCfgClient> impl) {
953      this.impl = impl;
954    }
955
956
957
958    /** {@inheritDoc} */
959    public int getAssuredSdLevel() {
960      return impl.getPropertyValue(INSTANCE.getAssuredSdLevelPropertyDefinition());
961    }
962
963
964
965    /** {@inheritDoc} */
966    public void setAssuredSdLevel(Integer value) {
967      impl.setPropertyValue(INSTANCE.getAssuredSdLevelPropertyDefinition(), value);
968    }
969
970
971
972    /** {@inheritDoc} */
973    public long getAssuredTimeout() {
974      return impl.getPropertyValue(INSTANCE.getAssuredTimeoutPropertyDefinition());
975    }
976
977
978
979    /** {@inheritDoc} */
980    public void setAssuredTimeout(Long value) {
981      impl.setPropertyValue(INSTANCE.getAssuredTimeoutPropertyDefinition(), value);
982    }
983
984
985
986    /** {@inheritDoc} */
987    public AssuredType getAssuredType() {
988      return impl.getPropertyValue(INSTANCE.getAssuredTypePropertyDefinition());
989    }
990
991
992
993    /** {@inheritDoc} */
994    public void setAssuredType(AssuredType value) {
995      impl.setPropertyValue(INSTANCE.getAssuredTypePropertyDefinition(), value);
996    }
997
998
999
1000    /** {@inheritDoc} */
1001    public DN getBaseDN() {
1002      return impl.getPropertyValue(INSTANCE.getBaseDNPropertyDefinition());
1003    }
1004
1005
1006
1007    /** {@inheritDoc} */
1008    public void setBaseDN(DN value) throws PropertyException {
1009      impl.setPropertyValue(INSTANCE.getBaseDNPropertyDefinition(), value);
1010    }
1011
1012
1013
1014    /** {@inheritDoc} */
1015    public long getChangetimeHeartbeatInterval() {
1016      return impl.getPropertyValue(INSTANCE.getChangetimeHeartbeatIntervalPropertyDefinition());
1017    }
1018
1019
1020
1021    /** {@inheritDoc} */
1022    public void setChangetimeHeartbeatInterval(Long value) {
1023      impl.setPropertyValue(INSTANCE.getChangetimeHeartbeatIntervalPropertyDefinition(), value);
1024    }
1025
1026
1027
1028    /** {@inheritDoc} */
1029    public long getConflictsHistoricalPurgeDelay() {
1030      return impl.getPropertyValue(INSTANCE.getConflictsHistoricalPurgeDelayPropertyDefinition());
1031    }
1032
1033
1034
1035    /** {@inheritDoc} */
1036    public void setConflictsHistoricalPurgeDelay(Long value) {
1037      impl.setPropertyValue(INSTANCE.getConflictsHistoricalPurgeDelayPropertyDefinition(), value);
1038    }
1039
1040
1041
1042    /** {@inheritDoc} */
1043    public SortedSet<String> getFractionalExclude() {
1044      return impl.getPropertyValues(INSTANCE.getFractionalExcludePropertyDefinition());
1045    }
1046
1047
1048
1049    /** {@inheritDoc} */
1050    public void setFractionalExclude(Collection<String> values) {
1051      impl.setPropertyValues(INSTANCE.getFractionalExcludePropertyDefinition(), values);
1052    }
1053
1054
1055
1056    /** {@inheritDoc} */
1057    public SortedSet<String> getFractionalInclude() {
1058      return impl.getPropertyValues(INSTANCE.getFractionalIncludePropertyDefinition());
1059    }
1060
1061
1062
1063    /** {@inheritDoc} */
1064    public void setFractionalInclude(Collection<String> values) {
1065      impl.setPropertyValues(INSTANCE.getFractionalIncludePropertyDefinition(), values);
1066    }
1067
1068
1069
1070    /** {@inheritDoc} */
1071    public int getGroupId() {
1072      return impl.getPropertyValue(INSTANCE.getGroupIdPropertyDefinition());
1073    }
1074
1075
1076
1077    /** {@inheritDoc} */
1078    public void setGroupId(Integer value) {
1079      impl.setPropertyValue(INSTANCE.getGroupIdPropertyDefinition(), value);
1080    }
1081
1082
1083
1084    /** {@inheritDoc} */
1085    public long getHeartbeatInterval() {
1086      return impl.getPropertyValue(INSTANCE.getHeartbeatIntervalPropertyDefinition());
1087    }
1088
1089
1090
1091    /** {@inheritDoc} */
1092    public void setHeartbeatInterval(Long value) {
1093      impl.setPropertyValue(INSTANCE.getHeartbeatIntervalPropertyDefinition(), value);
1094    }
1095
1096
1097
1098    /** {@inheritDoc} */
1099    public int getInitializationWindowSize() {
1100      return impl.getPropertyValue(INSTANCE.getInitializationWindowSizePropertyDefinition());
1101    }
1102
1103
1104
1105    /** {@inheritDoc} */
1106    public void setInitializationWindowSize(Integer value) {
1107      impl.setPropertyValue(INSTANCE.getInitializationWindowSizePropertyDefinition(), value);
1108    }
1109
1110
1111
1112    /** {@inheritDoc} */
1113    public IsolationPolicy getIsolationPolicy() {
1114      return impl.getPropertyValue(INSTANCE.getIsolationPolicyPropertyDefinition());
1115    }
1116
1117
1118
1119    /** {@inheritDoc} */
1120    public void setIsolationPolicy(IsolationPolicy value) {
1121      impl.setPropertyValue(INSTANCE.getIsolationPolicyPropertyDefinition(), value);
1122    }
1123
1124
1125
1126    /** {@inheritDoc} */
1127    public boolean isLogChangenumber() {
1128      return impl.getPropertyValue(INSTANCE.getLogChangenumberPropertyDefinition());
1129    }
1130
1131
1132
1133    /** {@inheritDoc} */
1134    public void setLogChangenumber(Boolean value) {
1135      impl.setPropertyValue(INSTANCE.getLogChangenumberPropertyDefinition(), value);
1136    }
1137
1138
1139
1140    /** {@inheritDoc} */
1141    public SortedSet<String> getReferralsUrl() {
1142      return impl.getPropertyValues(INSTANCE.getReferralsUrlPropertyDefinition());
1143    }
1144
1145
1146
1147    /** {@inheritDoc} */
1148    public void setReferralsUrl(Collection<String> values) {
1149      impl.setPropertyValues(INSTANCE.getReferralsUrlPropertyDefinition(), values);
1150    }
1151
1152
1153
1154    /** {@inheritDoc} */
1155    public SortedSet<String> getReplicationServer() {
1156      return impl.getPropertyValues(INSTANCE.getReplicationServerPropertyDefinition());
1157    }
1158
1159
1160
1161    /** {@inheritDoc} */
1162    public void setReplicationServer(Collection<String> values) {
1163      impl.setPropertyValues(INSTANCE.getReplicationServerPropertyDefinition(), values);
1164    }
1165
1166
1167
1168    /** {@inheritDoc} */
1169    public Integer getServerId() {
1170      return impl.getPropertyValue(INSTANCE.getServerIdPropertyDefinition());
1171    }
1172
1173
1174
1175    /** {@inheritDoc} */
1176    public void setServerId(int value) throws PropertyException {
1177      impl.setPropertyValue(INSTANCE.getServerIdPropertyDefinition(), value);
1178    }
1179
1180
1181
1182    /** {@inheritDoc} */
1183    public boolean isSolveConflicts() {
1184      return impl.getPropertyValue(INSTANCE.getSolveConflictsPropertyDefinition());
1185    }
1186
1187
1188
1189    /** {@inheritDoc} */
1190    public void setSolveConflicts(Boolean value) {
1191      impl.setPropertyValue(INSTANCE.getSolveConflictsPropertyDefinition(), value);
1192    }
1193
1194
1195
1196    /** {@inheritDoc} */
1197    public InetAddress getSourceAddress() {
1198      return impl.getPropertyValue(INSTANCE.getSourceAddressPropertyDefinition());
1199    }
1200
1201
1202
1203    /** {@inheritDoc} */
1204    public void setSourceAddress(InetAddress value) {
1205      impl.setPropertyValue(INSTANCE.getSourceAddressPropertyDefinition(), value);
1206    }
1207
1208
1209
1210    /** {@inheritDoc} */
1211    public int getWindowSize() {
1212      return impl.getPropertyValue(INSTANCE.getWindowSizePropertyDefinition());
1213    }
1214
1215
1216
1217    /** {@inheritDoc} */
1218    public void setWindowSize(Integer value) {
1219      impl.setPropertyValue(INSTANCE.getWindowSizePropertyDefinition(), value);
1220    }
1221
1222
1223
1224    /** {@inheritDoc} */
1225    public ExternalChangelogDomainCfgClient getExternalChangelogDomain()
1226        throws DefinitionDecodingException, ManagedObjectDecodingException,
1227        ManagedObjectNotFoundException, ConcurrentModificationException,
1228        LdapException {
1229      return impl.getChild(INSTANCE.getExternalChangelogDomainRelationDefinition()).getConfiguration();
1230    }
1231
1232
1233
1234    /** {@inheritDoc} */
1235    public ManagedObjectDefinition<? extends ReplicationDomainCfgClient, ? extends ReplicationDomainCfg> definition() {
1236      return INSTANCE;
1237    }
1238
1239
1240
1241    /** {@inheritDoc} */
1242    public PropertyProvider properties() {
1243      return impl;
1244    }
1245
1246
1247
1248    /** {@inheritDoc} */
1249    public void commit() throws ManagedObjectAlreadyExistsException,
1250        MissingMandatoryPropertiesException, ConcurrentModificationException,
1251        OperationRejectedException, LdapException {
1252      impl.commit();
1253    }
1254
1255
1256
1257    /** {@inheritDoc} */
1258    public String toString() {
1259      return impl.toString();
1260    }
1261  }
1262
1263
1264
1265  /**
1266   * Managed object server implementation.
1267   */
1268  private static class ReplicationDomainCfgServerImpl implements
1269    ReplicationDomainCfg {
1270
1271    /** Private implementation. */
1272    private ServerManagedObject<? extends ReplicationDomainCfg> impl;
1273
1274    /** The value of the "assured-sd-level" property. */
1275    private final int pAssuredSdLevel;
1276
1277    /** The value of the "assured-timeout" property. */
1278    private final long pAssuredTimeout;
1279
1280    /** The value of the "assured-type" property. */
1281    private final AssuredType pAssuredType;
1282
1283    /** The value of the "base-dn" property. */
1284    private final DN pBaseDN;
1285
1286    /** The value of the "changetime-heartbeat-interval" property. */
1287    private final long pChangetimeHeartbeatInterval;
1288
1289    /** The value of the "conflicts-historical-purge-delay" property. */
1290    private final long pConflictsHistoricalPurgeDelay;
1291
1292    /** The value of the "fractional-exclude" property. */
1293    private final SortedSet<String> pFractionalExclude;
1294
1295    /** The value of the "fractional-include" property. */
1296    private final SortedSet<String> pFractionalInclude;
1297
1298    /** The value of the "group-id" property. */
1299    private final int pGroupId;
1300
1301    /** The value of the "heartbeat-interval" property. */
1302    private final long pHeartbeatInterval;
1303
1304    /** The value of the "initialization-window-size" property. */
1305    private final int pInitializationWindowSize;
1306
1307    /** The value of the "isolation-policy" property. */
1308    private final IsolationPolicy pIsolationPolicy;
1309
1310    /** The value of the "log-changenumber" property. */
1311    private final boolean pLogChangenumber;
1312
1313    /** The value of the "referrals-url" property. */
1314    private final SortedSet<String> pReferralsUrl;
1315
1316    /** The value of the "replication-server" property. */
1317    private final SortedSet<String> pReplicationServer;
1318
1319    /** The value of the "server-id" property. */
1320    private final int pServerId;
1321
1322    /** The value of the "solve-conflicts" property. */
1323    private final boolean pSolveConflicts;
1324
1325    /** The value of the "source-address" property. */
1326    private final InetAddress pSourceAddress;
1327
1328    /** The value of the "window-size" property. */
1329    private final int pWindowSize;
1330
1331
1332
1333    /** Private constructor. */
1334    private ReplicationDomainCfgServerImpl(ServerManagedObject<? extends ReplicationDomainCfg> impl) {
1335      this.impl = impl;
1336      this.pAssuredSdLevel = impl.getPropertyValue(INSTANCE.getAssuredSdLevelPropertyDefinition());
1337      this.pAssuredTimeout = impl.getPropertyValue(INSTANCE.getAssuredTimeoutPropertyDefinition());
1338      this.pAssuredType = impl.getPropertyValue(INSTANCE.getAssuredTypePropertyDefinition());
1339      this.pBaseDN = impl.getPropertyValue(INSTANCE.getBaseDNPropertyDefinition());
1340      this.pChangetimeHeartbeatInterval = impl.getPropertyValue(INSTANCE.getChangetimeHeartbeatIntervalPropertyDefinition());
1341      this.pConflictsHistoricalPurgeDelay = impl.getPropertyValue(INSTANCE.getConflictsHistoricalPurgeDelayPropertyDefinition());
1342      this.pFractionalExclude = impl.getPropertyValues(INSTANCE.getFractionalExcludePropertyDefinition());
1343      this.pFractionalInclude = impl.getPropertyValues(INSTANCE.getFractionalIncludePropertyDefinition());
1344      this.pGroupId = impl.getPropertyValue(INSTANCE.getGroupIdPropertyDefinition());
1345      this.pHeartbeatInterval = impl.getPropertyValue(INSTANCE.getHeartbeatIntervalPropertyDefinition());
1346      this.pInitializationWindowSize = impl.getPropertyValue(INSTANCE.getInitializationWindowSizePropertyDefinition());
1347      this.pIsolationPolicy = impl.getPropertyValue(INSTANCE.getIsolationPolicyPropertyDefinition());
1348      this.pLogChangenumber = impl.getPropertyValue(INSTANCE.getLogChangenumberPropertyDefinition());
1349      this.pReferralsUrl = impl.getPropertyValues(INSTANCE.getReferralsUrlPropertyDefinition());
1350      this.pReplicationServer = impl.getPropertyValues(INSTANCE.getReplicationServerPropertyDefinition());
1351      this.pServerId = impl.getPropertyValue(INSTANCE.getServerIdPropertyDefinition());
1352      this.pSolveConflicts = impl.getPropertyValue(INSTANCE.getSolveConflictsPropertyDefinition());
1353      this.pSourceAddress = impl.getPropertyValue(INSTANCE.getSourceAddressPropertyDefinition());
1354      this.pWindowSize = impl.getPropertyValue(INSTANCE.getWindowSizePropertyDefinition());
1355    }
1356
1357
1358
1359    /** {@inheritDoc} */
1360    public void addChangeListener(
1361        ConfigurationChangeListener<ReplicationDomainCfg> listener) {
1362      impl.registerChangeListener(listener);
1363    }
1364
1365
1366
1367    /** {@inheritDoc} */
1368    public void removeChangeListener(
1369        ConfigurationChangeListener<ReplicationDomainCfg> listener) {
1370      impl.deregisterChangeListener(listener);
1371    }
1372
1373
1374
1375    /** {@inheritDoc} */
1376    public int getAssuredSdLevel() {
1377      return pAssuredSdLevel;
1378    }
1379
1380
1381
1382    /** {@inheritDoc} */
1383    public long getAssuredTimeout() {
1384      return pAssuredTimeout;
1385    }
1386
1387
1388
1389    /** {@inheritDoc} */
1390    public AssuredType getAssuredType() {
1391      return pAssuredType;
1392    }
1393
1394
1395
1396    /** {@inheritDoc} */
1397    public DN getBaseDN() {
1398      return pBaseDN;
1399    }
1400
1401
1402
1403    /** {@inheritDoc} */
1404    public long getChangetimeHeartbeatInterval() {
1405      return pChangetimeHeartbeatInterval;
1406    }
1407
1408
1409
1410    /** {@inheritDoc} */
1411    public long getConflictsHistoricalPurgeDelay() {
1412      return pConflictsHistoricalPurgeDelay;
1413    }
1414
1415
1416
1417    /** {@inheritDoc} */
1418    public SortedSet<String> getFractionalExclude() {
1419      return pFractionalExclude;
1420    }
1421
1422
1423
1424    /** {@inheritDoc} */
1425    public SortedSet<String> getFractionalInclude() {
1426      return pFractionalInclude;
1427    }
1428
1429
1430
1431    /** {@inheritDoc} */
1432    public int getGroupId() {
1433      return pGroupId;
1434    }
1435
1436
1437
1438    /** {@inheritDoc} */
1439    public long getHeartbeatInterval() {
1440      return pHeartbeatInterval;
1441    }
1442
1443
1444
1445    /** {@inheritDoc} */
1446    public int getInitializationWindowSize() {
1447      return pInitializationWindowSize;
1448    }
1449
1450
1451
1452    /** {@inheritDoc} */
1453    public IsolationPolicy getIsolationPolicy() {
1454      return pIsolationPolicy;
1455    }
1456
1457
1458
1459    /** {@inheritDoc} */
1460    public boolean isLogChangenumber() {
1461      return pLogChangenumber;
1462    }
1463
1464
1465
1466    /** {@inheritDoc} */
1467    public SortedSet<String> getReferralsUrl() {
1468      return pReferralsUrl;
1469    }
1470
1471
1472
1473    /** {@inheritDoc} */
1474    public SortedSet<String> getReplicationServer() {
1475      return pReplicationServer;
1476    }
1477
1478
1479
1480    /** {@inheritDoc} */
1481    public int getServerId() {
1482      return pServerId;
1483    }
1484
1485
1486
1487    /** {@inheritDoc} */
1488    public boolean isSolveConflicts() {
1489      return pSolveConflicts;
1490    }
1491
1492
1493
1494    /** {@inheritDoc} */
1495    public InetAddress getSourceAddress() {
1496      return pSourceAddress;
1497    }
1498
1499
1500
1501    /** {@inheritDoc} */
1502    public int getWindowSize() {
1503      return pWindowSize;
1504    }
1505
1506
1507
1508    /** {@inheritDoc} */
1509    public ExternalChangelogDomainCfg getExternalChangelogDomain() throws ConfigException {
1510      return impl.getChild(INSTANCE.getExternalChangelogDomainRelationDefinition()).getConfiguration();
1511    }
1512
1513
1514
1515    /** {@inheritDoc} */
1516    public Class<? extends ReplicationDomainCfg> configurationClass() {
1517      return ReplicationDomainCfg.class;
1518    }
1519
1520
1521
1522    /** {@inheritDoc} */
1523    public DN dn() {
1524      return impl.getDN();
1525    }
1526
1527
1528
1529    /** {@inheritDoc} */
1530    public String toString() {
1531      return impl.toString();
1532    }
1533  }
1534}