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.forgerock.opendj.server.config.server; 027 028 029 030import java.net.InetAddress; 031import java.util.SortedSet; 032import org.forgerock.opendj.config.Configuration; 033import org.forgerock.opendj.config.server.ConfigurationChangeListener; 034 035 036 037/** 038 * A server-side interface for querying Replication Server settings. 039 * <p> 040 * Replication Servers publish updates to Directory Servers within a 041 * Replication Domain. 042 */ 043public interface ReplicationServerCfg extends Configuration { 044 045 /** 046 * Gets the configuration class associated with this Replication Server. 047 * 048 * @return Returns the configuration class associated with this Replication Server. 049 */ 050 Class<? extends ReplicationServerCfg> configurationClass(); 051 052 053 054 /** 055 * Register to be notified when this Replication Server is changed. 056 * 057 * @param listener 058 * The Replication Server configuration change listener. 059 */ 060 void addChangeListener(ConfigurationChangeListener<ReplicationServerCfg> listener); 061 062 063 064 /** 065 * Deregister an existing Replication Server configuration change listener. 066 * 067 * @param listener 068 * The Replication Server configuration change listener. 069 */ 070 void removeChangeListener(ConfigurationChangeListener<ReplicationServerCfg> listener); 071 072 073 074 /** 075 * Gets 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 * @return Returns the value of the "assured-timeout" property. 085 */ 086 long getAssuredTimeout(); 087 088 089 090 /** 091 * Gets the "compute-change-number" property. 092 * <p> 093 * Whether the replication server will compute change numbers. 094 * <p> 095 * This boolean tells the replication server to compute change 096 * numbers for each replicated change by maintaining a change number 097 * index database. Changenumbers are computed according to 098 * http://tools.ietf.org/html/draft-good-ldap-changelog-04. Note this 099 * functionality has an impact on CPU, disk accesses and storage. If 100 * changenumbers are not required, it is advisable to set this value 101 * to false. 102 * 103 * @return Returns the value of the "compute-change-number" property. 104 */ 105 boolean isComputeChangeNumber(); 106 107 108 109 /** 110 * Gets the "degraded-status-threshold" property. 111 * <p> 112 * The number of pending changes as threshold value for putting a 113 * directory server in degraded status. 114 * <p> 115 * This value represents a number of pending changes a replication 116 * server has in queue for sending to a directory server. Once this 117 * value is crossed, the matching directory server goes in degraded 118 * status. When number of pending changes goes back under this value, 119 * the directory server is put back in normal status. 0 means status 120 * analyzer is disabled and directory servers are never put in 121 * degraded status. 122 * 123 * @return Returns the value of the "degraded-status-threshold" property. 124 */ 125 int getDegradedStatusThreshold(); 126 127 128 129 /** 130 * Gets the "group-id" property. 131 * <p> 132 * The group id for the replication server. 133 * <p> 134 * This value defines the group id of the replication server. The 135 * replication system of a LDAP server uses the group id of the 136 * replicated domain and tries to connect, if possible, to a 137 * replication with the same group id. 138 * 139 * @return Returns the value of the "group-id" property. 140 */ 141 int getGroupId(); 142 143 144 145 /** 146 * Gets the "monitoring-period" property. 147 * <p> 148 * The period between sending of monitoring messages. 149 * <p> 150 * Defines the duration that the replication server will wait before 151 * sending new monitoring messages to its peers (replication servers 152 * and directory servers). Larger values increase the length of time 153 * it takes for a directory server to detect and switch to a more 154 * suitable replication server, whereas smaller values increase the 155 * amount of background network traffic. 156 * 157 * @return Returns the value of the "monitoring-period" property. 158 */ 159 long getMonitoringPeriod(); 160 161 162 163 /** 164 * Gets the "queue-size" property. 165 * <p> 166 * Specifies the number of changes that are kept in memory for each 167 * directory server in the Replication Domain. 168 * 169 * @return Returns the value of the "queue-size" property. 170 */ 171 int getQueueSize(); 172 173 174 175 /** 176 * Gets the "replication-db-directory" property. 177 * <p> 178 * The path where the Replication Server stores all persistent 179 * information. 180 * 181 * @return Returns the value of the "replication-db-directory" property. 182 */ 183 String getReplicationDBDirectory(); 184 185 186 187 /** 188 * Gets the "replication-port" property. 189 * <p> 190 * The port on which this Replication Server waits for connections 191 * from other Replication Servers or Directory Servers. 192 * 193 * @return Returns the value of the "replication-port" property. 194 */ 195 int getReplicationPort(); 196 197 198 199 /** 200 * Gets the "replication-purge-delay" property. 201 * <p> 202 * The time (in seconds) after which the Replication Server erases 203 * all persistent information. 204 * 205 * @return Returns the value of the "replication-purge-delay" property. 206 */ 207 long getReplicationPurgeDelay(); 208 209 210 211 /** 212 * Gets the "replication-server" property. 213 * <p> 214 * Specifies the addresses of other Replication Servers to which 215 * this Replication Server tries to connect at startup time. 216 * <p> 217 * Addresses must be specified using the syntax: "hostname:port". If 218 * IPv6 addresses are used as the hostname, they must be specified 219 * using the syntax "[IPv6Address]:port". 220 * 221 * @return Returns an unmodifiable set containing the values of the "replication-server" property. 222 */ 223 SortedSet<String> getReplicationServer(); 224 225 226 227 /** 228 * Gets the "replication-server-id" property. 229 * <p> 230 * Specifies a unique identifier for the Replication Server. 231 * <p> 232 * Each Replication Server must have a different server ID. 233 * 234 * @return Returns the value of the "replication-server-id" property. 235 */ 236 int getReplicationServerId(); 237 238 239 240 /** 241 * Gets the "source-address" property. 242 * <p> 243 * If specified, the server will bind to the address before 244 * connecting to the remote server. 245 * <p> 246 * The address must be one assigned to an existing network 247 * interface. 248 * 249 * @return Returns the value of the "source-address" property. 250 */ 251 InetAddress getSourceAddress(); 252 253 254 255 /** 256 * Gets the "weight" property. 257 * <p> 258 * The weight of the replication server. 259 * <p> 260 * The weight affected to the replication server. Each replication 261 * server of the topology has a weight. When combined together, the 262 * weights of the replication servers of a same group can be 263 * translated to a percentage that determines the quantity of 264 * directory servers of the topology that should be connected to a 265 * replication server. For instance imagine a topology with 3 266 * replication servers (with the same group id) with the following 267 * weights: RS1=1, RS2=1, RS3=2. This means that RS1 should have 25% 268 * of the directory servers connected in the topology, RS2 25%, and 269 * RS3 50%. This may be useful if the replication servers of the 270 * topology have a different power and one wants to spread the load 271 * between the replication servers according to their power. 272 * 273 * @return Returns the value of the "weight" property. 274 */ 275 int getWeight(); 276 277 278 279 /** 280 * Gets the "window-size" property. 281 * <p> 282 * Specifies the window size that the Replication Server uses when 283 * communicating with other Replication Servers. 284 * <p> 285 * This option may be deprecated and removed in future releases. 286 * 287 * @return Returns the value of the "window-size" property. 288 */ 289 int getWindowSize(); 290 291}