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