entry.addEntry(pending);
}
public synchronized boolean add(AgentXSearchRange searchRange,
AgentXRegEntry entry, boolean repeater) {
SnmpRequest request =
(SnmpRequest) searchRange.getReferenceSubRequest().getRequest();
AgentXPendingGet pending =
(AgentXPendingGet) get(entry.getSession().getSessionID(),
request.getTransactionID());
if (pending == null) {
// optimize upper bound if server is set
if ((servers != null) &&
(request.getInitiatingEvent().getPDU().getType() == PDU.GETBULK)) {
optimizeSearchRange(searchRange, entry);
}
pending = new AgentXPendingGet(entry, request, searchRange);
insertIntoQueue(request.getTransactionID(), pending);
}
else if (pending.isPending()) {
switch (request.getInitiatingEvent().getPDU().getType()) {
case PDU.GETBULK: {
for (Iterator it = pending.getSearchRanges().iterator(); it.hasNext();) {
AgentXSearchRange psr = (AgentXSearchRange) it.next();
if ((searchRange.getReferenceSubRequest().getIndex() -
psr.getReferenceSubRequest().getIndex()) %
request.getRepeaterCount() == 0) {
// this is a repetitions -> ignore it this time and send out
// AgentX request
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Repetition not added because of pending AgentX"+
" processing of "+pending+" and repetition "+psr);