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