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