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.ManagedObjectDefinition; 024import org.forgerock.opendj.config.PropertyException; 025import org.forgerock.opendj.server.config.meta.SNMPConnectionHandlerCfgDefn.SecurityLevel; 026import org.forgerock.opendj.server.config.server.SNMPConnectionHandlerCfg; 027 028 029 030/** 031 * A client-side interface for reading and modifying SNMP Connection 032 * Handler settings. 033 * <p> 034 * The SNMP Connection Handler can be used to process SNMP requests to 035 * retrieve monitoring information described by the MIB 2605. Supported 036 * protocol are SNMP V1, V2c and V3. 037 */ 038public interface SNMPConnectionHandlerCfgClient extends ConnectionHandlerCfgClient { 039 040 /** 041 * Get the configuration definition associated with this SNMP Connection Handler. 042 * 043 * @return Returns the configuration definition associated with this SNMP Connection Handler. 044 */ 045 ManagedObjectDefinition<? extends SNMPConnectionHandlerCfgClient, ? extends SNMPConnectionHandlerCfg> definition(); 046 047 048 049 /** 050 * Gets the "allowed-manager" property. 051 * <p> 052 * Specifies the hosts of the managers to be granted the access 053 * rights. This property is required for SNMP v1 and v2 security 054 * configuration. An asterisk (*) opens access to all managers. 055 * 056 * @return Returns the values of the "allowed-manager" property. 057 */ 058 SortedSet<String> getAllowedManager(); 059 060 061 062 /** 063 * Sets the "allowed-manager" property. 064 * <p> 065 * Specifies the hosts of the managers to be granted the access 066 * rights. This property is required for SNMP v1 and v2 security 067 * configuration. An asterisk (*) opens access to all managers. 068 * 069 * @param values The values of the "allowed-manager" property. 070 * @throws PropertyException 071 * If one or more of the new values are invalid. 072 */ 073 void setAllowedManager(Collection<String> values) throws PropertyException; 074 075 076 077 /** 078 * Gets the "allowed-user" property. 079 * <p> 080 * Specifies the users to be granted the access rights. This 081 * property is required for SNMP v3 security configuration. An 082 * asterisk (*) opens access to all users. 083 * 084 * @return Returns the values of the "allowed-user" property. 085 */ 086 SortedSet<String> getAllowedUser(); 087 088 089 090 /** 091 * Sets the "allowed-user" property. 092 * <p> 093 * Specifies the users to be granted the access rights. This 094 * property is required for SNMP v3 security configuration. An 095 * asterisk (*) opens access to all users. 096 * 097 * @param values The values of the "allowed-user" property. 098 * @throws PropertyException 099 * If one or more of the new values are invalid. 100 */ 101 void setAllowedUser(Collection<String> values) throws PropertyException; 102 103 104 105 /** 106 * Gets the "community" property. 107 * <p> 108 * Specifies the v1,v2 community or the v3 context name allowed to 109 * access the MIB 2605 monitoring information or the USM MIB. The 110 * mapping between "community" and "context name" is set. 111 * 112 * @return Returns the value of the "community" property. 113 */ 114 String getCommunity(); 115 116 117 118 /** 119 * Sets the "community" property. 120 * <p> 121 * Specifies the v1,v2 community or the v3 context name allowed to 122 * access the MIB 2605 monitoring information or the USM MIB. The 123 * mapping between "community" and "context name" is set. 124 * 125 * @param value The value of the "community" property. 126 * @throws PropertyException 127 * If the new value is invalid. 128 */ 129 void setCommunity(String value) throws PropertyException; 130 131 132 133 /** 134 * Gets the "java-class" property. 135 * <p> 136 * Specifies the fully-qualified name of the Java class that 137 * provides the SNMP Connection Handler implementation. 138 * 139 * @return Returns the value of the "java-class" property. 140 */ 141 String getJavaClass(); 142 143 144 145 /** 146 * Sets the "java-class" property. 147 * <p> 148 * Specifies the fully-qualified name of the Java class that 149 * provides the SNMP Connection Handler implementation. 150 * 151 * @param value The value of the "java-class" property. 152 * @throws PropertyException 153 * If the new value is invalid. 154 */ 155 void setJavaClass(String value) throws PropertyException; 156 157 158 159 /** 160 * Gets the "listen-address" property. 161 * <p> 162 * Specifies the address or set of addresses on which this SNMP 163 * Connection Handler should listen for connections from SNMP 164 * clients. 165 * <p> 166 * Multiple addresses may be provided as separate values for this 167 * attribute. If no values are provided, then the SNMP Connection 168 * Handler listens on all interfaces. 169 * 170 * @return Returns the values of the "listen-address" property. 171 */ 172 SortedSet<InetAddress> getListenAddress(); 173 174 175 176 /** 177 * Sets the "listen-address" property. 178 * <p> 179 * Specifies the address or set of addresses on which this SNMP 180 * Connection Handler should listen for connections from SNMP 181 * clients. 182 * <p> 183 * Multiple addresses may be provided as separate values for this 184 * attribute. If no values are provided, then the SNMP Connection 185 * Handler listens on all interfaces. 186 * <p> 187 * This property is read-only and can only be modified during 188 * creation of a SNMP Connection Handler. 189 * 190 * @param values The values of the "listen-address" property. 191 * @throws PropertyException 192 * If one or more of the new values are invalid. 193 * @throws PropertyException 194 * If this SNMP Connection Handler is not being initialized. 195 */ 196 void setListenAddress(Collection<InetAddress> values) throws PropertyException, PropertyException; 197 198 199 200 /** 201 * Gets the "listen-port" property. 202 * <p> 203 * Specifies the port number on which the SNMP Connection Handler 204 * will listen for connections from clients. 205 * <p> 206 * Only a single port number may be provided. 207 * 208 * @return Returns the value of the "listen-port" property. 209 */ 210 Integer getListenPort(); 211 212 213 214 /** 215 * Sets the "listen-port" property. 216 * <p> 217 * Specifies the port number on which the SNMP Connection Handler 218 * will listen for connections from clients. 219 * <p> 220 * Only a single port number may be provided. 221 * 222 * @param value The value of the "listen-port" property. 223 * @throws PropertyException 224 * If the new value is invalid. 225 */ 226 void setListenPort(int value) throws PropertyException; 227 228 229 230 /** 231 * Gets the "opendmk-jarfile" property. 232 * <p> 233 * Indicates the OpenDMK runtime jar file location 234 * 235 * @return Returns the value of the "opendmk-jarfile" property. 236 */ 237 String getOpendmkJarfile(); 238 239 240 241 /** 242 * Sets the "opendmk-jarfile" property. 243 * <p> 244 * Indicates the OpenDMK runtime jar file location 245 * 246 * @param value The value of the "opendmk-jarfile" property. 247 * @throws PropertyException 248 * If the new value is invalid. 249 */ 250 void setOpendmkJarfile(String value) throws PropertyException; 251 252 253 254 /** 255 * Gets the "registered-mbean" property. 256 * <p> 257 * Indicates whether the SNMP objects have to be registered in the 258 * directory server MBeanServer or not allowing to access SNMP 259 * Objects with RMI connector if enabled. 260 * 261 * @return Returns the value of the "registered-mbean" property. 262 */ 263 boolean isRegisteredMbean(); 264 265 266 267 /** 268 * Sets the "registered-mbean" property. 269 * <p> 270 * Indicates whether the SNMP objects have to be registered in the 271 * directory server MBeanServer or not allowing to access SNMP 272 * Objects with RMI connector if enabled. 273 * 274 * @param value The value of the "registered-mbean" property. 275 * @throws PropertyException 276 * If the new value is invalid. 277 */ 278 void setRegisteredMbean(Boolean value) throws PropertyException; 279 280 281 282 /** 283 * Gets the "security-agent-file" property. 284 * <p> 285 * Specifies the USM security configuration to receive authenticated 286 * only SNMP requests. 287 * 288 * @return Returns the value of the "security-agent-file" property. 289 */ 290 String getSecurityAgentFile(); 291 292 293 294 /** 295 * Sets the "security-agent-file" property. 296 * <p> 297 * Specifies the USM security configuration to receive authenticated 298 * only SNMP requests. 299 * 300 * @param value The value of the "security-agent-file" property. 301 * @throws PropertyException 302 * If the new value is invalid. 303 */ 304 void setSecurityAgentFile(String value) throws PropertyException; 305 306 307 308 /** 309 * Gets the "security-level" property. 310 * <p> 311 * Specifies the type of security level : NoAuthNoPriv : No security 312 * mechanisms activated, AuthNoPriv : Authentication activated with 313 * no privacy, AuthPriv : Authentication with privacy activated. This 314 * property is required for SNMP V3 security configuration. 315 * 316 * @return Returns the value of the "security-level" property. 317 */ 318 SecurityLevel getSecurityLevel(); 319 320 321 322 /** 323 * Sets the "security-level" property. 324 * <p> 325 * Specifies the type of security level : NoAuthNoPriv : No security 326 * mechanisms activated, AuthNoPriv : Authentication activated with 327 * no privacy, AuthPriv : Authentication with privacy activated. This 328 * property is required for SNMP V3 security configuration. 329 * 330 * @param value The value of the "security-level" property. 331 * @throws PropertyException 332 * If the new value is invalid. 333 */ 334 void setSecurityLevel(SecurityLevel value) throws PropertyException; 335 336 337 338 /** 339 * Gets the "trap-port" property. 340 * <p> 341 * Specifies the port to use to send SNMP Traps. 342 * 343 * @return Returns the value of the "trap-port" property. 344 */ 345 Integer getTrapPort(); 346 347 348 349 /** 350 * Sets the "trap-port" property. 351 * <p> 352 * Specifies the port to use to send SNMP Traps. 353 * 354 * @param value The value of the "trap-port" property. 355 * @throws PropertyException 356 * If the new value is invalid. 357 */ 358 void setTrapPort(int value) throws PropertyException; 359 360 361 362 /** 363 * Gets the "traps-community" property. 364 * <p> 365 * Specifies the community string that must be included in the traps 366 * sent to define managers (trap-destinations). This property is used 367 * in the context of SNMP v1, v2 and v3. 368 * 369 * @return Returns the value of the "traps-community" property. 370 */ 371 String getTrapsCommunity(); 372 373 374 375 /** 376 * Sets the "traps-community" property. 377 * <p> 378 * Specifies the community string that must be included in the traps 379 * sent to define managers (trap-destinations). This property is used 380 * in the context of SNMP v1, v2 and v3. 381 * 382 * @param value The value of the "traps-community" property. 383 * @throws PropertyException 384 * If the new value is invalid. 385 */ 386 void setTrapsCommunity(String value) throws PropertyException; 387 388 389 390 /** 391 * Gets the "traps-destination" property. 392 * <p> 393 * Specifies the hosts to which V1 traps will be sent. V1 Traps are 394 * sent to every host listed. 395 * <p> 396 * If this list is empty, V1 traps are sent to "localhost". Each 397 * host in the list must be identifed by its name or complete IP 398 * Addess. 399 * 400 * @return Returns the values of the "traps-destination" property. 401 */ 402 SortedSet<String> getTrapsDestination(); 403 404 405 406 /** 407 * Sets the "traps-destination" property. 408 * <p> 409 * Specifies the hosts to which V1 traps will be sent. V1 Traps are 410 * sent to every host listed. 411 * <p> 412 * If this list is empty, V1 traps are sent to "localhost". Each 413 * host in the list must be identifed by its name or complete IP 414 * Addess. 415 * 416 * @param values The values of the "traps-destination" property. 417 * @throws PropertyException 418 * If one or more of the new values are invalid. 419 */ 420 void setTrapsDestination(Collection<String> values) throws PropertyException; 421 422}