Architecture - Object Identifier
The class discussed here is
org.friendlysnmp.FID or for short
FriendlySNMP API deals with objects declared in a MIB.
These objects are often named nodes because they could be viewed
as nodes and leaves in the MIB tree. Each node in this tree has a unique
identifier. This identifier is a sequence of integers on the path
leading from the root of the tree to a named object.
Three fundamental node objects exposed by FriendlySNMP are
Each of them is referred by node object identifier
FID class is an immutable wrapper which hides
internally used object of the
class or for short
OID from SNMP4J package.
OID class is a powerful and convenient to use class
but it has a catch for a developer. This class is mutable.
It is very easy for developer to accidentally modify OID value
in an object of this class.
org.friendlysnmp.FID is safe.
It gives a developer access
to a copy of an internal OID value thus preserving original OID value intact.
org.friendlysnmp.FID has another friendly feature
which extends OID functionality: a node name. Consider example when you
display a message or log event in the form:
The scalar 220.127.116.11.4.1.29091.10.2.1.3 has a new value.
This extremely not user friendly message is not easy to comprehend.
The same message could use a scalar name in user friendly form:
The scalar imageSize has a new value.
It is a developer's choice
FID value to use in the message, OID or name or both.