CollectionTracker childTracker = m_children[i]; if (!childTracker.isFinished()) { ChildTrackerPduBuilder childBuilder = new ChildTrackerPduBuilder(maxVars-count); ResponseProcessor rp = childTracker.buildNextPdu(childBuilder); childBuilder.setResponseProcessor(rp); builders.add(childBuilder); count += childBuilder.size(); childBuilder.setNonRepeaterStartIndex(nonRepeaters); childBuilder.addNonRepeaters(parentBuilder); nonRepeaters += childBuilder.getNonRepeaters(); int repeaters = 0; for (ChildTrackerPduBuilder childBuilder : builders) { childBuilder.setRepeaterStartIndex(nonRepeaters+repeaters); childBuilder.addRepeaters(parentBuilder); maxRepititions = Math.min(maxRepititions, childBuilder.getMaxRepititions()); repeaters += childBuilder.getRepeaters();
public int getChildIndex(int canonicalIndex) { if (isNonRepeater(canonicalIndex)) { return canonicalIndex - getNonRepeaterStartIndex(); } if (isRepeater(canonicalIndex)) { return canonicalIndex - getRepeaterStartIndex(); } throw new IllegalArgumentException("index out of range for tracker "+this); } }
CollectionTracker childTracker = m_children[i]; if (!childTracker.isFinished()) { ChildTrackerPduBuilder childBuilder = new ChildTrackerPduBuilder(maxVars-count); ResponseProcessor rp = childTracker.buildNextPdu(childBuilder); childBuilder.setResponseProcessor(rp); builders.add(childBuilder); count += childBuilder.size(); childBuilder.setNonRepeaterStartIndex(nonRepeaters); childBuilder.addNonRepeaters(parentBuilder); nonRepeaters += childBuilder.getNonRepeaters(); int repeaters = 0; for (ChildTrackerPduBuilder childBuilder : builders) { childBuilder.setRepeaterStartIndex(nonRepeaters+repeaters); childBuilder.addRepeaters(parentBuilder); maxRepititions = Math.min(maxRepititions, childBuilder.getMaxRepititions()); repeaters += childBuilder.getRepeaters();
boolean isRepeater(int canonicalIndex) { return getRepeaterStartIndex() <= canonicalIndex && canonicalIndex < getRepeaterStartIndex()+getRepeaters(); }
public boolean hasRepeaters() { return getNonRepeaters() < size(); }
boolean isNonRepeater(int canonicalIndex) { return getNonRepeaterStartIndex() <= canonicalIndex && canonicalIndex < getNonRepeaterStartIndex() + getNonRepeaters(); }
public int getRepeaters() { return size() - getNonRepeaters(); }
public void processResponse(SnmpObjId snmpObjId, SnmpValue val) { ChildTrackerPduBuilder childBuilder = getChildBuilder(m_currResponseIndex++); childBuilder.getResponseProcessor().processResponse(snmpObjId, val); }
boolean isNonRepeater(int canonicalIndex) { return getNonRepeaterStartIndex() <= canonicalIndex && canonicalIndex < getNonRepeaterStartIndex() + getNonRepeaters(); }
boolean isRepeater(int canonicalIndex) { return getRepeaterStartIndex() <= canonicalIndex && canonicalIndex < getRepeaterStartIndex()+getRepeaters(); }
public int getRepeaters() { return size() - getNonRepeaters(); }
public boolean processChildError(int errorStatus, int errorIndex) { int canonicalIndex = getCanonicalIndex(errorIndex-1); ChildTrackerPduBuilder childBuilder = getChildBuilder(canonicalIndex); int childIndex = childBuilder.getChildIndex(canonicalIndex); return childBuilder.getResponseProcessor().processErrors(errorStatus, childIndex+1); }
public boolean hasRepeaters() { return getNonRepeaters() < size(); }
public boolean processChildError(int errorStatus, int errorIndex) throws SnmpException { int canonicalIndex = getCanonicalIndex(errorIndex-1); ChildTrackerPduBuilder childBuilder = getChildBuilder(canonicalIndex); int childIndex = childBuilder.getChildIndex(canonicalIndex); return childBuilder.getResponseProcessor().processErrors(errorStatus, childIndex+1); }
@Override public void processResponse(SnmpObjId snmpObjId, SnmpValue val) throws SnmpException { ChildTrackerPduBuilder childBuilder = getChildBuilder(m_currResponseIndex++); childBuilder.getResponseProcessor().processResponse(snmpObjId, val); }
public int getChildIndex(int canonicalIndex) throws SnmpException { if (isNonRepeater(canonicalIndex)) { return canonicalIndex - getNonRepeaterStartIndex(); } if (isRepeater(canonicalIndex)) { return canonicalIndex - getRepeaterStartIndex() + getNonRepeaters(); } throw new SnmpException("index out of range for tracker "+this); } }