@Override protected void storeResult(SnmpResult res) { results.put(res.getInstance(), res.getValue()); } })) {
public void addResult(SnmpObjId column, SnmpResult result) { Assert.isTrue(m_instance.equals(result.getInstance()), "unexpected result "+result+" passed to row with instance "+m_instance); m_results.put(column, result); }
@Override protected void storeResult(SnmpResult res) { results.put(res.getInstance(), res.getValue()); }
/** {@inheritDoc} */ @Override protected void storeResult(SnmpResult res) { T entry = m_results.get(res.getInstance()); if (entry == null) { entry = createTableEntry(res.getBase(), res.getInstance(), res.getValue()); m_results.put(res.getInstance(), entry); } entry.storeResult(res); }
/** {@inheritDoc} */ @Override protected void storeResult(SnmpResult res) { T entry = m_results.get(res.getInstance()); if (entry == null) { entry = createTableEntry(res.getBase(), res.getInstance(), res.getValue()); m_results.put(res.getInstance(), entry); } entry.storeResult(res); }
/** {@inheritDoc} */ @Override protected void storeResult(SnmpResult res) { T entry = m_results.get(res.getInstance()); if (entry == null) { entry = createTableEntry(res.getBase(), res.getInstance(), res.getValue()); m_results.put(res.getInstance(), entry); } entry.storeResult(res); }
@Override public int hashCode() { return new HashCodeBuilder() .append(getBase()) .append(getInstance()) .append(getValue()) .toHashCode(); } }
@Override public String toString() { return new ToStringBuilder(this) .append("base", getBase()) .append("instance", getInstance()) .append("value", getValue()) .toString(); }
@Override public boolean equals(Object obj) { if (obj instanceof SnmpResult) { SnmpResult other = (SnmpResult) obj; return new EqualsBuilder() .append(getBase(), other.getBase()) .append(getInstance(), other.getInstance()) .append(getValue(), other.getValue()) .isEquals(); } return false; }
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); }
@Override public void handleWalkResponses(List<WalkResponse> responses) { // Store the result responses.stream() .flatMap(res -> res.getResults().stream()) .filter(res -> m_oid.equals(SnmpObjId.get(res.getBase(), res.getInstance()))) .forEach(this::storeResult); setFinished(true); } }
public SnmpObjId getAbsoluteInstance() { return getBase().append(getInstance()); }
public SnmpObjId getAbsoluteInstance() { return getBase().append(getInstance()); }
@Override public void handleWalkResponses(List<WalkResponse> responses) { // Store the result responses.stream() .flatMap(res -> res.getResults().stream()) .filter(res -> { SnmpObjId responseOid = SnmpObjId.get(res.getBase(), res.getInstance()); return m_base.isPrefixOf(responseOid) && !m_base.equals(responseOid); }) .forEach(this::storeResult); setFinished(true); } }
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(); }
/** * This is a hack, we get the IP address from the instance information when storing one of the columns. :P */ @Override public void storeResult(final SnmpResult result) { final int[] instanceIds = result.getInstance().getIds(); final int addressType = instanceIds[1]; if (addressType == IPAddressTableTracker.TYPE_IPV4 || addressType == IPAddressTableTracker.TYPE_IPV6 || addressType == IPAddressTableTracker.TYPE_IPV6Z) { m_inetAddress = InetAddressUtils.getInetAddress(instanceIds, 2, addressType); } else { LOG.warn("Unable to determine IP address type ({})", addressType); } super.storeResult(result); } }
/** * @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(); }
/** {@inheritDoc} */ @Override protected void storeResult(SnmpResult res) { if(res.getBase().toString().equals(AbstractSnmpCollector.IFALIAS_OID) && (res.getValue().isNull() || res.getValue().toDisplayString() == null || res.getValue().toDisplayString().equals(""))) { LOG.debug("Skipping storeResult. Null or zero length ifAlias"); return; } SNMPCollectorEntry entry = m_results.get(res.getInstance()); if (entry == null) { LOG.debug("Creating new SNMPCollectorEntry entry"); entry = new SNMPCollectorEntry(m_objList, m_collectionSet); m_results.put(res.getInstance(), entry); } entry.storeResult(res); }
public int compareTo(SnmpResult other) { return new CompareToBuilder() .append(getBase(), other.getBase()) .append(getInstance(), other.getInstance()) .append(getValue(), other.getValue()) .toComparison(); }
@Override public String toString() { return new ToStringBuilder(this) .append("base", getBase()) .append("instance", getInstance()) .append("value", getValue()) .toString(); }