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.client; 027 028 029 030import java.net.InetAddress; 031import java.util.Collection; 032import java.util.SortedSet; 033import org.opends.server.admin.client.AuthorizationException; 034import org.opends.server.admin.client.CommunicationException; 035import org.opends.server.admin.client.ConcurrentModificationException; 036import org.opends.server.admin.client.ManagedObjectDecodingException; 037import org.opends.server.admin.ConfigurationClient; 038import org.opends.server.admin.DefinitionDecodingException; 039import org.opends.server.admin.ManagedObjectDefinition; 040import org.opends.server.admin.ManagedObjectNotFoundException; 041import org.opends.server.admin.PropertyException; 042import org.opends.server.admin.std.meta.ReplicationDomainCfgDefn.AssuredType; 043import org.opends.server.admin.std.meta.ReplicationDomainCfgDefn.IsolationPolicy; 044import org.opends.server.admin.std.server.ReplicationDomainCfg; 045import org.opends.server.types.DN; 046 047 048 049/** 050 * A client-side interface for reading and modifying Replication 051 * Domain settings. 052 * <p> 053 * A Replication Domain comprises of several Directory Servers sharing 054 * the same synchronized set of data. 055 */ 056public interface ReplicationDomainCfgClient extends ConfigurationClient { 057 058 /** 059 * Get the configuration definition associated with this Replication Domain. 060 * 061 * @return Returns the configuration definition associated with this Replication Domain. 062 */ 063 ManagedObjectDefinition<? extends ReplicationDomainCfgClient, ? extends ReplicationDomainCfg> definition(); 064 065 066 067 /** 068 * Gets the "assured-sd-level" property. 069 * <p> 070 * The level of acknowledgment for Safe Data assured sub mode. 071 * <p> 072 * When assured replication is configured in Safe Data mode, this 073 * value defines the number of replication servers (with the same 074 * group ID of the local server) that should acknowledge the sent 075 * update before the LDAP client call can return. 076 * 077 * @return Returns the value of the "assured-sd-level" property. 078 */ 079 int getAssuredSdLevel(); 080 081 082 083 /** 084 * Sets the "assured-sd-level" property. 085 * <p> 086 * The level of acknowledgment for Safe Data assured sub mode. 087 * <p> 088 * When assured replication is configured in Safe Data mode, this 089 * value defines the number of replication servers (with the same 090 * group ID of the local server) that should acknowledge the sent 091 * update before the LDAP client call can return. 092 * 093 * @param value The value of the "assured-sd-level" property. 094 * @throws PropertyException 095 * If the new value is invalid. 096 */ 097 void setAssuredSdLevel(Integer value) throws PropertyException; 098 099 100 101 /** 102 * Gets the "assured-timeout" property. 103 * <p> 104 * The timeout value when waiting for assured replication 105 * acknowledgments. 106 * <p> 107 * Defines the amount of milliseconds the server will wait for 108 * assured acknowledgments (in either Safe Data or Safe Read assured 109 * replication modes) before returning anyway the LDAP client call. 110 * 111 * @return Returns the value of the "assured-timeout" property. 112 */ 113 long getAssuredTimeout(); 114 115 116 117 /** 118 * Sets the "assured-timeout" property. 119 * <p> 120 * The timeout value when waiting for assured replication 121 * acknowledgments. 122 * <p> 123 * Defines the amount of milliseconds the server will wait for 124 * assured acknowledgments (in either Safe Data or Safe Read assured 125 * replication modes) before returning anyway the LDAP client call. 126 * 127 * @param value The value of the "assured-timeout" property. 128 * @throws PropertyException 129 * If the new value is invalid. 130 */ 131 void setAssuredTimeout(Long value) throws PropertyException; 132 133 134 135 /** 136 * Gets the "assured-type" property. 137 * <p> 138 * Defines the assured replication mode of the replicated domain. 139 * <p> 140 * The assured replication can be disabled or enabled. When enabled, 141 * two modes are available: Safe Data or Safe Read modes. 142 * 143 * @return Returns the value of the "assured-type" property. 144 */ 145 AssuredType getAssuredType(); 146 147 148 149 /** 150 * Sets the "assured-type" property. 151 * <p> 152 * Defines the assured replication mode of the replicated domain. 153 * <p> 154 * The assured replication can be disabled or enabled. When enabled, 155 * two modes are available: Safe Data or Safe Read modes. 156 * 157 * @param value The value of the "assured-type" property. 158 * @throws PropertyException 159 * If the new value is invalid. 160 */ 161 void setAssuredType(AssuredType value) throws PropertyException; 162 163 164 165 /** 166 * Gets the "base-dn" property. 167 * <p> 168 * Specifies the base DN of the replicated data. 169 * 170 * @return Returns the value of the "base-dn" property. 171 */ 172 DN getBaseDN(); 173 174 175 176 /** 177 * Sets the "base-dn" property. 178 * <p> 179 * Specifies the base DN of the replicated data. 180 * <p> 181 * This property is read-only and can only be modified during 182 * creation of a Replication Domain. 183 * 184 * @param value The value of the "base-dn" property. 185 * @throws PropertyException 186 * If the new value is invalid. 187 * @throws PropertyException 188 * If this Replication Domain is not being initialized. 189 */ 190 void setBaseDN(DN value) throws PropertyException, PropertyException; 191 192 193 194 /** 195 * Gets the "changetime-heartbeat-interval" property. 196 * <p> 197 * Specifies the heart-beat interval that the directory server will 198 * use when sending its local change time to the Replication Server. 199 * <p> 200 * The directory server sends a regular heart-beat to the 201 * Replication within the specified interval. The heart-beat 202 * indicates the change time of the directory server to the 203 * Replication Server. 204 * 205 * @return Returns the value of the "changetime-heartbeat-interval" property. 206 */ 207 long getChangetimeHeartbeatInterval(); 208 209 210 211 /** 212 * Sets the "changetime-heartbeat-interval" property. 213 * <p> 214 * Specifies the heart-beat interval that the directory server will 215 * use when sending its local change time to the Replication Server. 216 * <p> 217 * The directory server sends a regular heart-beat to the 218 * Replication within the specified interval. The heart-beat 219 * indicates the change time of the directory server to the 220 * Replication Server. 221 * 222 * @param value The value of the "changetime-heartbeat-interval" property. 223 * @throws PropertyException 224 * If the new value is invalid. 225 */ 226 void setChangetimeHeartbeatInterval(Long value) throws PropertyException; 227 228 229 230 /** 231 * Gets the "conflicts-historical-purge-delay" property. 232 * <p> 233 * This delay indicates the time (in minutes) the domain keeps the 234 * historical information necessary to solve conflicts.When a change 235 * stored in the historical part of the user entry has a date (from 236 * its replication ChangeNumber) older than this delay, it is 237 * candidate to be purged. The purge is applied on 2 events: modify 238 * of the entry, dedicated purge task. 239 * 240 * @return Returns the value of the "conflicts-historical-purge-delay" property. 241 */ 242 long getConflictsHistoricalPurgeDelay(); 243 244 245 246 /** 247 * Sets the "conflicts-historical-purge-delay" property. 248 * <p> 249 * This delay indicates the time (in minutes) the domain keeps the 250 * historical information necessary to solve conflicts.When a change 251 * stored in the historical part of the user entry has a date (from 252 * its replication ChangeNumber) older than this delay, it is 253 * candidate to be purged. The purge is applied on 2 events: modify 254 * of the entry, dedicated purge task. 255 * 256 * @param value The value of the "conflicts-historical-purge-delay" property. 257 * @throws PropertyException 258 * If the new value is invalid. 259 */ 260 void setConflictsHistoricalPurgeDelay(Long value) throws PropertyException; 261 262 263 264 /** 265 * Gets the "fractional-exclude" property. 266 * <p> 267 * Allows to exclude some attributes to replicate to this server. 268 * <p> 269 * If fractional-exclude configuration attribute is used, attributes 270 * specified in this attribute will be ignored (not 271 * added/modified/deleted) when an operation performed from another 272 * directory server is being replayed in the local server. Note that 273 * the usage of this configuration attribute is mutually exclusive 274 * with the usage of the fractional-include attribute. 275 * 276 * @return Returns the values of the "fractional-exclude" property. 277 */ 278 SortedSet<String> getFractionalExclude(); 279 280 281 282 /** 283 * Sets the "fractional-exclude" property. 284 * <p> 285 * Allows to exclude some attributes to replicate to this server. 286 * <p> 287 * If fractional-exclude configuration attribute is used, attributes 288 * specified in this attribute will be ignored (not 289 * added/modified/deleted) when an operation performed from another 290 * directory server is being replayed in the local server. Note that 291 * the usage of this configuration attribute is mutually exclusive 292 * with the usage of the fractional-include attribute. 293 * 294 * @param values The values of the "fractional-exclude" property. 295 * @throws PropertyException 296 * If one or more of the new values are invalid. 297 */ 298 void setFractionalExclude(Collection<String> values) throws PropertyException; 299 300 301 302 /** 303 * Gets the "fractional-include" property. 304 * <p> 305 * Allows to include some attributes to replicate to this server. 306 * <p> 307 * If fractional-include configuration attribute is used, only 308 * attributes specified in this attribute will be 309 * added/modified/deleted when an operation performed from another 310 * directory server is being replayed in the local server. Note that 311 * the usage of this configuration attribute is mutually exclusive 312 * with the usage of the fractional-exclude attribute. 313 * 314 * @return Returns the values of the "fractional-include" property. 315 */ 316 SortedSet<String> getFractionalInclude(); 317 318 319 320 /** 321 * Sets the "fractional-include" property. 322 * <p> 323 * Allows to include some attributes to replicate to this server. 324 * <p> 325 * If fractional-include configuration attribute is used, only 326 * attributes specified in this attribute will be 327 * added/modified/deleted when an operation performed from another 328 * directory server is being replayed in the local server. Note that 329 * the usage of this configuration attribute is mutually exclusive 330 * with the usage of the fractional-exclude attribute. 331 * 332 * @param values The values of the "fractional-include" property. 333 * @throws PropertyException 334 * If one or more of the new values are invalid. 335 */ 336 void setFractionalInclude(Collection<String> values) throws PropertyException; 337 338 339 340 /** 341 * Gets the "group-id" property. 342 * <p> 343 * The group ID associated with this replicated domain. 344 * <p> 345 * This value defines the group ID of the replicated domain. The 346 * replication system will preferably connect and send updates to 347 * replicate to a replication server with the same group ID as its 348 * own one (the local server group ID). 349 * 350 * @return Returns the value of the "group-id" property. 351 */ 352 int getGroupId(); 353 354 355 356 /** 357 * Sets the "group-id" property. 358 * <p> 359 * The group ID associated with this replicated domain. 360 * <p> 361 * This value defines the group ID of the replicated domain. The 362 * replication system will preferably connect and send updates to 363 * replicate to a replication server with the same group ID as its 364 * own one (the local server group ID). 365 * 366 * @param value The value of the "group-id" property. 367 * @throws PropertyException 368 * If the new value is invalid. 369 */ 370 void setGroupId(Integer value) throws PropertyException; 371 372 373 374 /** 375 * Gets the "heartbeat-interval" property. 376 * <p> 377 * Specifies the heart-beat interval that the directory server will 378 * use when communicating with Replication Servers. 379 * <p> 380 * The directory server expects a regular heart-beat coming from the 381 * Replication Server within the specified interval. If a heartbeat 382 * is not received within the interval, the Directory Server closes 383 * its connection and connects to another Replication Server. 384 * 385 * @return Returns the value of the "heartbeat-interval" property. 386 */ 387 long getHeartbeatInterval(); 388 389 390 391 /** 392 * Sets the "heartbeat-interval" property. 393 * <p> 394 * Specifies the heart-beat interval that the directory server will 395 * use when communicating with Replication Servers. 396 * <p> 397 * The directory server expects a regular heart-beat coming from the 398 * Replication Server within the specified interval. If a heartbeat 399 * is not received within the interval, the Directory Server closes 400 * its connection and connects to another Replication Server. 401 * 402 * @param value The value of the "heartbeat-interval" property. 403 * @throws PropertyException 404 * If the new value is invalid. 405 */ 406 void setHeartbeatInterval(Long value) throws PropertyException; 407 408 409 410 /** 411 * Gets the "initialization-window-size" property. 412 * <p> 413 * Specifies the window size that this directory server may use when 414 * communicating with remote Directory Servers for initialization. 415 * 416 * @return Returns the value of the "initialization-window-size" property. 417 */ 418 int getInitializationWindowSize(); 419 420 421 422 /** 423 * Sets the "initialization-window-size" property. 424 * <p> 425 * Specifies the window size that this directory server may use when 426 * communicating with remote Directory Servers for initialization. 427 * 428 * @param value The value of the "initialization-window-size" property. 429 * @throws PropertyException 430 * If the new value is invalid. 431 */ 432 void setInitializationWindowSize(Integer value) throws PropertyException; 433 434 435 436 /** 437 * Gets the "isolation-policy" property. 438 * <p> 439 * Specifies the behavior of the directory server if a write 440 * operation is attempted on the data within the Replication Domain 441 * when none of the configured Replication Servers are available. 442 * 443 * @return Returns the value of the "isolation-policy" property. 444 */ 445 IsolationPolicy getIsolationPolicy(); 446 447 448 449 /** 450 * Sets the "isolation-policy" property. 451 * <p> 452 * Specifies the behavior of the directory server if a write 453 * operation is attempted on the data within the Replication Domain 454 * when none of the configured Replication Servers are available. 455 * 456 * @param value The value of the "isolation-policy" property. 457 * @throws PropertyException 458 * If the new value is invalid. 459 */ 460 void setIsolationPolicy(IsolationPolicy value) throws PropertyException; 461 462 463 464 /** 465 * Gets the "log-changenumber" property. 466 * <p> 467 * Indicates if this server logs the ChangeNumber in access log. 468 * <p> 469 * This boolean indicates if the domain should log the ChangeNumber 470 * of replicated operations in the access log. 471 * 472 * @return Returns the value of the "log-changenumber" property. 473 */ 474 boolean isLogChangenumber(); 475 476 477 478 /** 479 * Sets the "log-changenumber" property. 480 * <p> 481 * Indicates if this server logs the ChangeNumber in access log. 482 * <p> 483 * This boolean indicates if the domain should log the ChangeNumber 484 * of replicated operations in the access log. 485 * 486 * @param value The value of the "log-changenumber" property. 487 * @throws PropertyException 488 * If the new value is invalid. 489 */ 490 void setLogChangenumber(Boolean value) throws PropertyException; 491 492 493 494 /** 495 * Gets the "referrals-url" property. 496 * <p> 497 * The URLs other LDAP servers should use to refer to the local 498 * server. 499 * <p> 500 * URLs used by peer servers in the topology to refer to the local 501 * server through LDAP referrals. If this attribute is not defined, 502 * every URLs available to access this server will be used. If 503 * defined, only URLs specified here will be used. 504 * 505 * @return Returns the values of the "referrals-url" property. 506 */ 507 SortedSet<String> getReferralsUrl(); 508 509 510 511 /** 512 * Sets the "referrals-url" property. 513 * <p> 514 * The URLs other LDAP servers should use to refer to the local 515 * server. 516 * <p> 517 * URLs used by peer servers in the topology to refer to the local 518 * server through LDAP referrals. If this attribute is not defined, 519 * every URLs available to access this server will be used. If 520 * defined, only URLs specified here will be used. 521 * 522 * @param values The values of the "referrals-url" property. 523 * @throws PropertyException 524 * If one or more of the new values are invalid. 525 */ 526 void setReferralsUrl(Collection<String> values) throws PropertyException; 527 528 529 530 /** 531 * Gets the "replication-server" property. 532 * <p> 533 * Specifies the addresses of the Replication Servers within the 534 * Replication Domain to which the directory server should try to 535 * connect at startup time. 536 * <p> 537 * Addresses must be specified using the syntax: hostname:port 538 * 539 * @return Returns the values of the "replication-server" property. 540 */ 541 SortedSet<String> getReplicationServer(); 542 543 544 545 /** 546 * Sets the "replication-server" property. 547 * <p> 548 * Specifies the addresses of the Replication Servers within the 549 * Replication Domain to which the directory server should try to 550 * connect at startup time. 551 * <p> 552 * Addresses must be specified using the syntax: hostname:port 553 * 554 * @param values The values of the "replication-server" property. 555 * @throws PropertyException 556 * If one or more of the new values are invalid. 557 */ 558 void setReplicationServer(Collection<String> values) throws PropertyException; 559 560 561 562 /** 563 * Gets the "server-id" property. 564 * <p> 565 * Specifies a unique identifier for the directory server within the 566 * Replication Domain. 567 * <p> 568 * Each directory server within the same Replication Domain must 569 * have a different server ID. A directory server which is a member 570 * of multiple Replication Domains may use the same server ID for 571 * each of its Replication Domain configurations. 572 * 573 * @return Returns the value of the "server-id" property. 574 */ 575 Integer getServerId(); 576 577 578 579 /** 580 * Sets the "server-id" property. 581 * <p> 582 * Specifies a unique identifier for the directory server within the 583 * Replication Domain. 584 * <p> 585 * Each directory server within the same Replication Domain must 586 * have a different server ID. A directory server which is a member 587 * of multiple Replication Domains may use the same server ID for 588 * each of its Replication Domain configurations. 589 * <p> 590 * This property is read-only and can only be modified during 591 * creation of a Replication Domain. 592 * 593 * @param value The value of the "server-id" property. 594 * @throws PropertyException 595 * If the new value is invalid. 596 * @throws PropertyException 597 * If this Replication Domain is not being initialized. 598 */ 599 void setServerId(int value) throws PropertyException, PropertyException; 600 601 602 603 /** 604 * Gets the "solve-conflicts" property. 605 * <p> 606 * Indicates if this server solves conflict. 607 * <p> 608 * This boolean indicates if this domain keeps the historical 609 * information necessary to solve conflicts. When set to false the 610 * server will not maintain historical information and will therefore 611 * not be able to solve conflict. This should therefore be done only 612 * if the replication is used in a single master type of deployment. 613 * 614 * @return Returns the value of the "solve-conflicts" property. 615 */ 616 boolean isSolveConflicts(); 617 618 619 620 /** 621 * Sets the "solve-conflicts" property. 622 * <p> 623 * Indicates if this server solves conflict. 624 * <p> 625 * This boolean indicates if this domain keeps the historical 626 * information necessary to solve conflicts. When set to false the 627 * server will not maintain historical information and will therefore 628 * not be able to solve conflict. This should therefore be done only 629 * if the replication is used in a single master type of deployment. 630 * 631 * @param value The value of the "solve-conflicts" property. 632 * @throws PropertyException 633 * If the new value is invalid. 634 */ 635 void setSolveConflicts(Boolean value) throws PropertyException; 636 637 638 639 /** 640 * Gets the "source-address" property. 641 * <p> 642 * If specified, the server will bind to the address before 643 * connecting to the remote server. 644 * <p> 645 * The address must be one assigned to an existing network 646 * interface. 647 * 648 * @return Returns the value of the "source-address" property. 649 */ 650 InetAddress getSourceAddress(); 651 652 653 654 /** 655 * Sets the "source-address" property. 656 * <p> 657 * If specified, the server will bind to the address before 658 * connecting to the remote server. 659 * <p> 660 * The address must be one assigned to an existing network 661 * interface. 662 * 663 * @param value The value of the "source-address" property. 664 * @throws PropertyException 665 * If the new value is invalid. 666 */ 667 void setSourceAddress(InetAddress value) throws PropertyException; 668 669 670 671 /** 672 * Gets the "window-size" property. 673 * <p> 674 * Specifies the window size that the directory server will use when 675 * communicating with Replication Servers. 676 * <p> 677 * This option may be deprecated and removed in future releases. 678 * 679 * @return Returns the value of the "window-size" property. 680 */ 681 int getWindowSize(); 682 683 684 685 /** 686 * Sets the "window-size" property. 687 * <p> 688 * Specifies the window size that the directory server will use when 689 * communicating with Replication Servers. 690 * <p> 691 * This option may be deprecated and removed in future releases. 692 * 693 * @param value The value of the "window-size" property. 694 * @throws PropertyException 695 * If the new value is invalid. 696 */ 697 void setWindowSize(Integer value) throws PropertyException; 698 699 700 701 /** 702 * Gets the External Changelog Domain. 703 * 704 * @return Returns the External Changelog Domain. 705 * @throws DefinitionDecodingException 706 * If the External Changelog Domain was found but its type 707 * could not be determined. 708 * @throws ManagedObjectDecodingException 709 * If the External Changelog Domain was found but one or 710 * more of its properties could not be decoded. 711 * @throws ManagedObjectNotFoundException 712 * If the External Changelog Domain could not be found on 713 * the server. 714 * @throws ConcurrentModificationException 715 * If this Replication Domain has been removed from the 716 * server by another client. 717 * @throws AuthorizationException 718 * If the server refuses to retrieve the External 719 * Changelog Domain because the client does not have the 720 * correct privileges. 721 * @throws CommunicationException 722 * If the client cannot contact the server due to an 723 * underlying communication problem. 724 */ 725 ExternalChangelogDomainCfgClient getExternalChangelogDomain() 726 throws DefinitionDecodingException, ManagedObjectDecodingException, 727 ManagedObjectNotFoundException, ConcurrentModificationException, 728 AuthorizationException, CommunicationException; 729 730}