PDU
The default PDU type is GET. @author Frank Fock @version 1.1 @see PDUv1 @see ScopedPDU
283284285286287288289290
public ResponseEvent setSync(final A address, final VariableBinding... bindings) throws IOException { checkNoNulls(address, bindings); final Target target = this.createTarget(address); final PDU requestPdu = this.createRequestPdu(PDU.SET, target, bindings); return this.snmp.send(requestPdu, target); }
320321322323324325326327328329330331332333334335336
*/ protected PDU createRequestPdu(final int type, final Target target, final VariableBinding... bindings) { /* Build the request PDU */ final PDUFactory pduFactory = new DefaultPDUFactory(type); final PDU requestPdu = pduFactory.createPDU(target); /* Load up the OIDs or VariableBindings */ if ((type == PDU.GET) || (type == PDU.GETBULK) || (type == PDU.GETNEXT)) { requestPdu.addAllOIDs(bindings); } else { requestPdu.addAll(bindings); } requestPdu.setRequestID(new Integer32(Math.abs(this.random.nextInt()))); return requestPdu; }
112113114115116117118119120121
final ResponseListener listener, final Object handle, final OID... oids) throws IOException { checkNoNulls(address, listener, oids); final Target target = this.createTarget(address); final PDU requestPdu = this.createRequestPdu(PDU.GETBULK, target, VariableBindings.wrapOids(oids)); requestPdu.setMaxRepetitions(maxRepetitions); requestPdu.setNonRepeaters(nonRepeaters); this.getSnmp().send(requestPdu, target, handle, listener); }
128129130131132133134135136137
final OID... oids) throws IOException { checkNoNulls(address, oids); final Target target = this.createTarget(address); final PDU requestPdu = this.createRequestPdu(PDU.GETBULK, target, VariableBindings.wrapOids(oids)); requestPdu.setMaxRepetitions(maxRepetitions); requestPdu.setNonRepeaters(nonRepeaters); return this.getSnmp().send(requestPdu, target); }
145146147148149150151152
final VariableBinding... bindings) throws IOException { checkNoNulls(address, listener, bindings); final Target target = this.createTarget(address); final PDU requestPdu = this.createRequestPdu(PDU.INFORM, target, bindings); this.getSnmp().send(requestPdu, target, handle, listener); }
158159160161162163164165
public ResponseEvent informSync(final A address, final VariableBinding... bindings) throws IOException { checkNoNulls(address, bindings); final Target target = this.createTarget(address); final PDU requestPdu = this.createRequestPdu(PDU.INFORM, target, bindings); return this.getSnmp().send(requestPdu, target); }
171172173174175176177178
public void notify(final A address, final VariableBinding... bindings) throws IOException { checkNoNulls(address, bindings); final Target target = this.createTarget(address); final PDU requestPdu = this.createRequestPdu(PDU.NOTIFICATION, target, bindings); this.getSnmp().send(requestPdu, target); }
99100101102103104105106107108
115116117118119120121122123124
132133134135136137138139