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