/** * Appends an unsigned long sub-identifier value to this OID. * * @param subID an unsigned long value less or equal to 2^32-1. * @return a pointer to this OID instance (useful for chaining). * @since 1.2 */ public final OID appendUnsigned(long subID) { return append((int) (subID & 0xFFFFFFFFL)); }
/** * Appends an unsigned long sub-identifier value to this OID. * @param subID * an unsigned long value less or equal to 2^32-1. * @return * a pointer to this OID instance (useful for chaining). * @since 1.2 */ public final OID appendUnsigned(long subID) { return append((int)(subID & 0xFFFFFFFFL)); }
/** * Appends a dotted String OID to this {@code OID}. * @param oid * a dotted String with numerical sub-identifiers. * @return * a pointer to this OID instance (useful for chaining). */ public final OID append(String oid) { OID suffix = new OID(oid); return append(suffix); }
/** * Appends a dotted String OID to this <code>OID</code>. * @param oid * a dotted String with numerical sub-identifiers. * @return * a pointer to this OID instance (useful for chaining). */ public final OID append(String oid) { OID suffix = new OID(oid); return append(suffix); }
/** * Appends a dotted String OID to this {@code OID}. * * @param oid a dotted String with numerical sub-identifiers. * @return a pointer to this OID instance (useful for chaining). */ public final OID append(String oid) { OID suffix = new OID(oid); return append(suffix); }
private static OID createViewIndex(OctetString viewName, OID subtree) { OID index = viewName.toSubIndex(false); index.append(subtree.toSubIndex(false)); return index; }
private static OID createViewIndex(OctetString viewName, OID subtree) { OID index = viewName.toSubIndex(false); index.append(subtree.toSubIndex(false)); return index; }
protected OID appendRawOids(OID oid, int[] integers) { if (oid == null) return new OID(integers); oid.append(new OID(integers)); return oid; }
public void put(String oid, Variable value) { OID oidKey = new OID(m_base); oidKey.append(oid); m_values.put(oidKey, value); }
private OID nextOID(OID requested) { OID next = new OID(requested); next.append(0); return next; }
public final OID toSubIndex(boolean impliedLength) { if (impliedLength) { return new OID(value); } OID subIndex = new OID(new int[]{size()}); subIndex.append(this); return subIndex; }
public final OID toSubIndex(boolean impliedLength) { if (impliedLength) { return new OID(value); } OID subIndex = new OID(new int[] { size() }); subIndex.append(this); return subIndex; }
private OID createIndex(OctetString engineID, OctetString userName) { if (engineID.length() == 0) { engineID = usm.getLocalEngineID(); } OID index = engineID.toSubIndex(false); index.append(userName.toSubIndex(false)); return index; }
private void addString(PDU pdu, OID prefix, int suffix, String val, boolean allowEmpty) { if (allowEmpty || !StringUtils.isEmpty(val)) { pdu.add(new VariableBinding(new OID(prefix).append(suffix), new OctetString(val == null ? "" : val))); } }
private VariableBinding buildCreateVariableBinding(Object entry) throws IllegalAccessException, SnmpAnnotationException { OID indexOid = pduBuilder.buildIndexOID(entry); checkIndexOid(indexOid); RowStatus rowStatus = entry.getClass().getAnnotation(RowStatus.class); checkRowStatusAnnotation(rowStatus); OID oid = new OID(rowStatus.oid()); oid.append(indexOid); Integer32 var = new Integer32(rowStatus.create()); return new VariableBinding(oid, var); }