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.server;
017
018
019
020import java.net.InetAddress;
021import java.util.SortedSet;
022import org.forgerock.opendj.config.server.ConfigurationChangeListener;
023import org.forgerock.opendj.server.config.meta.SNMPConnectionHandlerCfgDefn.SecurityLevel;
024
025
026
027/**
028 * A server-side interface for querying SNMP Connection Handler
029 * settings.
030 * <p>
031 * The SNMP Connection Handler can be used to process SNMP requests to
032 * retrieve monitoring information described by the MIB 2605. Supported
033 * protocol are SNMP V1, V2c and V3.
034 */
035public interface SNMPConnectionHandlerCfg extends ConnectionHandlerCfg {
036
037  /**
038   * Gets the configuration class associated with this SNMP Connection Handler.
039   *
040   * @return Returns the configuration class associated with this SNMP Connection Handler.
041   */
042  Class<? extends SNMPConnectionHandlerCfg> configurationClass();
043
044
045
046  /**
047   * Register to be notified when this SNMP Connection Handler is changed.
048   *
049   * @param listener
050   *          The SNMP Connection Handler configuration change listener.
051   */
052  void addSNMPChangeListener(ConfigurationChangeListener<SNMPConnectionHandlerCfg> listener);
053
054
055
056  /**
057   * Deregister an existing SNMP Connection Handler configuration change listener.
058   *
059   * @param listener
060   *          The SNMP Connection Handler configuration change listener.
061   */
062  void removeSNMPChangeListener(ConfigurationChangeListener<SNMPConnectionHandlerCfg> listener);
063
064
065
066  /**
067   * Gets the "allowed-manager" property.
068   * <p>
069   * Specifies the hosts of the managers to be granted the access
070   * rights. This property is required for SNMP v1 and v2 security
071   * configuration. An asterisk (*) opens access to all managers.
072   *
073   * @return Returns an unmodifiable set containing the values of the "allowed-manager" property.
074   */
075  SortedSet<String> getAllowedManager();
076
077
078
079  /**
080   * Gets the "allowed-user" property.
081   * <p>
082   * Specifies the users to be granted the access rights. This
083   * property is required for SNMP v3 security configuration. An
084   * asterisk (*) opens access to all users.
085   *
086   * @return Returns an unmodifiable set containing the values of the "allowed-user" property.
087   */
088  SortedSet<String> getAllowedUser();
089
090
091
092  /**
093   * Gets the "community" property.
094   * <p>
095   * Specifies the v1,v2 community or the v3 context name allowed to
096   * access the MIB 2605 monitoring information or the USM MIB. The
097   * mapping between "community" and "context name" is set.
098   *
099   * @return Returns the value of the "community" property.
100   */
101  String getCommunity();
102
103
104
105  /**
106   * Gets the "java-class" property.
107   * <p>
108   * Specifies the fully-qualified name of the Java class that
109   * provides the SNMP Connection Handler implementation.
110   *
111   * @return Returns the value of the "java-class" property.
112   */
113  String getJavaClass();
114
115
116
117  /**
118   * Gets the "listen-address" property.
119   * <p>
120   * Specifies the address or set of addresses on which this SNMP
121   * Connection Handler should listen for connections from SNMP
122   * clients.
123   * <p>
124   * Multiple addresses may be provided as separate values for this
125   * attribute. If no values are provided, then the SNMP Connection
126   * Handler listens on all interfaces.
127   *
128   * @return Returns an unmodifiable set containing the values of the "listen-address" property.
129   */
130  SortedSet<InetAddress> getListenAddress();
131
132
133
134  /**
135   * Gets the "listen-port" property.
136   * <p>
137   * Specifies the port number on which the SNMP Connection Handler
138   * will listen for connections from clients.
139   * <p>
140   * Only a single port number may be provided.
141   *
142   * @return Returns the value of the "listen-port" property.
143   */
144  int getListenPort();
145
146
147
148  /**
149   * Gets the "opendmk-jarfile" property.
150   * <p>
151   * Indicates the OpenDMK runtime jar file location
152   *
153   * @return Returns the value of the "opendmk-jarfile" property.
154   */
155  String getOpendmkJarfile();
156
157
158
159  /**
160   * Gets the "registered-mbean" property.
161   * <p>
162   * Indicates whether the SNMP objects have to be registered in the
163   * directory server MBeanServer or not allowing to access SNMP
164   * Objects with RMI connector if enabled.
165   *
166   * @return Returns the value of the "registered-mbean" property.
167   */
168  boolean isRegisteredMbean();
169
170
171
172  /**
173   * Gets the "security-agent-file" property.
174   * <p>
175   * Specifies the USM security configuration to receive authenticated
176   * only SNMP requests.
177   *
178   * @return Returns the value of the "security-agent-file" property.
179   */
180  String getSecurityAgentFile();
181
182
183
184  /**
185   * Gets the "security-level" property.
186   * <p>
187   * Specifies the type of security level : NoAuthNoPriv : No security
188   * mechanisms activated, AuthNoPriv : Authentication activated with
189   * no privacy, AuthPriv : Authentication with privacy activated. This
190   * property is required for SNMP V3 security configuration.
191   *
192   * @return Returns the value of the "security-level" property.
193   */
194  SecurityLevel getSecurityLevel();
195
196
197
198  /**
199   * Gets the "trap-port" property.
200   * <p>
201   * Specifies the port to use to send SNMP Traps.
202   *
203   * @return Returns the value of the "trap-port" property.
204   */
205  int getTrapPort();
206
207
208
209  /**
210   * Gets the "traps-community" property.
211   * <p>
212   * Specifies the community string that must be included in the traps
213   * sent to define managers (trap-destinations). This property is used
214   * in the context of SNMP v1, v2 and v3.
215   *
216   * @return Returns the value of the "traps-community" property.
217   */
218  String getTrapsCommunity();
219
220
221
222  /**
223   * Gets the "traps-destination" property.
224   * <p>
225   * Specifies the hosts to which V1 traps will be sent. V1 Traps are
226   * sent to every host listed.
227   * <p>
228   * If this list is empty, V1 traps are sent to "localhost". Each
229   * host in the list must be identifed by its name or complete IP
230   * Addess.
231   *
232   * @return Returns an unmodifiable set containing the values of the "traps-destination" property.
233   */
234  SortedSet<String> getTrapsDestination();
235
236}