public Object getLink(OID oid) { if (links != null) { OID searchOID = new OID(oid); Object result = null; while ((searchOID.size() > 0) && ((result = links.get(searchOID)) == null)) { searchOID.trim(1); } return result; } return null; }
@Override public Object getLink(OID oid) { if (links != null) { OID searchOID = new OID(oid); Object result = null; while ((searchOID.size() > 0) && ((result = links.get(searchOID)) == null)) { searchOID.trim(1); } return result; } return null; }
@Override public Map<OID, Object> getNewSampleValuesConnected(SnmpConnection cnx) { Map<OID, Object> retValue = null; Set<OID> oids = getOidSet(); if(oids != null) { try { Map<OID, Object> rawValues = requester.doSnmpGet(cnx, oids); retValue = new HashMap<OID, Object>(rawValues.size()); for(Map.Entry<OID, Object> e: rawValues.entrySet()) { OID oid = new OID(e.getKey()); oid.trim(getSuffixLength()); retValue.put(oid, e.getValue()); } } catch (IOException e) { log(Level.ERROR, e, "IO Error: %s", e.getMessage()); } } return retValue; }
tables.add(coid.trim());
tables.add(coid.trim());
private boolean checkLimits(MOTableRowEvent event) { int limit = maxNumRows; if ((limits != null) && (!limits.isEmpty())) { OID search = new OID(event.getTable().getOID()); while (search.size() > 0) { Integer l = (Integer) limits.get(search); if (l != null) { limit = l.intValue(); break; } else { search.trim(1); } } } int currentSize = 0; if (limit > 0) { currentSize = event.getTable().getModel().getRowCount(); if (currentSize >= limit) { // remove eldest return removeEldest(event, (currentSize - limit) + 1); } } return ((limit <= 0) || (currentSize < limit)); }
private boolean checkLimits(MOTableRowEvent<R> event) { int limit = maxNumRows; if ((limits != null) && (!limits.isEmpty())) { OID search = new OID(event.getTable().getOID()); while (search.size() > 0) { Integer l = limits.get(search); if (l != null) { limit = l; break; } else { search.trim(1); } } } int currentSize = 0; if (limit > 0) { currentSize = event.getTable().getModel().getRowCount(); if (currentSize >= limit) { // remove eldest return removeEldest(event, (currentSize - limit) + 1); } } return (limit <= 0); }
OID sk = new OID(k.getValue(), 0, k.size()-1); while ((sk.size() > 0) && (roots.get(sk) == null)) { sk.trim(1);
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);
/** * 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 = 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; }
ageOut * 6000) { NlmStatsLogEntryRow statsRow = (NlmStatsLogEntryRow) nlmStatsLogEntryModel.getRow(row.getIndex().trim()); if (statsRow != null) { statsRow.getNlmStatsLogNotificationsBumped().increment();
private void deleteLogRows(long limit, OctetString profileName) { long delta = nlmLogEntry.getModel().getRowCount() - limit; if (delta > 0) { synchronized (nlmLogEntries) { for (int i=0; (i<delta) && (nlmLogEntries.size()>0); i++) { OID firstIndex = (OID) nlmLogEntries.remove(0); if (firstIndex != null) { nlmLogEntry.removeRow(firstIndex); ((DefaultMOMutableTableModel) nlmLogVariableEntryModel).removeRows(firstIndex, firstIndex.nextPeer()); NlmStatsLogEntryRow statsRow = (NlmStatsLogEntryRow) nlmStatsLogEntryModel.getRow(firstIndex.trim()); if (statsRow != null) { statsRow.getNlmStatsLogNotificationsBumped().increment(); } ((Counter32)nlmStatsGlobalNotificationsBumped.getValue()).increment(); if (profileName != null) { NlmStatsLogEntryRow profile = (NlmStatsLogEntryRow) nlmStatsLogEntry.getModel().getRow(profileName.toSubIndex(false)); if (profile != null) { profile.getNlmStatsLogNotificationsBumped().increment(); } } } } } } }
private void deleteLogRows(long limit, OctetString profileName) { long delta = nlmLogEntry.getModel().getRowCount() - limit; if (delta > 0) { synchronized (nlmLogEntries) { for (int i=0; (i<delta) && (nlmLogEntries.size()>0); i++) { OID firstIndex = nlmLogEntries.remove(0); if (firstIndex != null) { nlmLogEntry.removeRow(firstIndex); ((DefaultMOMutableTableModel) nlmLogVariableEntryModel).removeRows(firstIndex, firstIndex.nextPeer()); NlmStatsLogEntryRow statsRow = (NlmStatsLogEntryRow) nlmStatsLogEntryModel.getRow(firstIndex.trim()); if (statsRow != null) { statsRow.getNlmStatsLogNotificationsBumped().increment(); } ((Counter32)nlmStatsGlobalNotificationsBumped.getValue()).increment(); if (profileName != null) { NlmStatsLogEntryRow profile = (NlmStatsLogEntryRow) nlmStatsLogEntry.getModel().getRow(profileName.toSubIndex(false)); if (profile != null) { profile.getNlmStatsLogNotificationsBumped().increment(); } } } } } } }
OID sk = new OID(k.getValue(), 0, k.size() - 1); while ((sk.size() > 0) && (roots.get(sk) == null)) { sk.trim(1);
if (uptime.getValue() - row.getNlmLogTime().getValue() > ageOut * 6000) { NlmStatsLogEntryRow statsRow = nlmStatsLogEntryModel.getRow(row.getIndex().trim()); if (statsRow != null) { statsRow.getNlmStatsLogNotificationsBumped().increment();
targetV1.setSpecificTrap(trapOID.get(trapOID.size() - 1)); OID enterprise = new OID(trapOID); enterprise.trim(2); targetV1.setEnterprise(enterprise); } else if (trapOID.size() > 1) { targetV1.setSpecificTrap(trapOID.get(trapOID.size() - 1)); OID enterprise = new OID(trapOID); enterprise.trim(1); targetV1.setEnterprise(enterprise);