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

fguigues
22.37.2008 66158c723e127ef41a4a60566fb8f1f53c680e54
Fixes: 
3142: SNMP: SNMP Connection Handler should accept snmp requests on localhost
3239: On Windows, server can't load jdmkrt.jar file
3253: SNMP: wrong value for dsServerType entry

5 files modified
56 ■■■■ changed files
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsApplIfOpsEntryImpl.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsTableEntryImpl.java 21 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPClassLoaderProvider.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPConnectionHandler.java 8 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPMonitor.java 15 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsApplIfOpsEntryImpl.java
@@ -93,6 +93,15 @@
  }
  /**
   * Getter for the "DsApplIfProtocol" variable.
   * @return an OID representing the connection handler:port
   */
  public String getDsApplIfProtocol() {
//      return  new String("1.3.6.1..27.3.") + portNumber;
      return DsApplIfProtocol;
  }
  /**
   * {@inheritDoc}
   * @return DsApplIfSearchOps
   */
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/DsTableEntryImpl.java
@@ -85,6 +85,27 @@
  }
  /**
     * Getter for the "DsServerType" variable.
     * @return a Byte[] representing the Ds Server Type
     */
    public Byte[] getDsServerType() {
        try {
            String value1 = (String) this.monitor.getAttribute(
                    SNMPConnectionHandlerDefinitions.MONITOR_VERSION_OBJECTNAME,
                    "fullVersion");
            String value2 = (String) this.monitor.getAttribute(
                    SNMPConnectionHandlerDefinitions.MONITOR_VERSION_OBJECTNAME,
                    "buildID");
            return SNMPMonitor.string2ByteArray(value1 + " - " + value2);
        } catch (Exception ex) {
            if (DebugLogger.debugEnabled()) {
                TRACER.debugCaught(DebugLogLevel.ERROR, ex);
            }
            return null;
        }
    }
    /**
   * {@inheritDoc}
   * @return DsCacheHits as Long
   */
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPClassLoaderProvider.java
@@ -39,7 +39,6 @@
import com.sun.management.snmp.SnmpEngineParameters;
import com.sun.management.snmp.UserAcl;
import java.net.InetAddress;
import java.util.Iterator;
import java.util.Set;
import javax.management.MBeanServer;
@@ -363,7 +362,7 @@
                    (InetAddressAcl) new SNMPInetAddressAcl(configuration);
            adaptor = new SnmpV3AdaptorServer(engineParameters, null, acls,
                    configuration.getListenPort(), InetAddress.getLocalHost());
                    configuration.getListenPort(), null);
            // Enable the community to context translation for V1/V2 to V3
            adaptor.enableCommunityStringAtContext();
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPConnectionHandler.java
@@ -31,7 +31,6 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
@@ -189,8 +188,7 @@
     */
    @Override()
    public Collection<HostPort> getListeners() {
        // There are no listeners for this connection handler.
        return Collections.<HostPort>emptySet();
        return this.listeners;
    }
    /**
@@ -199,7 +197,7 @@
    @Override()
    public Collection<ClientConnection> getClientConnections() {
        // There are no client connections for this connection handler.
        return Collections.<ClientConnection>emptySet();
        return this.connectionList;
    }
    /**
@@ -264,7 +262,7 @@
    @SuppressWarnings("unchecked")
    private void addFile(File file) {
        try {
            URL u = new URL("jar:file://"+ file.toString()+"!/");
            URL u = new URL("jar:file:/"+ file.toString()+"!/");
            Class[] parameters = new Class[]{URL.class};
            URLClassLoader sysloader =
              (URLClassLoader)ClassLoader.getSystemClassLoader();
opendj-sdk/opends/src/snmp/src/org/opends/server/snmp/SNMPMonitor.java
@@ -272,6 +272,21 @@
  }
  /**
   * Wrapper for SNMP Byte[].
   * @param s value string
   * @return a Byte[]
   */
  public static Byte[] string2ByteArray(String s) {
    byte[] b = s.getBytes();
    Byte[] barray = new Byte[b.length];
    for (int index=0; index<b.length; index++) {
        barray[index] = new Byte(b[index]);
    }
    return barray;
  }
  /**
   * Wrapper for SNMP Counter32.
   * @param v value
   * @return a counter32