예제 #1
0
파일: SnmpURI.java 프로젝트: hikumar/snmp4j
 @Override
 public boolean next(TreeEvent event) {
   if (!finished) {
     SnmpUriResponse response = createResponse(event);
     finished |= callback.onResponse(response, url, event.getUserObject());
   }
   return !finished;
 }
예제 #2
0
파일: SnmpURI.java 프로젝트: hikumar/snmp4j
 @Override
 public void finished(TreeEvent event) {
   if (!finished) {
     SnmpUriResponse response = createResponse(event);
     if (response.getResponseType() == SnmpUriResponse.Type.NEXT) {
       response.setResponseType(SnmpUriResponse.Type.FINAL);
     }
     callback.onResponse(response, url, event.getUserObject());
     finished = true;
   }
 }
예제 #3
0
파일: SnmpURI.java 프로젝트: hikumar/snmp4j
 @Override
 public void onResponse(ResponseEvent event) {
   SnmpUriResponse response = new SnmpUriResponse(SnmpUriResponse.Type.TIMEOUT);
   PDU responsePDU = event.getResponse();
   if (responsePDU != null) {
     if (responsePDU.getErrorStatus() != PDU.noError) {
       response = new SnmpUriResponse(responsePDU.getErrorStatus());
     } else {
       response =
           new SnmpUriResponse(
               Collections.singletonList(
                   responsePDU
                       .getVariableBindings()
                       .toArray(new VariableBinding[responsePDU.size()])));
     }
   }
   callback.onResponse(response, url, event.getUserObject());
 }