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