Hi Scott,
Normally the last entry in the list has the error. Any other case  
would indicate an abnormal behavior of the agent.

Best regards,
Frank

Von meinem iPhone gesendet

Am 03.08.2010 um 15:36 schrieb "Mackay, Scott"  
<[email protected]>:

> A sanity check, in case anyone has processed the error results  
> before...
> It looks like the List of TreeEvents holds the information.
> for each TreeEvent entry you can do a .isError().  I think the  
> detection would be as follows:
>
>          for (int i = 0; i < results.size(); i++) {
>            TreeEvent tresult = (TreeEvent) results.get(i);
>            if (tresult.isError()==true) {
>                 if (tresult.getStatus()==TreeEvent.STATUS_REPORT){
>                    VariableBinding[]  
> bindings=tresult.getVariableBindings();
>                    for (VariableBinding bind:bindings) {
>                        if (bind.getOid().equals 
> (SnmpConstants.usmStatsNotInTimeWindows)==true) {
>                            result.badTimeWindow=true;
>                            break;
>                        }
>
>                    }
>
>                }
>            }
> Does that seem the right place to get an error status like the not  
> in time window?
>
>
> -Scott
>
>
> -----Original Message-----
> From: [email protected] on behalf of Mackay, Scott
> Sent: Mon 8/2/2010 7:17 PM
> To: [email protected]
> Subject: [SNMP4J] TreeUtils detecting issues with getSubtree results
>
>
> I had a question about detecting error conditions while performing a  
> TreeUtils getSubtree() method.
>
> Is there a standard result processing layout for detecting issues  
> with the results?
>
> Instead of hunting and pecking for each of the possible error codes,  
> I was wondering if anyone has a template method which takes the  
> getSubtree results and translates issues to exceptions or at least  
> just have stub code with all the possible error conditions laid out.
>
> -Scott
> _______________________________________________
> SNMP4J mailing list
> [email protected]
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
>
> _______________________________________________
> SNMP4J mailing list
> [email protected]
> http://lists.agentpp.org/mailman/listinfo/snmp4j
_______________________________________________
SNMP4J mailing list
[email protected]
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to