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