@Override public void rowCompleted(SnmpRowResult result) { hostResults.put(result.getInstance(), result.getValue(groupStateOid)); } };
@Override public SnmpRowResult createRowResult(int columnCount, SnmpInstId instance) { return new SnmpRowResult(columnCount, instance); }
@Override public boolean equals(Object obj) { if (obj instanceof SnmpRowResult) { SnmpRowResult other = (SnmpRowResult) obj; return new EqualsBuilder() .append(getResults(), other.getResults()) .isEquals(); } return false; }
void handleCompleteRows() { SnmpInstId lastInstance = null; for (SnmpRowResult row : m_pendingData.values()) { if (row.isComplete(m_finishedColumns.toArray(new SnmpObjId[m_finishedColumns.size()]))) { lastInstance = row.getInstance(); } } if (lastInstance != null || isFinished()) { Iterator<SnmpInstId> i = m_pendingData.keySet().iterator(); while (i.hasNext()) { SnmpInstId key = i.next(); m_callback.rowCompleted(m_pendingData.get(key)); i.remove(); if (key.equals(lastInstance)) { break; } } } }
void storeResult(SnmpResult result) { SnmpInstId instId = result.getInstance(); if ( !m_pendingData.containsKey( instId ) ) { m_pendingData.put( instId, m_rowResultFactory.createRowResult( getColumnCount(), instId ) ); } SnmpRowResult row = m_pendingData.get( instId ); row.addResult( result.getBase(), result ); handleCompleteRows(); }
public void addResult(SnmpObjId column, SnmpResult result) { assertTrue(m_instance.equals(result.getInstance()), "unexpected result %s passed to row with instance %s", result, m_instance); m_results.put(column, result); }
void handleCompleteRows() { SnmpInstId lastInstance = null; for (SnmpRowResult row : m_pendingData.values()) { if (row.isComplete(m_finishedColumns.toArray(new SnmpObjId[m_finishedColumns.size()]))) { lastInstance = row.getInstance(); } } if (lastInstance != null || isFinished()) { Iterator<SnmpInstId> i = m_pendingData.keySet().iterator(); while (i.hasNext()) { final SnmpInstId key = i.next(); final SnmpRowResult pendingData = m_pendingData.get(key); try { m_callback.rowCompleted(pendingData); } catch (final Exception e) { LOG.warn("Failed to handle completed SNMP table row {}: {}", key, pendingData, e); } i.remove(); if (key.equals(lastInstance)) { break; } } } }
/** * @param result */ void storeResult(SnmpResult result) { SnmpInstId instId = result.getInstance(); if ( !m_pendingData.containsKey( instId ) ) { m_pendingData.put( instId, m_rowResultFactory.createRowResult( getColumnCount(), instId ) ); } SnmpRowResult row = m_pendingData.get( instId ); row.addResult( result.getBase(), result ); handleCompleteRows(); }
@Override public void rowCompleted(SnmpRowResult result) { nameResults.put(result.getInstance(), result.getValue(serviceNameOidId)); statusResults.put(result.getInstance(), result.getValue(serviceStatusOidId)); } };
@Override public int hashCode() { return new HashCodeBuilder() .append(getResults()) .toHashCode(); }
public SnmpRowResult createRowResult(int columnCount, SnmpInstId instance) { return new SnmpRowResult(columnCount, instance); }
@Override public void rowCompleted(SnmpRowResult row) { // the default implementation just forwards this to the super class // like the defaults for other CollectionTrackers except this does it // from the rowCompleted method rather than from storeResult for(SnmpResult result : row.getResults()) { super.storeResult(result); } }
public void rowCompleted(SnmpRowResult row) { // the default implementation just forwards this to the super class // like the defaults for other CollectionTrackers except this does it // from the rowCompleted method rather than from storeResult for(SnmpResult result : row.getResults()) { super.storeResult(result); } }
public int compareTo(SnmpRowResult other) { return new CompareToBuilder() .append(getResults(), other.getResults()) .toComparison(); }
/** * @param base * @return */ public SnmpValue getValue(SnmpObjId base) { for(SnmpResult result : getResults()) { if (base.equals(result.getBase())) { return result.getValue(); } } return null; }
/** * @param base * @return */ public SnmpValue getValue(SnmpObjId base) { for(SnmpResult result : getResults()) { if (base.equals(result.getBase())) { return result.getValue(); } } return null; } }