public PDUv1() { setType(V1TRAP); }
public PDUv1() { setType(V1TRAP); }
public PDUv1() { setType(V1TRAP); }
/** * Sends a SNMPv1 trap to a target. This method sets the PDU's type to * {@link PDU#V1TRAP} and then sends it to the supplied target. This method * is a convenience wrapper for the {@link #send(PDU pdu, Target target)} * method. * @param pdu * a <code>PDUv1</code> instance. * @param target * the Target instance representing the target SNMP engine where to send * the <code>pdu</code>. The selected SNMP protocol version for the * target must be {@link SnmpConstants#version1}. * @throws IOException * if the trap cannot be sent. * @since 1.1 */ public void trap(PDUv1 pdu, Target target) throws IOException { if (target.getVersion() != SnmpConstants.version1) { throw new IllegalArgumentException( "SNMPv1 trap PDU must be used with SNMPv1"); } pdu.setType(PDU.V1TRAP); send(pdu, target); }
/** * Sends a SNMPv1 trap to a target. This method sets the PDU's type to * {@link PDU#V1TRAP} and then sends it to the supplied target. This method * is a convenience wrapper for the {@link #send(PDU pdu, Target target)} * method. * @param pdu * a <code>PDUv1</code> instance. * @param target * the Target instance representing the target SNMP engine where to send * the <code>pdu</code>. The selected SNMP protocol version for the * target must be {@link SnmpConstants#version1}. * @throws IOException * if the trap cannot be sent. * @since 1.1 */ public void trap(PDUv1 pdu, Target target) throws IOException { if (target.getVersion() != SnmpConstants.version1) { throw new IllegalArgumentException( "SNMPv1 trap PDU must be used with SNMPv1"); } pdu.setType(PDU.V1TRAP); send(pdu, target); }
/** * Sends a SNMPv1 trap to a target. This method sets the PDU's type to * {@link PDU#V1TRAP} and then sends it to the supplied target. This method * is a convenience wrapper for the {@link #send(PDU pdu, Target target)} * method. * * @param pdu * a <code>PDUv1</code> instance. * @param target * the Target instance representing the target SNMP engine where to send * the <code>pdu</code>. The selected SNMP protocol version for the * target must be {@link SnmpConstants#version1}. * * @throws IOException * if the trap cannot be sent. * @since 1.1 */ public void trap(PDUv1 pdu, Target target) throws IOException { if (target.getVersion() != SnmpConstants.version1) { throw new IllegalArgumentException( "SNMPv1 trap PDU must be used with SNMPv1"); } pdu.setType(PDU.V1TRAP); send(pdu, target); }
/** * Create and initialize an SNMP v1 trap PDU. * * @param genericTrap * The generic trap number * @param specificTrap * The specific trap value from your MIB definition * @param enterpriseOid * The IANA enterprise OID to use. * @param timeTicks * The time ticks value as a long * @return The initialized v1 trap PDU ready to have the variable bindings * added */ public PDUv1 createTrapV1(int genericTrap, int specificTrap, String enterpriseOid, long timeTicks) { if (genericTrap < PDUv1.COLDSTART || genericTrap > PDUv1.ENTERPRISE_SPECIFIC) { throw new IllegalArgumentException("The genericTrap must be >= 0 and <= 6"); } PDUv1 pdu= new PDUv1(); pdu.setType(PDU.V1TRAP); pdu.setAgentAddress(address); pdu.setEnterprise(new OID(enterpriseOid)); pdu.setGenericTrap(genericTrap); pdu.setSpecificTrap(specificTrap); pdu.setTimestamp(timeTicks); return pdu; }
pdu.setType(PDU.TRAP);
trapPdu.setType(PDU.V1TRAP);
trapPdu.setType(PDU.V1TRAP);
throw new IOException("Unsupported PDU type: "+pduType.getValue()); this.setType(pduType.getValue()); if (getType() == PDU.V1TRAP) { enterprise.decodeBER(inputStream);
throw new IOException("Unsupported PDU type: "+pduType.getValue()); this.setType(pduType.getValue()); if (getType() == PDU.V1TRAP) { enterprise.decodeBER(inputStream);
throw new IOException("Unsupported PDU type: "+pduType.getValue()); this.setType(pduType.getValue()); if (getType() == PDU.V1TRAP) { enterprise.decodeBER(inputStream);