if (pduType == null) {
pduType = "GET";
}
pduType = pduType.toUpperCase();
int type = PDU.getTypeFromString(pduType);
PDU pdu = DefaultPDUFactory.createPDU(target, type);
if ((type == PDU.V1TRAP) && (!(pdu instanceof PDUv1))) {
throw new RuntimeException("V1TRAP can only be sent using SNMPv1");
}
if (type == PDU.GETBULK) {
Integer maxRep = getMaxRepetitions();
if (maxRep != null) {
pdu.setMaxRepetitions(maxRep.intValue());
}
Integer nonRepeaters = getNonRepeaters();
if (nonRepeaters != null) {
pdu.setNonRepeaters(nonRepeaters.intValue());
}
}
else if ((type == PDU.TRAP) || (type == PDU.INFORM)) {
Number tu = (Number) ArgumentParser.getValue(settings, oTrapSysUpTime, 0);
if (tu != null) {
pdu.add(new VariableBinding(SnmpConstants.sysUpTime,
new TimeTicks(tu.longValue())));
}
String to = (String) ArgumentParser.getValue(settings, oTrapOID, 0);
if (to != null) {
pdu.add(new VariableBinding(SnmpConstants.snmpTrapOID, new OID(to)));
}
}
else if (type == PDU.V1TRAP) {
PDUv1 pduV1 = (PDUv1)pdu;
String aa =