public interface Mib
This interface defines methods for the essential aspects of a MIB commonly used in writing SNMP management applications.
Modifier and Type | Method and Description |
---|---|
Mib |
addDirectory(File directory)
Adds a directory to the MIB file search path.
|
MibTrapV1Support |
getV1TrapSupport()
Gets the SNMPv1 TRAP support provider.
|
Mib |
load(File file)
Loads a MIB module from given file.
|
Mib |
load(String moduleName)
Loads a named MIB module.
|
Mib |
load(URL location)
Loads a MIB module from given location.
|
String |
nameToOid(String name)
Converts an object name to the corresponding object identifier.
|
Formatter |
newFormatter(String oid)
Gets a new
Formatter appropriate for the object type represented
by the given object identifier |
IndexExtractor |
newIndexExtractor(String oid)
Gets a new
IndexExtractor appropriate for the table column
object represented by the given object identifier. |
String |
oidToInstanceName(String oid)
Converts an object identifier string to the corresponding
instance-qualified object name.
|
String |
oidToObjectName(String oid)
Converts an object identifier string to the corresponding MIB object name.
|
Mib |
removeDirectory(File directory)
Removes a directory from the MIB file search path.
|
int |
syntaxForObject(String oid)
Gets the SMI syntax indicator for the given object identifier.
|
String nameToOid(String name)
If the name is suffixed by an instance identifier, the instance identifier is appended to the returned object identifier. For example, given the name "sysName.0", this method returns 1.3.6.1.2.1.1.5.0, the OID for the singleton instance of the "sysName" object.
When searching the MIB for the given name, all currently loaded MIB modules are searched, in the reverse of the order in which they were loaded. The specified name may be optionally prefixed by a MIB module name followed by the '!' character (e.g. "RFC1213-MIB!sysName.0") in order to constrain the search to a specific MIB module.
name
- name to convertNameNotFoundException
- if name
cannot be resolved to
an object identifierString oidToInstanceName(String oid)
This method is the logical inverse of nameToOid(String)
. It
returns the object name, suffixed by the object instance identifier.
For example, given the 1.3.6.1.2.1.1.5.0 (the OID for the singleton
instance of the "sysName" object), this method returns "sysName.0"
oid
- the object identifier to convertoid
.String oidToObjectName(String oid)
This method simply determines the MIB name associated with the given object identifier (ignoring any instance identifier). For example, given 1.3.6.1.2.1.1.5.0 (the OID for the singleton instance of the "sysName" object), this method returns "sysName"
oid
- the object identifier to convertoid
.int syntaxForObject(String oid)
oid
- OID of an OBJECT-TYPE (or a subordinate)IllegalArgumentException
- if oid
does not refer to
an an OBJECT-TYPE or subordinateFormatter newFormatter(String oid)
Formatter
appropriate for the object type represented
by the given object identifieroid
- object identifiernull
)IndexExtractor newIndexExtractor(String oid)
IndexExtractor
appropriate for the table column
object represented by the given object identifier.oid
- identifier of a table column objectnull
)IllegalArgumentException
- if the oid
does not represent
a (known) table columnMibTrapV1Support getV1TrapSupport() throws MibException
MibException
Mib addDirectory(File directory)
directory
- the directory to addMib removeDirectory(File directory)
directory
- the directory to removeMib load(String moduleName) throws ModuleParseException, IOException
moduleName
- name of the MIB module to loadModuleParseException
- if the specified MIB module cannot be parsedIOException
Mib load(URL location) throws ModuleParseException, IOException
location
- location of the MIB moduleModuleParseException
- if the resource at location
cannot
be parsed as a MIBModuleParseException
- if the specified MIB module cannot be parsedIOException
Mib load(File file) throws ModuleParseException, IOException
file
- file to loadModuleParseException
- if the specified MIB module cannot be parsedIOException
Copyright © 2012–2015. All rights reserved.