!searchRange.isUpperIncluded(),
null, false);
AgentXNodeQuery query =
new AgentXNodeQuery(entry.getContext(), scope,
AgentXNodeQuery.QUERY_ALL);
MOScope requestScope = searchRange.getReferenceSubRequest().getScope();
MOServer server = getServer(entry.getContext());
for (ManagedObject node = server.lookup(query);
(node instanceof AgentXNode);
node = server.lookup(nextQuery(query, (AgentXNode)node)))
{
AgentXRegEntry activeReg = ((AgentXNode)node).getActiveRegistration();
MOScope region = node.getScope();
if ((activeReg != null) &&
(activeReg.getSession().equals(entry.getSession()))) {
if ((requestScope.getUpperBound() != null) &&
(requestScope.getUpperBound().
compareTo(region.getUpperBound()) <= 0)) {
searchRange.setUpperBound(requestScope.getUpperBound());
searchRange.setUpperIncluded(requestScope.isUpperIncluded());
break;
}
searchRange.setUpperBound(region.getUpperBound());
searchRange.setUpperIncluded(region.isUpperIncluded());
}
else {
if ((searchRange.getUpperBound() == null) ||
(searchRange.getUpperBound().compareTo(region.getLowerBound()) >= 0)) {
searchRange.setUpperBound(region.getLowerBound());
searchRange.setUpperIncluded(!region.isLowerIncluded());
}
break;
}
}
if (LOGGER.isDebugEnabled()) {