Package org.snmp4j

Examples of org.snmp4j.ScopedPDU


    return target;
  }
  private PDU createPDU(Target target, String contextEngine, String contextName) {
    PDU request;
    if (target.getVersion() == SnmpConstants.version3) {
      request = new ScopedPDU();
      ScopedPDU scopedPDU = (ScopedPDU)request;
      if (contextEngine != null) {
        scopedPDU.setContextEngineID(OctetString.fromHexStringPairs(contextEngine));
      }
      if (contextName != null) {
        scopedPDU.setContextName(new OctetString(contextName));
      }
    }
    else {
      request = new PDU();
    }
View Full Code Here


    }

    public PDU createPDU(Target target) {
        PDU request;
        if (target.getVersion() == SnmpConstants.version3) {
            request = new ScopedPDU();
            ScopedPDU scopedPDU = (ScopedPDU) request;
            if (contextEngineID != null) {
                scopedPDU.setContextEngineID(contextEngineID);
            }

            if (contextName != null) {
                scopedPDU.setContextName(contextName);
            }
        } else {
            if (pduType == PDU.V1TRAP) {
                v1TrapPDU.setTimestamp(sysUpTime.toLong());
                request = v1TrapPDU;
View Full Code Here

        if (e != null) {
          pduV1.setEnterprise(new OID(e));
        }
      }
      if (pdu instanceof ScopedPDU) {
        ScopedPDU scoped = (ScopedPDU)pdu;
        String cEngineID =
            (String) ArgumentParser.getValue(settings, oContextEngineID, 0);
        if (cEngineID != null) {
          scoped.setContextEngineID(createOctetString(cEngineID, null));
        }
        String cn =
            (String) ArgumentParser.getValue(settings, oContextName, 0);
        if (cn != null) {
          scoped.setContextName(createOctetString(cn, null));
        }
      }
      return pdu;
    }
View Full Code Here

TOP

Related Classes of org.snmp4j.ScopedPDU

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.