Package org.netxms.client.snmp
Class SnmpObjectId
java.lang.Object
org.netxms.client.snmp.SnmpObjectId
This class represents SNMP Object Id (OID)
- 
Constructor SummaryConstructorsConstructorDescriptionCreate empty OIDSnmpObjectId(long[] value) Create OID from array of OID elementsSnmpObjectId(SnmpObjectId parent, long id) Create child OID - add given value at the end of parent OID.
- 
Method SummaryModifier and TypeMethodDescriptionintcompareTo(SnmpObjectId oid) Compare two object identifiers.booleanlonggetIdFromPos(int pos) Get part of object ID from given position.intGet object identifier length.inthashCode()static SnmpObjectIdParse string argument as SNMP OID.voidsetNXCPVariable(NXCPMessage msg, long varId) Set NXCP variable to OID's valuebooleanstartsWith(SnmpObjectId oid) Check if this object id starts with given object id.subId(int length) Create sub ID of given length.toString()
- 
Constructor Details- 
SnmpObjectIdpublic SnmpObjectId()Create empty OID
- 
SnmpObjectIdpublic SnmpObjectId(long[] value) Create OID from array of OID elements- Parameters:
- value- OID elements
 
- 
SnmpObjectIdCreate child OID - add given value at the end of parent OID.- Parameters:
- parent- parent OID
- id- id
 
 
- 
- 
Method Details- 
parseSnmpObjectIdParse string argument as SNMP OID. Expected to be ion format .n.n.n.n.n- Parameters:
- s- string to parse
- Returns:
- SNMP OID object
- Throws:
- SnmpObjectIdFormatException- when string passed is not a valid SNMP OID
 
- 
getLengthpublic int getLength()Get object identifier length.- Returns:
- OID length
 
- 
setNXCPVariableSet NXCP variable to OID's value- Parameters:
- msg- NXCP message
- varId- Variable ID
 
- 
startsWithCheck if this object id starts with given object id.- Parameters:
- oid- Object id to check
- Returns:
- true if this object id starts with given object id
 
- 
compareToCompare two object identifiers. The return value is -1 if this object identifier is less than given object identifier, 0 if they are equal, and 1 if this object identifier is greater then given object identifier.- Parameters:
- oid- object identifier to compare with
- Returns:
- -1, 0, or 1 (see above for details)
 
- 
getIdFromPospublic long getIdFromPos(int pos) Get part of object ID from given position.- Parameters:
- pos- position
- Returns:
- part of object id from given position or -1 if position is invalid
 
- 
subIdCreate sub ID of given length.- Parameters:
- length- sub ID length
- Returns:
- sub ID object
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-