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.ConfigurationClient; 034import org.opends.server.admin.ManagedObjectDefinition; 035import org.opends.server.admin.PropertyException; 036import org.opends.server.admin.std.server.ReplicationServerCfg; 037 038 039 040/** 041 * A client-side interface for reading and modifying Replication 042 * Server settings. 043 * <p> 044 * Replication Servers publish updates to Directory Servers within a 045 * Replication Domain. 046 */ 047public interface ReplicationServerCfgClient extends ConfigurationClient { 048 049 /** 050 * Get the configuration definition associated with this Replication Server. 051 * 052 * @return Returns the configuration definition associated with this Replication Server. 053 */ 054 ManagedObjectDefinition<? extends ReplicationServerCfgClient, ? extends ReplicationServerCfg> definition(); 055 056 057 058 /** 059 * Gets the "assured-timeout" property. 060 * <p> 061 * The timeout value when waiting for assured mode acknowledgments. 062 * <p> 063 * Defines the number of milliseconds that the replication server 064 * will wait for assured acknowledgments (in either Safe Data or Safe 065 * Read assured sub modes) before forgetting them and answer to the 066 * entity that sent an update and is waiting for acknowledgment. 067 * 068 * @return Returns the value of the "assured-timeout" property. 069 */ 070 long getAssuredTimeout(); 071 072 073 074 /** 075 * Sets the "assured-timeout" property. 076 * <p> 077 * The timeout value when waiting for assured mode acknowledgments. 078 * <p> 079 * Defines the number of milliseconds that the replication server 080 * will wait for assured acknowledgments (in either Safe Data or Safe 081 * Read assured sub modes) before forgetting them and answer to the 082 * entity that sent an update and is waiting for acknowledgment. 083 * 084 * @param value The value of the "assured-timeout" property. 085 * @throws PropertyException 086 * If the new value is invalid. 087 */ 088 void setAssuredTimeout(Long value) throws PropertyException; 089 090 091 092 /** 093 * Gets the "compute-change-number" property. 094 * <p> 095 * Whether the replication server will compute change numbers. 096 * <p> 097 * This boolean tells the replication server to compute change 098 * numbers for each replicated change by maintaining a change number 099 * index database. Changenumbers are computed according to 100 * http://tools.ietf.org/html/draft-good-ldap-changelog-04. Note this 101 * functionality has an impact on CPU, disk accesses and storage. If 102 * changenumbers are not required, it is advisable to set this value 103 * to false. 104 * 105 * @return Returns the value of the "compute-change-number" property. 106 */ 107 boolean isComputeChangeNumber(); 108 109 110 111 /** 112 * Sets the "compute-change-number" property. 113 * <p> 114 * Whether the replication server will compute change numbers. 115 * <p> 116 * This boolean tells the replication server to compute change 117 * numbers for each replicated change by maintaining a change number 118 * index database. Changenumbers are computed according to 119 * http://tools.ietf.org/html/draft-good-ldap-changelog-04. Note this 120 * functionality has an impact on CPU, disk accesses and storage. If 121 * changenumbers are not required, it is advisable to set this value 122 * to false. 123 * 124 * @param value The value of the "compute-change-number" property. 125 * @throws PropertyException 126 * If the new value is invalid. 127 */ 128 void setComputeChangeNumber(Boolean value) throws PropertyException; 129 130 131 132 /** 133 * Gets the "degraded-status-threshold" property. 134 * <p> 135 * The number of pending changes as threshold value for putting a 136 * directory server in degraded status. 137 * <p> 138 * This value represents a number of pending changes a replication 139 * server has in queue for sending to a directory server. Once this 140 * value is crossed, the matching directory server goes in degraded 141 * status. When number of pending changes goes back under this value, 142 * the directory server is put back in normal status. 0 means status 143 * analyzer is disabled and directory servers are never put in 144 * degraded status. 145 * 146 * @return Returns the value of the "degraded-status-threshold" property. 147 */ 148 int getDegradedStatusThreshold(); 149 150 151 152 /** 153 * Sets the "degraded-status-threshold" property. 154 * <p> 155 * The number of pending changes as threshold value for putting a 156 * directory server in degraded status. 157 * <p> 158 * This value represents a number of pending changes a replication 159 * server has in queue for sending to a directory server. Once this 160 * value is crossed, the matching directory server goes in degraded 161 * status. When number of pending changes goes back under this value, 162 * the directory server is put back in normal status. 0 means status 163 * analyzer is disabled and directory servers are never put in 164 * degraded status. 165 * 166 * @param value The value of the "degraded-status-threshold" property. 167 * @throws PropertyException 168 * If the new value is invalid. 169 */ 170 void setDegradedStatusThreshold(Integer value) throws PropertyException; 171 172 173 174 /** 175 * Gets the "group-id" property. 176 * <p> 177 * The group id for the replication server. 178 * <p> 179 * This value defines the group id of the replication server. The 180 * replication system of a LDAP server uses the group id of the 181 * replicated domain and tries to connect, if possible, to a 182 * replication with the same group id. 183 * 184 * @return Returns the value of the "group-id" property. 185 */ 186 int getGroupId(); 187 188 189 190 /** 191 * Sets the "group-id" property. 192 * <p> 193 * The group id for the replication server. 194 * <p> 195 * This value defines the group id of the replication server. The 196 * replication system of a LDAP server uses the group id of the 197 * replicated domain and tries to connect, if possible, to a 198 * replication with the same group id. 199 * 200 * @param value The value of the "group-id" property. 201 * @throws PropertyException 202 * If the new value is invalid. 203 */ 204 void setGroupId(Integer value) throws PropertyException; 205 206 207 208 /** 209 * Gets the "monitoring-period" property. 210 * <p> 211 * The period between sending of monitoring messages. 212 * <p> 213 * Defines the duration that the replication server will wait before 214 * sending new monitoring messages to its peers (replication servers 215 * and directory servers). Larger values increase the length of time 216 * it takes for a directory server to detect and switch to a more 217 * suitable replication server, whereas smaller values increase the 218 * amount of background network traffic. 219 * 220 * @return Returns the value of the "monitoring-period" property. 221 */ 222 long getMonitoringPeriod(); 223 224 225 226 /** 227 * Sets the "monitoring-period" property. 228 * <p> 229 * The period between sending of monitoring messages. 230 * <p> 231 * Defines the duration that the replication server will wait before 232 * sending new monitoring messages to its peers (replication servers 233 * and directory servers). Larger values increase the length of time 234 * it takes for a directory server to detect and switch to a more 235 * suitable replication server, whereas smaller values increase the 236 * amount of background network traffic. 237 * 238 * @param value The value of the "monitoring-period" property. 239 * @throws PropertyException 240 * If the new value is invalid. 241 */ 242 void setMonitoringPeriod(Long value) throws PropertyException; 243 244 245 246 /** 247 * Gets the "queue-size" property. 248 * <p> 249 * Specifies the number of changes that are kept in memory for each 250 * directory server in the Replication Domain. 251 * 252 * @return Returns the value of the "queue-size" property. 253 */ 254 int getQueueSize(); 255 256 257 258 /** 259 * Sets the "queue-size" property. 260 * <p> 261 * Specifies the number of changes that are kept in memory for each 262 * directory server in the Replication Domain. 263 * 264 * @param value The value of the "queue-size" property. 265 * @throws PropertyException 266 * If the new value is invalid. 267 */ 268 void setQueueSize(Integer value) throws PropertyException; 269 270 271 272 /** 273 * Gets the "replication-db-directory" property. 274 * <p> 275 * The path where the Replication Server stores all persistent 276 * information. 277 * 278 * @return Returns the value of the "replication-db-directory" property. 279 */ 280 String getReplicationDBDirectory(); 281 282 283 284 /** 285 * Sets the "replication-db-directory" property. 286 * <p> 287 * The path where the Replication Server stores all persistent 288 * information. 289 * <p> 290 * This property is read-only and can only be modified during 291 * creation of a Replication Server. 292 * 293 * @param value The value of the "replication-db-directory" property. 294 * @throws PropertyException 295 * If the new value is invalid. 296 * @throws PropertyException 297 * If this Replication Server is not being initialized. 298 */ 299 void setReplicationDBDirectory(String value) throws PropertyException, PropertyException; 300 301 302 303 /** 304 * Gets the "replication-port" property. 305 * <p> 306 * The port on which this Replication Server waits for connections 307 * from other Replication Servers or Directory Servers. 308 * 309 * @return Returns the value of the "replication-port" property. 310 */ 311 Integer getReplicationPort(); 312 313 314 315 /** 316 * Sets the "replication-port" property. 317 * <p> 318 * The port on which this Replication Server waits for connections 319 * from other Replication Servers or Directory Servers. 320 * 321 * @param value The value of the "replication-port" property. 322 * @throws PropertyException 323 * If the new value is invalid. 324 */ 325 void setReplicationPort(int value) throws PropertyException; 326 327 328 329 /** 330 * Gets the "replication-purge-delay" property. 331 * <p> 332 * The time (in seconds) after which the Replication Server erases 333 * all persistent information. 334 * 335 * @return Returns the value of the "replication-purge-delay" property. 336 */ 337 long getReplicationPurgeDelay(); 338 339 340 341 /** 342 * Sets the "replication-purge-delay" property. 343 * <p> 344 * The time (in seconds) after which the Replication Server erases 345 * all persistent information. 346 * 347 * @param value The value of the "replication-purge-delay" property. 348 * @throws PropertyException 349 * If the new value is invalid. 350 */ 351 void setReplicationPurgeDelay(Long value) throws PropertyException; 352 353 354 355 /** 356 * Gets the "replication-server" property. 357 * <p> 358 * Specifies the addresses of other Replication Servers to which 359 * this Replication Server tries to connect at startup time. 360 * <p> 361 * Addresses must be specified using the syntax: "hostname:port". If 362 * IPv6 addresses are used as the hostname, they must be specified 363 * using the syntax "[IPv6Address]:port". 364 * 365 * @return Returns the values of the "replication-server" property. 366 */ 367 SortedSet<String> getReplicationServer(); 368 369 370 371 /** 372 * Sets the "replication-server" property. 373 * <p> 374 * Specifies the addresses of other Replication Servers to which 375 * this Replication Server tries to connect at startup time. 376 * <p> 377 * Addresses must be specified using the syntax: "hostname:port". If 378 * IPv6 addresses are used as the hostname, they must be specified 379 * using the syntax "[IPv6Address]:port". 380 * 381 * @param values The values of the "replication-server" property. 382 * @throws PropertyException 383 * If one or more of the new values are invalid. 384 */ 385 void setReplicationServer(Collection<String> values) throws PropertyException; 386 387 388 389 /** 390 * Gets the "replication-server-id" property. 391 * <p> 392 * Specifies a unique identifier for the Replication Server. 393 * <p> 394 * Each Replication Server must have a different server ID. 395 * 396 * @return Returns the value of the "replication-server-id" property. 397 */ 398 Integer getReplicationServerId(); 399 400 401 402 /** 403 * Sets the "replication-server-id" property. 404 * <p> 405 * Specifies a unique identifier for the Replication Server. 406 * <p> 407 * Each Replication Server must have a different server ID. 408 * <p> 409 * This property is read-only and can only be modified during 410 * creation of a Replication Server. 411 * 412 * @param value The value of the "replication-server-id" property. 413 * @throws PropertyException 414 * If the new value is invalid. 415 * @throws PropertyException 416 * If this Replication Server is not being initialized. 417 */ 418 void setReplicationServerId(int value) throws PropertyException, PropertyException; 419 420 421 422 /** 423 * Gets the "source-address" property. 424 * <p> 425 * If specified, the server will bind to the address before 426 * connecting to the remote server. 427 * <p> 428 * The address must be one assigned to an existing network 429 * interface. 430 * 431 * @return Returns the value of the "source-address" property. 432 */ 433 InetAddress getSourceAddress(); 434 435 436 437 /** 438 * Sets the "source-address" property. 439 * <p> 440 * If specified, the server will bind to the address before 441 * connecting to the remote server. 442 * <p> 443 * The address must be one assigned to an existing network 444 * interface. 445 * 446 * @param value The value of the "source-address" property. 447 * @throws PropertyException 448 * If the new value is invalid. 449 */ 450 void setSourceAddress(InetAddress value) throws PropertyException; 451 452 453 454 /** 455 * Gets the "weight" property. 456 * <p> 457 * The weight of the replication server. 458 * <p> 459 * The weight affected to the replication server. Each replication 460 * server of the topology has a weight. When combined together, the 461 * weights of the replication servers of a same group can be 462 * translated to a percentage that determines the quantity of 463 * directory servers of the topology that should be connected to a 464 * replication server. For instance imagine a topology with 3 465 * replication servers (with the same group id) with the following 466 * weights: RS1=1, RS2=1, RS3=2. This means that RS1 should have 25% 467 * of the directory servers connected in the topology, RS2 25%, and 468 * RS3 50%. This may be useful if the replication servers of the 469 * topology have a different power and one wants to spread the load 470 * between the replication servers according to their power. 471 * 472 * @return Returns the value of the "weight" property. 473 */ 474 int getWeight(); 475 476 477 478 /** 479 * Sets the "weight" property. 480 * <p> 481 * The weight of the replication server. 482 * <p> 483 * The weight affected to the replication server. Each replication 484 * server of the topology has a weight. When combined together, the 485 * weights of the replication servers of a same group can be 486 * translated to a percentage that determines the quantity of 487 * directory servers of the topology that should be connected to a 488 * replication server. For instance imagine a topology with 3 489 * replication servers (with the same group id) with the following 490 * weights: RS1=1, RS2=1, RS3=2. This means that RS1 should have 25% 491 * of the directory servers connected in the topology, RS2 25%, and 492 * RS3 50%. This may be useful if the replication servers of the 493 * topology have a different power and one wants to spread the load 494 * between the replication servers according to their power. 495 * 496 * @param value The value of the "weight" property. 497 * @throws PropertyException 498 * If the new value is invalid. 499 */ 500 void setWeight(Integer value) throws PropertyException; 501 502 503 504 /** 505 * Gets the "window-size" property. 506 * <p> 507 * Specifies the window size that the Replication Server uses when 508 * communicating with other Replication Servers. 509 * <p> 510 * This option may be deprecated and removed in future releases. 511 * 512 * @return Returns the value of the "window-size" property. 513 */ 514 int getWindowSize(); 515 516 517 518 /** 519 * Sets the "window-size" property. 520 * <p> 521 * Specifies the window size that the Replication Server uses when 522 * communicating with other Replication Servers. 523 * <p> 524 * This option may be deprecated and removed in future releases. 525 * 526 * @param value The value of the "window-size" property. 527 * @throws PropertyException 528 * If the new value is invalid. 529 */ 530 void setWindowSize(Integer value) throws PropertyException; 531 532}