Search in sources :

Example 6 with SnmpObjectId

use of org.opennms.protocols.snmp.SnmpObjectId in project opennms by OpenNMS.

the class V2TrapInformation method getTrapIdentity.

@Override
public TrapIdentity getTrapIdentity() {
    // Get the value for the snmpTrapOID
    SnmpObjectId snmpTrapOid = (SnmpObjectId) m_pdu.getVarBindAt(V2TrapInformation.SNMP_TRAP_OID_INDEX).getValue();
    SnmpObjectId lastVarBindOid = m_pdu.getVarBindAt(getPduLength() - 1).getName();
    SnmpSyntax lastVarBindValue = m_pdu.getVarBindAt(getPduLength() - 1).getValue();
    return new TrapIdentity(SnmpObjId.get(snmpTrapOid.getIdentifiers()), SnmpObjId.get(lastVarBindOid.getIdentifiers()), new JoeSnmpValue(lastVarBindValue));
}
Also used : SnmpSyntax(org.opennms.protocols.snmp.SnmpSyntax) TrapIdentity(org.opennms.netmgt.snmp.TrapIdentity) SnmpObjectId(org.opennms.protocols.snmp.SnmpObjectId)

Aggregations

SnmpObjectId (org.opennms.protocols.snmp.SnmpObjectId)6 SnmpSyntax (org.opennms.protocols.snmp.SnmpSyntax)6 SocketException (java.net.SocketException)3 SnmpParameters (org.opennms.protocols.snmp.SnmpParameters)3 SnmpPeer (org.opennms.protocols.snmp.SnmpPeer)3 SnmpSession (org.opennms.protocols.snmp.SnmpSession)3 SnmpValue (org.opennms.netmgt.snmp.SnmpValue)2 SnmpVarBind (org.opennms.protocols.snmp.SnmpVarBind)2 TrapIdentity (org.opennms.netmgt.snmp.TrapIdentity)1