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