@Override public SnmpInstId unmarshal(String instance) throws Exception { return new SnmpInstId(instance); } }
public int toInt() { if (this.length() != 1) throw new IllegalStateException("Cannot convert "+this+" to an int"); return getLastSubId(); }
/** * <p>getInstance</p> * * @return a {@link java.lang.String} object. */ @Override public String getInstance() { return m_inst.toString(); }
/** * "Normally, the ifIndex value of the local interface. * For 802.3 Repeaters for which the repeater ports do not * have ifIndex values assigned, this value is a unique * value for the port, and greater than any ifIndex value * supported by the repeater; the specific port number in * this case, is given by the corresponding value of * cdpInterfacePort." * */ public Integer getCdpCacheIfIndex() { return getInstance().getSubIdAt(getInstance().length()-2); }
ipAddrs.add(new SnmpInstId(InetAddressUtils.toOid(addr))); ifIndices.add(new SnmpInstId(ifIndex)); m_ifTable.updateSnmpInterfaceData(node, ifIndex.toInt()); m_ifXTable.updateSnmpInterfaceData(node, ifIndex.toInt()); m_ipAddrTable.updateIpInterfaceData(node, ipAddr.toString());
/** * Gets the entity physical index. * * @return the entity physical index */ public int getEntPhysicalIndex() { return getInstance().getLastSubId(); }
/** {@inheritDoc} */ @Override protected IfXTableEntry createTableEntry(SnmpObjId base, SnmpInstId inst, Object val) { return new IfXTableEntry(inst.toInt()); }
/** * <p> * getDot1dTpFdbAddress * </p> * * @return a {@link java.lang.String} object. */ public String getDot1qTpFdbAddress() { int[] identifiers = getInstance().getIds(); if (identifiers.length != 7) { return null; } StringBuilder sb = new StringBuilder(); for (int i = identifiers.length - 6; i < identifiers.length; i++) { if (identifiers[i] >= 16) { sb.append(Integer.toHexString(identifiers[i])); } else { sb.append("0").append(Integer.toHexString(identifiers[i])); } } return sb.toString(); }
public Integer getLldpRemLocalPortNum() { return getInstance().getSubIdAt(1); }
ipAddrs.add(new SnmpInstId(InetAddressUtils.toOid(addr))); ifIndices.add(new SnmpInstId(ifIndex)); m_ifTable.updateSnmpInterfaceData(node, ifIndex.toInt()); m_ifXTable.updateSnmpInterfaceData(node, ifIndex.toInt()); m_ipAddrTable.updateIpInterfaceData(node, ipAddr.toString());
public Integer getVlanIndex() { return getInstance().getLastSubId(); }
/** {@inheritDoc} */ @Override public SnmpCollectionResource findResource(SnmpInstId inst) { return getIfMap().get(inst.toInt()); }
private Map<Integer, SortedSet<OnmsHwEntityAlias>> mapAliases(List<SnmpResult> results) { Map<Integer, SortedSet<OnmsHwEntityAlias>> aliases = new HashMap<>(); for (SnmpResult result : results) { int[] instance = result.getInstance().getIds(); int entAliasEntry = instance[0]; int entAliasIndex = instance[1]; SortedSet<OnmsHwEntityAlias> aliasSet = aliases.get(entAliasEntry); if (aliasSet == null) { aliasSet = new TreeSet<>(); aliases.put(entAliasEntry, aliasSet); } aliasSet.add(new OnmsHwEntityAlias(entAliasIndex, result.getValue().toString())); LOG.debug("result from entAliasMappingTable: found entry {} index: {} oid: {}", entAliasEntry, entAliasIndex, result.getValue()); } return aliases; }
public Integer getIsisCircIndex() { return getInstance().getSubIdAt(0); }
public static SnmpInstId[] convertToSnmpInstIds(String instances) { StringTokenizer tokenizer = new StringTokenizer(instances, ","); SnmpInstId[] insts = new SnmpInstId[tokenizer.countTokens()]; int index = 0; while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); SnmpInstId inst = new SnmpInstId(token); insts[index] = inst; index++; } return insts; }
@Override public String marshal(SnmpInstId snmpInstId) throws Exception { return snmpInstId.toString(); }
public int toInt() { if (this.length() != 1) throw new IllegalArgumentException("Cannot convert "+this+" to an int"); return getLastSubId(); }
public Integer getIsisISAdjIndex() { return getInstance().getLastSubId(); }