/** * Returns the predecessor OID for this OID. * * @return if this OID ends on 0, then a {@link #MAX_OID_LEN} * sub-identifier OID is returned where each sub-ID for index greater * or equal to {@link #size()} is set to {@link #MAX_SUBID_VALUE}. * @since 1.7 */ public final OID predecessor() { if (last() != 0) { int[] pval = new int[MAX_OID_LEN]; System.arraycopy(value, 0, pval, 0, value.length); Arrays.fill(pval, value.length, pval.length, MAX_SUBID_VALUE); OID pred = new OID(pval); pred.set(size() - 1, last() - 1); return pred; } else { OID pred = new OID(this); pred.removeLast(); return pred; } }
vbs.add(vbLower); OID lastOID = new OID(st.nextToken()); long last = lastOID.last(); long first = vbLower.getOid().lastUnsigned(); for (long k = first + 1; k <= last; k++) {
/** * Returns the predecessor OID for this OID. * @return * if this OID ends on 0, then a {@link #MAX_OID_LEN} * sub-identifier OID is returned where each sub-ID for index greater * or equal to {@link #size()} is set to {@link #MAX_SUBID_VALUE}. * @since 1.7 */ public final OID predecessor() { if (last() != 0) { int[] pval = new int[MAX_OID_LEN]; System.arraycopy(value, 0, pval, 0, value.length); Arrays.fill(pval, value.length, pval.length, MAX_SUBID_VALUE); OID pred = new OID(pval); pred.set(size()-1, last()-1); return pred; } else { OID pred = new OID(this); pred.removeLast(); return pred; } }
/** * Returns the predecessor OID for this OID. * @return * if this OID ends on 0, then a {@link #MAX_OID_LEN} * sub-identifier OID is returned where each sub-ID for index greater * or equal to {@link #size()} is set to {@link #MAX_SUBID_VALUE}. * @since 1.7 */ public final OID predecessor() { if (last() != 0) { int[] pval = new int[MAX_OID_LEN]; System.arraycopy(value, 0, pval, 0, value.length); Arrays.fill(pval, value.length, pval.length, MAX_SUBID_VALUE); OID pred = new OID(pval); pred.set(size()-1, last()-1); return pred; } else { OID pred = new OID(this); pred.removeLast(); return pred; } }
public Collection<int[]> getProcsOID() { boolean found = false; Collection<OID> soidSet = getIndexSet(); Collection<int[]> oids = new HashSet<int[]>(); TabularIterator ti = new TabularIterator(getConnection(), soidSet); for(SnmpVars s: ti) { List<OID> lk = new ArrayList<OID>(s.keySet()); Collections.sort(lk); StringBuilder cmdBuf = new StringBuilder(); for(OID oid: lk) { cmdBuf.append(s.get(oid)); cmdBuf.append(' '); } if(pattern.matcher(cmdBuf.toString().trim()).matches()) { int[] index = new int[1]; index[0] = lk.get(0).last(); oids.add(index); found = true; } } if(!found) { log(Level.ERROR, "index for %s not found for host %s", indexKey, getHost().getName()); oids = Collections.emptySet(); } else { log(Level.DEBUG, "found %d processes", oids.size()); log(Level.TRACE, "processes indexes found: %s", oids); } return oids; }
/** * Returns the next following OID with the same or lesser size (length). * @return OID * the next OID on the same or upper level or a clone of this OID, if * it has a zero length or is 2^32-1. * @since 1.7 */ public final OID nextPeer() { OID next = new OID(this); if ((next.size() > 0) && (last() != MAX_SUBID_VALUE)) { next.set(next.size()-1, last()+1); } else if (next.size() > 1) { next.trim(1); next = next.nextPeer(); } return next; }
/** * Returns the next following OID with the same or lesser size (length). * @return OID * the next OID on the same or upper level or a clone of this OID, if * it has a zero length or is 2^32-1. * @since 1.7 */ public final OID nextPeer() { OID next = new OID(this); if ((next.size() > 0) && (last() != MAX_SUBID_VALUE)) { next.set(next.size()-1, last()+1); } else if (next.size() > 1) { next.trim(1); next = nextPeer(); } return next; }
/** * Returns the next following OID with the same or lesser size (length). * * @return OID * the next OID on the same or upper level or a clone of this OID, if * it has a zero length or is 2^32-1. * @since 1.7 */ public final OID nextPeer() { OID next = new OID(this); if ((next.size() > 0) && (last() != MAX_SUBID_VALUE)) { next.set(next.size() - 1, last() + 1); } else if (next.size() > 1) { next.trim(1); next = next.nextPeer(); } return next; }
if(roid.last() != 0) { nextOid = tableMapper.getNextTable(roid); if(nextOid != null) {
if(roid.last() != 0) { nextOid = tableMapper.getNextTable(roid); if(nextOid != null) {
log.info("snmpReceivedSet: attempt to set a non-existent instance: " + oid.last() + " of object: " + oid.trim(), e); undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.noCreation);
log.info("snmpReceivedSet: attempt to set a non-existent instance: " + oid.last() + " of object: " + oid.trim(), e); undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.noCreation);
(nlmLogEntryModel.lastIndex().last() >= nextLogIndex)) { nextLogIndex++;
(nlmLogEntryModel.lastIndex().last() >= nextLogIndex)) { nextLogIndex++;
if (vb.getVariable() instanceof Counter64) { OID nextOID = new OID(vb.getOid()); if (nextOID.last() < 65535) { nextOID.set(nextOID.size() - 1, 65535); } else {
if (vb.getVariable() instanceof Counter64) { OID nextOID = new OID(vb.getOid()); if (nextOID.last() < 65535) { nextOID.set(nextOID.size()-1, 65535);
trap.setEnterprise(enterprise); trap.setSpecificTrap(notificationID.last());
trap.setEnterprise(enterprise); trap.setSpecificTrap(notificationID.last());