/** * Checks whether this {@code OID} can be BER encoded. * @return * {@code true} if size() >= 2 and size() <= 128 and if the first * two sub-identifiers are less than 3 and 40 respectively. */ public boolean isValid() { return ((size() >= 2) && (size() <= 128) && ((value[0] & 0xFFFFFFFFL) <= 2l) && ((value[1] & 0xFFFFFFFFL) < 40l)); }
/** * Checks whether this {@code OID} can be BER encoded. * * @return {@code true} if size() >= 2 and size() <= 128 and if the first * two sub-identifiers are less than 3 and 40 respectively. */ public boolean isValid() { return ((size() >= 2) && (size() <= 128) && ((value[0] & 0xFFFFFFFFL) <= 2l) && ((value[1] & 0xFFFFFFFFL) < 40l)); }
/** * Checks whether this <code>OID</code> can be BER encoded. * @return * <code>true</code> if size() >= 2 and size() <= 128 and if the first * two sub-identifiers are less than 3 and 40 respectively. */ public boolean isValid() { return ((size() >= 2) && (size() <= 128) && ((value[0] & 0xFFFFFFFFL) <= 2l) && ((value[1] & 0xFFFFFFFFL) < 40l)); }
private OID getCloneFromIndex(MOTableRow changeSet) { OID cloneFrom = (OID) changeSet.getValue(colUsmUserCloneFrom); if (cloneFrom == null) { cloneFrom = (OID) getValue(colUsmUserCloneFrom); } if ((cloneFrom == null) || (cloneFrom.size() <= usmUserEntryOID.size())) { return null; } return new OID(cloneFrom.getValue(), usmUserEntryOID.size()+1, cloneFrom.size() - (usmUserEntryOID.size()+1)); }
private static boolean checkIndexBytes(OID index, long start, long end) { if ((start < 0) || (start > MOTableIndex.MAX_INDEX_OID_LENGTH) || (end < 0) || (end > MOTableIndex.MAX_INDEX_OID_LENGTH)) { return false; } for (int i=(int)start; ((i<index.size()) && (i<end)); i++) { if (index.getUnsigned(i) > 255) { return false; } } return true; }
public final void fromSubIndex(OID subIndex, boolean impliedLength) { int offset = 1; if (impliedLength) { offset = 0; } setValue(subIndex.getValue(), offset, subIndex.size() - offset); }
public final void fromSubIndex(OID subIndex, boolean impliedLength) { int offset = 1; if (impliedLength) { offset = 0; } setValue(subIndex.getValue(), offset, subIndex.size()-offset); }
@Override public OID getLowerBound() { if (lowerBound == null) { lowerBound = new OID(oid.getValue(), 0, oid.size() - 1); } return lowerBound; }
public OID getLowerBound() { if (lowerBound == null) { lowerBound = new OID(oid.getValue(), 0, oid.size()-1); } return lowerBound; }
public final void fromSubIndex(OID subIndex, boolean impliedLength) { int offset = 1; if (impliedLength) { offset = 0; } setValue(subIndex.getValue(), offset, subIndex.size()-offset); }
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; }
public OID getUpperBound() { OID upperBound = new OID(oid); int lastID = oid.size() - 1; /** * This is not quite correct because we would have to search up the tree * if the last sub ID is 0xFFFFFFFF, but since a table OID must end on 1 * by SMI rules we should be on the safe side here. */ upperBound.set(lastID, oid.get(lastID) + 1); return upperBound; }
public void incrementCounter(CounterEvent event) { if ((event.getOid().startsWith(usmStatsPrefix)) && (event.getOid().size() > usmStatsPrefix.size())) { Counter32 current = (Counter32) usmStats[event.getOid().get(usmStatsPrefix.size())-1].getValue(); current.increment(); event.setCurrentValue((Counter32)current.clone()); } }
public void incrementCounter(CounterEvent event) { if ((event.getOid().startsWith(usmStatsPrefix)) && (event.getOid().size() > usmStatsPrefix.size())) { Counter32 current = (Counter32) usmStats[event.getOid().get(usmStatsPrefix.size())-1].getValue(); current.increment(); event.setCurrentValue((Counter32)current.clone()); } }
public void fromSubIndex(OID subIndex, boolean impliedLength) { if (impliedLength) { setValue(subIndex.toByteArray()); } else { OID suffix = new OID(subIndex.getValue(), 1, subIndex.size() - 1); setValue(suffix.toByteArray()); } }
public void fromSubIndex(OID subIndex, boolean impliedLength) { if (impliedLength) { setValue(subIndex.toByteArray()); } else { OID suffix = new OID(subIndex.getValue(), 1, subIndex.size() - 1); setValue(suffix.toByteArray()); } }