mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

fguigues
23.06.2009 281637b425bc289c63114a1f397c4dcac6499963
Fix 3687 : SNMP: incorrect value for dsApplIfProtocol entry after server restart
Fix 3690 : SNMP: incorrect value for dsServerDescription entry

2 files modified
27 ■■■■■ changed files
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsMIBImpl.java 18 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsTableEntryImpl.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsMIBImpl.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.server.snmp;
@@ -341,12 +341,16 @@
 * @return true if the MBean is a Connection Handler else false
 */
  private boolean isAConnectionHandler(ObjectName name) {
    String canonicalName = name.getCanonicalName();
    if ((canonicalName.contains("Connection_Handler")) &&
            (!(canonicalName.endsWith("_Statistics")))) {
      return true;
    } else {
      return false;
    // First level
    String Rdn2 = name.getKeyProperty("Rdn2");
    // Second level
    String Rdn3 = name.getKeyProperty("Rdn3");
    if ((Rdn3==null) || (Rdn3.length()==0)) {
      if ((Rdn2.contains("Connection_Handler")) &&
            (!(Rdn2.endsWith("_Statistics")))) {
         return true;
      }
    }
    return false;
  }
}
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsTableEntryImpl.java
@@ -22,15 +22,17 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.server.snmp;
import com.sun.management.snmp.agent.SnmpMib;
import java.io.File;
import java.util.Iterator;
import java.util.Set;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import org.opends.server.core.DirectoryServer;
import org.opends.server.loggers.debug.DebugLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.DebugLogLevel;
@@ -178,9 +180,8 @@
    public String getDsServerDescription() {
        String result = null;
        try {
            result = (String) this.monitor.getAttribute(
        SNMPConnectionHandlerDefinitions.MONITOR_SYSTEM_INFORMATION_OBJECTNAME,
                    "workingDirectory");
            result = DirectoryServer.getServerRoot() +
                    File.separatorChar + "bin";
        } catch (Exception ex) {
            if (DebugLogger.debugEnabled()) {
                TRACER.debugCaught(DebugLogLevel.ERROR, ex);