opendj-sdk/opends/build.xml
@@ -496,6 +496,12 @@ <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml" failOnViolation="true"> <fileset dir="${snmp.src.dir}" includes="**/*.java" /> <formatter type="plain" /> </checkstyle> <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml" failOnViolation="true"> <fileset dir="${quicksetup.src.dir}" includes="**/*.java" /> <formatter type="plain" /> </checkstyle> opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DIRECTORY_SERVER_MIBImpl.java
@@ -48,24 +48,24 @@ */ private static final DebugTracer TRACER = DebugLogger.getTracer(); /** * Indicates if the SNMP Mbeans have to be registered or not * Indicates if the SNMP Mbeans have to be registered or not. */ private boolean registeredSnmpMBean = false; /** * The Current Directory Server MIB * The Current Directory Server MIB. */ private DsMIBImpl dsMib = null; /** * ObjectName of the Current Direcotry Server MIB * ObjectName of the Current Direcotry Server MIB. */ private ObjectName mibObName; /** * ObjectName of the dsMIB group in the Directory Server MIB * ObjectName of the dsMIB group in the Directory Server MIB. */ private ObjectName groupObjName; /** * Creates the Current Directory Server MIB * Creates the Current Directory Server MIB. * @param registeredMBean indicates if the SNMP MBean has to register * in the Direcotry Server MBeanServer * @param mibName of the Directory Server MIB @@ -121,7 +121,7 @@ } /** * Returns the created dsMIB group * Returns the created dsMIB group. * @return the DsMIBImpl */ protected DsMIBImpl getMib() { @@ -129,7 +129,7 @@ } /** * Returns the ObjectName of the dsMIB group * Returns the ObjectName of the dsMIB group. * @return the ObjectName of the created dsMIB group */ protected ObjectName getObjectName() { opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsApplIfOpsEntryImpl.java
@@ -26,7 +26,6 @@ */ package org.opends.server.snmp; import com.sun.management.snmp.SnmpStatusException; import com.sun.management.snmp.agent.SnmpMib; import javax.management.MBeanServer; import javax.management.ObjectName; @@ -51,30 +50,30 @@ */ private static final DebugTracer TRACER = DebugLogger.getTracer(); /** * ObjectName of the DsApplIfOpsEntry * ObjectName of the DsApplIfOpsEntry. */ private ObjectName entryName; /** * MBeanServer where the cn=monitor Connection Handler MBean are registered * MBeanServer where the cn=monitor Connection Handler MBean are registered. */ private MBeanServer server; /** * ObjectName of the cn=monitor Connection Handler MBean * ObjectName of the cn=monitor Connection Handler MBean. */ private ObjectName connectionHandlerName; /** * SNMPMonitor representing the gateway beetween SNMP MBeans and cn=monitor * MBeans * MBeans. */ private SNMPMonitor monitor; /** * ObjectName of the MBeans representing the Statistics of the cn=monitor * ConnectionHandler * ConnectionHandler. */ private ObjectName stats; /** * Created a DsApplIfOpsEntry in the SnmpMib * Created a DsApplIfOpsEntry in the SnmpMib. * @param mib where the entry has to be created * @param server where the corresponding cn=monitor MBean are registered * @param connectionHandlerObjectName mapping ObjectName @@ -279,7 +278,7 @@ } /** * Returns the ObjectName of the SNMP entry MBean * Returns the ObjectName of the SNMP entry MBean. * @return ObjectName of the entry */ public ObjectName getObjectName() { opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsEntry.java
@@ -30,12 +30,12 @@ /** * This interface should be implemented by all the DS:OID MBean and * allows to get the ObjectName of a SNMP OID MBean * allows to get the ObjectName of a SNMP OID MBean. */ public interface DsEntry { /** * Returns the ObjectName of the SNMP Entry * Returns the ObjectName of the SNMP Entry. * @return the ObjectName of the SNMP Entry */ public ObjectName getObjectName(); opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsMIBImpl.java
@@ -62,45 +62,45 @@ private static final DebugTracer TRACER = DebugLogger.getTracer(); /** * Directory Server MIB access * Directory Server MIB access. */ private SnmpMib mib; /** * Register or not the SNMP MBean * Register or not the SNMP MBean. */ private boolean registeredSnmpMBean = false; /** * List of DsTableEntries * List of DsTableEntries. */ private Hashtable<ObjectName, DsEntry> dsTableEntries = new Hashtable<ObjectName, DsEntry>(); /** * List of DsIntTableEntries * List of DsIntTableEntries. */ private Hashtable<ObjectName, DsEntry> dsApplIfOpsTableEntries = new Hashtable<ObjectName, DsEntry>(); /** * List of DsIntTableEntries * List of DsIntTableEntries. */ private Hashtable<ObjectName, DsEntry> dsIntTableEntries = new Hashtable<ObjectName, DsEntry>(); /** * Directory Server MBeanServer * Directory Server MBeanServer. */ private MBeanServer server; /** * cn=monitor Mapping Class SNMP->MBean * cn=monitor Mapping Class SNMP->MBean. */ private SNMPMonitor monitor; /** * Start Table indexes * Start Table indexes. */ private int applIndex = 1; private int applIfOpsIndex = 1; @@ -135,8 +135,8 @@ } /** * Returns the Set of ObjectName of all the created entries in all the Table * @return Set<ObjectName> * Returns the Set of ObjectName of all the created entries in all the Table. * @return The Set of ObjectName */ @SuppressWarnings("unchecked") public Set<ObjectName> getEntriesObjectNames() { @@ -148,8 +148,8 @@ } /** * Returns the list of Created Entries * @return Set<ObjectName> of created entries * Returns the list of Created Entries. * @return Set of created entries */ @SuppressWarnings("unchecked") public Set<ObjectName> getEntries() { @@ -162,9 +162,9 @@ /** * handleNotification callback called when an MBeansServer Notification is * received * received. * @param notification received * @param handback * @param handback The handback */ public void handleNotification(Notification notification, Object handback) { if (notification instanceof MBeanServerNotification) { @@ -191,14 +191,14 @@ } /** * initDsTables in the dsMib Group * initDsTables in the dsMib Group. */ private void initDsTables() { // Initialize the DSTable with one Entry : Current Directory Server initializeDsTable(); // Initialize the DsApplIfOpsTable with one entry per Connection Handler // Initialize the DsApplIfOpsTable with one entry per Connection Handler. initializeDsApplIfOpsTable(); // Register as listener of the MBeanServer Notification to process @@ -215,7 +215,7 @@ } /** * initializeDsTable with the current Direcotry server instance * initializeDsTable with the current Directory server instance. * Only one entry is created in this table **/ private void initializeDsTable() { @@ -225,7 +225,7 @@ /** * initializeDsApplIfOpsTable with the already registered Connection * Handlers * Handlers. **/ private void initializeDsApplIfOpsTable() { // Get the list of ConnectionHandlers MBeans @@ -238,7 +238,7 @@ } /** * addRowInDsTable * addRowInDsTable. * @return true if the entry has been added else false */ private boolean addRowInDsTable() { @@ -272,7 +272,7 @@ } /** * addRowInDsIntTable Not Supported * addRowInDsIntTable Not Supported. * @return false (Not Supported for this current delivery) */ private boolean addRowInDsIntTable() { @@ -280,7 +280,7 @@ } /** * addRowInDsApplIfOpsTable * addRowInDsApplIfOpsTable. * @param connectionHandlerName to add * @return true if the entry has been added else false */ @@ -315,7 +315,7 @@ } /** * removeRowInDsApplIfOpsTable * removeRowInDsApplIfOpsTable. * @param connectionHandlerName * @return true if the entry has been removed else false */ @@ -339,7 +339,7 @@ /** * isAConnectionHandler allows to check if the Mbean is a Connection Handler * isAConnectionHandler allows to check if the Mbean is a Connection Handler. * @param name of the MBean * @return true if the MBean is a Connection Handler else false */ opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsTableEntryImpl.java
@@ -53,24 +53,24 @@ */ private static final DebugTracer TRACER = DebugLogger.getTracer(); /** * Directory Server MBeanServer * Directory Server MBeanServer. */ private MBeanServer server; /** * Mapping Class * Mapping Class. */ private SNMPMonitor monitor; /** * ObjectName of the entry * ObjectName of the entry. */ private ObjectName entryName; /** * Index of the Directory Server Instance (applIndex) * Index of the Directory Server Instance (applIndex). */ private Integer applIndex; /** * Creates a DsTableEntry * Creates a DsTableEntry. * @param mib the SNMP Mib where the entry will be created * @param server where the mapping objects will be found * @param index of the entry in the DsTable @@ -169,7 +169,7 @@ } /** * Gets the object of the entry * Gets the object of the entry. * @return ObjectName of the entry */ public ObjectName getObjectName() { opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPClassLoaderProvider.java
@@ -27,17 +27,11 @@ package org.opends.server.snmp; import java.io.File; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import org.opends.server.loggers.debug.DebugLogger; import org.opends.server.loggers.debug.DebugTracer; import org.opends.server.types.DebugLogLevel; import static org.opends.messages.ProtocolMessages.*; import static org.opends.server.loggers.ErrorLogger.*; import static org.opends.server.loggers.debug.DebugLogger.*; import com.sun.management.comm.SnmpV3AdaptorServer; @@ -58,6 +52,9 @@ import org.opends.server.util.Validator; /** * The SNMPClassLoaderProvider. */ public class SNMPClassLoaderProvider { /** @@ -72,60 +69,69 @@ /** * MBeanServer of OpenDS * MBeanServer of OpenDS. */ private MBeanServer server; /** * MIB to manage * MIB to manage. */ private DIRECTORY_SERVER_MIBImpl dsMib; /** * ObjectName of the MIB2605 * ObjectName of the MIB2605. */ private ObjectName mibObjName; /** * ObjectName of the SnmpAdaptor * ObjectName of the SnmpAdaptor. */ private ObjectName snmpObjName; /** * SNMP Port Number for SNMP requests * SNMP Port Number for SNMP requests. */ private int snmpPort = 161; /** * Default SNMP trap port Number for SNMP Traps * Default SNMP trap port Number for SNMP Traps. */ private int snmpTrapPort = 162; /** * Default SNMP Version * Default SNMP Version. */ private String snmpVersion = SNMPConnectionHandlerDefinitions.SNMP_VERSION_V3; private String snmpVersion = SNMPConnectionHandlerDefinitions.SNMP_VERSION_V3; /** * Registration of the SNMP MBeans * Registration of the SNMP MBeans. */ private boolean registeredSNMPMBeans = false; /** * The unique name for this connection handler * The unique name for this connection handler. */ private String connectionHandlerName; /** * ObjectName of the UsmMIB * ObjectName of the UsmMIB. */ private ObjectName UsmObjName; private SnmpV3AdaptorServer snmpAdaptor; /** * Default constructor. */ public SNMPClassLoaderProvider() { // No implementation required } /** * Initialization. * @param configuration The configuration */ public void initializeConnectionHandler( SNMPConnectionHandlerCfg configuration) { @@ -141,6 +147,14 @@ } /** * Applies the configuration changes to this change listener. * * @param configuration * The new configuration containing the changes. * @return Returns information about the result of changing the * configuration. */ public ConfigChangeResult applyConfigurationChange( SNMPConnectionHandlerCfg configuration) { @@ -168,7 +182,8 @@ // Creates and starts the SNMP Adaptor this.snmpObjName = new ObjectName( SNMPConnectionHandlerDefinitions.SNMP_DOMAIN + "class=SnmpAdaptorServer,protocol=snmp,port=" + snmpPort); "class=SnmpAdaptorServer,protocol=snmp," + "port=" + snmpPort); this.server.registerMBean(this.snmpAdaptor, this.snmpObjName); this.snmpAdaptor.start(); @@ -187,14 +202,14 @@ // Check if the security file // If security file have changed, changeConfiguration not // Supported // Supported. return new ConfigChangeResult(ResultCode.SUCCESS, false); } /** * Gets the ObjectName of the crated USM MIB MBean * @return * Gets the ObjectName of the crated USM MIB MBean. * @return The UsmMIB ObjectName */ public ObjectName getUsmMIBName() { return this.UsmObjName; @@ -270,6 +285,10 @@ } } /** * Finalize. */ public void finalizeConnectionHandler() { try { @@ -316,7 +335,8 @@ } private SnmpV3AdaptorServer getSnmpAdaptor(SNMPConnectionHandlerCfg configuration) { private SnmpV3AdaptorServer getSnmpAdaptor( SNMPConnectionHandlerCfg configuration) { Validator.ensureNotNull(configuration); SnmpV3AdaptorServer adaptor = null; @@ -328,7 +348,8 @@ if (configuration.getVersion().toLowerCase().equals( SNMPConnectionHandlerDefinitions.SNMP_VERSION_V3)) { System.setProperty("jdmk.security.file", file.getAbsolutePath()); System.setProperty("jdmk.security.file", file.getAbsolutePath()); } // Create the Security Parameters for the engine @@ -342,7 +363,8 @@ engineParameters.setUserAcl(uacls); // V1/V2 Security parameters InetAddressAcl acls = (InetAddressAcl)new SNMPInetAddressAcl(configuration); InetAddressAcl acls = (InetAddressAcl)new SNMPInetAddressAcl(configuration); adaptor = new SnmpV3AdaptorServer(engineParameters, null, acls, configuration.getListenPort(), InetAddress.getLocalHost()); opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPConnectionHandler.java
@@ -49,7 +49,6 @@ import org.opends.server.core.DirectoryServer; import static org.opends.messages.ProtocolMessages.*; import static org.opends.server.loggers.ErrorLogger.*; import static org.opends.server.loggers.debug.DebugLogger.*; /** * This class defines an SNMP connection handler, which can be used to answer @@ -65,19 +64,19 @@ // Current configuration SNMPConnectionHandlerCfg currentConfig; /** * The list of active client connection * The list of active client connection. */ private LinkedList<ClientConnection> connectionList; /** * The set of listeners for this connection handler * The set of listeners for this connection handler. */ private LinkedList<HostPort> listeners = new LinkedList<HostPort>(); /** * SNMP Connection Handler delegation class * SNMP Connection Handler delegation class. */ private SNMPClassLoaderProvider provider; /** * Is the SNMP Connection Handler Operational * Is the SNMP Connection Handler Operational. */ private boolean isOperational = false; @@ -249,7 +248,8 @@ * {@inheritDoc} */ public LinkedHashMap<String, String> getAlerts() { LinkedHashMap<String, String> alerts = new LinkedHashMap<String, String>(); LinkedHashMap<String, String> alerts = new LinkedHashMap<String, String>(); return alerts; } @@ -258,9 +258,11 @@ try { URL u = new URL("jar:file://"+ file.toString()+"!/"); Class[] parameters = new Class[]{URL.class}; URLClassLoader sysloader = (URLClassLoader)ClassLoader.getSystemClassLoader(); URLClassLoader sysloader = (URLClassLoader)ClassLoader.getSystemClassLoader(); Class sysclass = URLClassLoader.class; Method method = sysclass.getDeclaredMethod("addURL",new Class[]{URL.class}); Method method = sysclass.getDeclaredMethod("addURL",new Class[]{URL.class}); method.setAccessible(true); method.invoke(sysloader,new Object[]{ u }); } @@ -270,10 +272,14 @@ private void initSnmpClasses() { try { URLClassLoader opendsLoader = (URLClassLoader)DirectoryServer.getClassLoader(); Class.forName("com.sun.management.comm.SnmpV3AdaptorServer", true, opendsLoader); Class.forName("com.sun.management.snmp.InetAddressAcl",true, opendsLoader); Class.forName("com.sun.management.snmp.SnmpEngineParameters",true, opendsLoader); URLClassLoader opendsLoader = (URLClassLoader)DirectoryServer.getClassLoader(); Class.forName("com.sun.management.comm.SnmpV3AdaptorServer", true, opendsLoader); Class.forName("com.sun.management.snmp.InetAddressAcl", true, opendsLoader); Class.forName("com.sun.management.snmp.SnmpEngineParameters", true, opendsLoader); Class.forName("com.sun.management.snmp.UserAcl",true, opendsLoader); this.isOperational = true; } catch (ClassNotFoundException ex) { @@ -281,16 +287,24 @@ } } /** * Indicate if operational. * @param file The file * @return true is operational */ public boolean isOperational(File file) { this.addFile(file); this.initSnmpClasses(); return this.isOperational; } /** * Indicate if operational. * @return true is operational */ public boolean isOperational() { return this.isOperational; } } opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPConnectionHandlerDefinitions.java
@@ -34,13 +34,23 @@ */ public class SNMPConnectionHandlerDefinitions { // SNMP Version supported /** * SNMP V1 supported. */ public static String SNMP_VERSION_V1 = "v1"; /** * SNMP V2 supported. */ public static String SNMP_VERSION_V2 = "v2"; /** * SNMP V3 supported. */ public static String SNMP_VERSION_V3 = "v3"; /** * List of Supported SNMP Version * List of Supported SNMP Version. */ public static Set<String> SUPPORTED_SNMP_VERSION=new HashSet<String>(); static { @@ -49,42 +59,103 @@ SUPPORTED_SNMP_VERSION.add(SNMP_VERSION_V3); } // Domain for SNMP MBeans /** * Domain for SNMP MBeans. */ public static final String SNMP_DOMAIN = "org.opends.server.snmp:"; // Domain for Monitor MBeans /** * Domain for Monitor MBeans. */ public static final String JMX_DOMAIN = "org.opends.server:"; // Name of monitor Mbeans /** * Name of MONITOR_CLIENT_CONNECTIONS_OBJECTNAME monitor Mbean. */ public static final String MONITOR_CLIENT_CONNECTIONS_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-Client_Connections"; /** * Name of MONITOR_ENTRY_CACHES_OBJECTNANE monitor Mbean. */ public static final String MONITOR_ENTRY_CACHES_OBJECTNANE = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-Entry_Caches"; /** * Name of MONITOR_JVM_MEMORY_USAGE_OBJECTNAME monitor Mbean. */ public static final String MONITOR_JVM_MEMORY_USAGE_OBJECTNAME = "RootDSE,Rdn1=cn-monitor,Rdn2=cn-JVM_Memory_Usage"; /** * Name of MONITOR_JVM_STACK_TRACE_OBJECTNAME monitor Mbean. */ public static final String MONITOR_JVM_STACK_TRACE_OBJECTNAME = "" + "rootDSE,Rdn1=cn-monitor,Rdn2=cn-JVM_Stack_Trace"; /** * Name of MONITOR_SYSTEM_INFORMATION_OBJECTNAME monitor Mbean. */ public static final String MONITOR_SYSTEM_INFORMATION_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-System_Information"; /** * Name of MONITOR_VERSION_OBJECTNAME monitor Mbean. */ public static final String MONITOR_VERSION_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-Version"; /** * Name of MONITOR_WORK_QUEUE_OBJECTNAME monitor Mbean. */ public static final String MONITOR_WORK_QUEUE_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-Work_Queue"; /** * Name of MONITOR_ADMIN_ROOT_BACKEND_OBJECTNAME monitor Mbean. */ public static final String MONITOR_ADMIN_ROOT_BACKEND_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-adminRoot_Backend"; /** * Name of MONITOR_ADSTRUSTSTORE_BACKEND_OBJECTNAME monitor Mbean. */ public static final String MONITOR_ADSTRUSTSTORE_BACKEND_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-adstruststore_Backend"; /** * Name of MONITOR_BACKUP_BACKEND_OBJECTNAME monitor Mbean. */ public static final String MONITOR_BACKUP_BACKEND_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-backup_Backend"; /** * Name of MONITOR_MONITOR_BACKEND_OBJECTNAME monitor Mbean. */ public static final String MONITOR_MONITOR_BACKEND_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-monitor_Backend"; /** * Name of MONITOR_SCHEMA_BACKEND_OBJECTNAME monitor Mbean. */ public static final String MONITOR_SCHEMA_BACKEND_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-schema_Backend"; /** * Name of MONITOR_TASKS_BACKEND_OBJECTNAME monitor Mbean. */ public static final String MONITOR_TASKS_BACKEND_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-tasks_Backend"; /** * Name of MONITOR_USERROOT_BACKEND_OBJECTNAME monitor Mbean. */ public static final String MONITOR_USERROOT_BACKEND_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-userRoot_Backend"; /** * Name of MONITOR_USERROOT_DATABASE_ENVIRONMENT_OBJECTNAME monitor Mbean. */ public static final String MONITOR_USERROOT_DATABASE_ENVIRONMENT_OBJECTNAME = "rootDSE,Rdn1=cn-monitor,Rdn2=cn-userRoot_Database_Environment"; } opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPInetAddressAcl.java
@@ -63,7 +63,7 @@ /** * Creates an IP-Based ACL controller * Creates an IP-Based ACL controller. * @param configuration of the Configuration */ public SNMPInetAddressAcl(SNMPConnectionHandlerCfg configuration) { @@ -92,7 +92,7 @@ } /** * Gets the name of the acl * Gets the name of the acl. * @return the name of the acl as a String */ public String getName() { @@ -161,7 +161,7 @@ /** * {@inheritDoc} * @return the list<InetAddress> of traps destinations * @return the list of traps destinations */ public Enumeration getTrapDestinations() { Vector<InetAddress> tempDests = new Vector<InetAddress>(); @@ -180,7 +180,7 @@ /** * {@inheritDoc} * @param address * @return * @return the list of communities */ public Enumeration getTrapCommunities(InetAddress address) { Vector<String> trapCommunities = new Vector<String>(); opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPMonitor.java
@@ -33,7 +33,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.Set; import javax.management.Attribute; import javax.management.MBeanServer; @@ -53,23 +52,23 @@ public class SNMPMonitor { /** * Debug Tracer for this class * Debug Tracer for this class. */ private static final DebugTracer TRACER = DebugLogger.getTracer(); /** * Singleton SNMPMonitor object * Singleton SNMPMonitor object. */ private static SNMPMonitor monitor = null; /** * Monitor MBeanServer server * Monitor MBeanServer server. */ private MBeanServer server; /** * Subject Auth to use to access the JMX Mbeans cn=monitor * Subject Auth to use to access the JMX Mbeans cn=monitor. */ private Subject subject = null; /** * Pattern to use to query the cn=monitor MBeans * Pattern to use to query the cn=monitor MBeans. */ public static ObjectName pattern; @@ -86,7 +85,7 @@ } /** * Creates an SNMPMonitor object mapping * Creates an SNMPMonitor object mapping. * @param server to use to the mapping */ private SNMPMonitor(MBeanServer server) { @@ -99,9 +98,9 @@ } /** * Gets the singleton SNMPMonitor object * @param server * @return the SNMPMonitor mapping object * Gets the singleton SNMPMonitor object. * @param server The server * @return the SNMPMonitor mapping object. */ public static SNMPMonitor getMonitor(MBeanServer server) { if (monitor == null) { @@ -111,8 +110,8 @@ } /** * Gets the Connection Handlers Statistics MBean * @return the Set<ObjectName> of Connection Handlers Statistics. * Gets the Connection Handlers Statistics MBean. * @return the Set of Connection Handlers Statistics. * If Statistics do not exixist then an empty Set is returned */ public Set<ObjectName> getConnectionHandlersStatistics() { @@ -136,7 +135,7 @@ /** * Return the ObjectName of the Connection Handler corresponding to * the statistics name * the statistics name. * @param statistics ObjectName * @return the Connection Handler ObjectName, null otherwise */ @@ -170,7 +169,7 @@ } /** * Return a Set of Connection Handler ObjectNames * Return a Set of Connection Handler ObjectNames. * @return the Set of ObjectNames, an empty Set if no connection handlers */ public Set<ObjectName> getConnectionHandlers() { @@ -195,9 +194,9 @@ } /** * Returns the ObjectName of the Statistics Connection Handler name * Returns the ObjectName of the Statistics Connection Handler name. * corresponding to the Connection Handler name * @param connectionHandlerName * @param connectionHandlerName The connection handler name * @return the ObjectName of the statistics ObjectName, null if the statistics * could not be found */ @@ -225,7 +224,7 @@ } /** * Get the value of the attribute * Get the value of the attribute. * @param name of Mbean as a String * @param attribute to look for * @return the value of the attribute, null if the attribute could not @@ -246,7 +245,7 @@ } /** * Gets the value of an attribute * Gets the value of an attribute. * @param name of the Mbean * @param attribute to look for * @return the value of the attribute, null if the attribute value could not @@ -273,7 +272,7 @@ } /** * Wrapper for SNMP Counter32 * Wrapper for SNMP Counter32. * @param v value * @return a counter32 */ @@ -286,7 +285,7 @@ } /** * Wrapper for SNMP Counter32 * Wrapper for SNMP Counter32. * @param V Value * @return a Counter32 */ @@ -300,7 +299,7 @@ } /** * Latcher for SNMP Gauge32 * Latcher for SNMP Gauge32. * @param v value * @return a gauge32 */ @@ -313,7 +312,7 @@ } /** * Latcher for SNMP Gauge32 * Latcher for SNMP Gauge32. * @param V value * @return a gauge32 */ @@ -327,10 +326,10 @@ } /** * Checker for SNMP INTEGER * Checker for SNMP INTEGER. * @param V value * @return an Integer * @throws com.sun.management.snmp.SnmpStatusException * @throws com.sun.management.snmp.SnmpStatusException If an error occurs */ public static Integer integerValue(Long V) throws SnmpStatusException { long v = V.longValue(); @@ -342,7 +341,7 @@ } /** * pow x^y * pow x^y. */ private static long pow(long x, long y) { int j = 1; opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPUserAcl.java
@@ -33,6 +33,10 @@ import org.opends.server.loggers.debug.DebugLogger; import org.opends.server.loggers.debug.DebugTracer; /** * The SNMP User ACL. * */ public class SNMPUserAcl implements UserAcl { /** @@ -40,7 +44,7 @@ */ private static final DebugTracer TRACER = DebugLogger.getTracer(); /** * If * then all the users are allowed to access in read * If * then all the users are allowed to access in read. */ private static final String ALL_USERS_ALLOWED = "*"; /** @@ -48,19 +52,19 @@ */ private SNMPConnectionHandlerCfg currentConfig; /** * Configured hosts list * Configured hosts list. */ private SortedSet usersList; /** * Configured traps destinations * Configured traps destinations. */ private SortedSet trapDestinations; /** * Configured communities string * Configured communities string. */ private SortedSet communityList; /** * Configured Security level * Configured Security level. */ private SecurityLevel securityLevel; /** @@ -114,7 +118,9 @@ int securityLevel) { // Special check for the defaultUser if ((user.equals(this.templateUsername)) && (contextName.equals("null")) && ((this.securityLevel.ordinal() + 1) >= securityLevel)) { if ((user.equals(this.templateUsername)) && (contextName.equals("null")) && ((this.securityLevel.ordinal() + 1) >= securityLevel)) { return true; }