|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The MibOperations RMI interface provides remote MIB support via RMI for RMI clients using the SNMP libraries. It enables using information in MIB modules to support SNMP operations.
Use the methods of this class to remotely load MIBs and perform remote MIB related operations. Once a MIB is loaded on the server, it will be available until the server is shutdown. Clients need not load the MIBs again the next time the client is used.
| Method Summary | |
void |
addChecks(byte[] checks,
byte parsingLevel)
|
void |
addLabel(java.lang.String addLabel)
To add label which should not be treated as a reserved word by the parser. |
void |
createCompiledMibs(java.lang.String mibs)
This method is used to create compiled mibs namely the cmi and cds files. |
SnmpVarBind |
createVariableBinding(java.lang.String varName,
java.lang.String[] indexes,
java.lang.String value)
Create an SnmpVarBind instance with supplied parameters. |
void |
enableDisplayHint(boolean flag)
|
byte[] |
getChecks(byte parsingLevel)
|
java.util.Vector |
getErrorMessages(java.lang.String module)
Returns Vector of MibErrorMessages object for the module specified. |
java.util.Vector |
getErrorModuleNames()
Returns the names of modules which are having parsing errors. |
java.lang.String |
getErrorString(SnmpPDU pdu)
For display or printing, this method returns detailed error information on the PDU, including any errored variable bindings using information from the loaded MIBs. |
byte |
getImportsParsingLevel()
|
java.lang.String |
getInstanceString(SnmpOID oid)
Get the Instance portion of OID as a String, e.g, ".0" for a scalar. |
java.lang.String |
getInstanceString(SnmpOID oid,
MibNode node)
Get the Instance portion of OID as a String, e.g, ".0" for a scalar. |
LeafSyntax |
getLeafSyntax(SnmpOID oid)
This does a search of all MIB modules and returns the syntax for this SnmpOID instance if found and is a leaf node |
MibModule |
getMibModule(MibNode node)
Get the first MIB Module that contains the specified MibNode. |
MibModule |
getMibModule(java.lang.String name)
Get a MIB Module from list of already loaded MIBs. |
java.util.Enumeration |
getMibModuleNames()
Deprecated. Instead use getModuleNames() method. |
java.util.Enumeration |
getMibModules()
Deprecated. Instead use getModules() method. |
MibNode |
getMibNode(SnmpOID oid)
This does a search of all MIB modules and gets the MibNode for this SnmpOID instance if found |
MibNode |
getMibNode(java.lang.String nodeLabel)
Returns MibNode Object corresponding to the node . |
MibNode |
getMibNode(java.lang.String nodeLabel,
java.lang.String mib)
Returns MibNode Object corresponding to the node in a specific MIB. |
MibNode |
getMibNode(java.util.Vector oid)
Return the MibNode per the Vector of Strings OID argument. |
MibTrap |
getMibTrap(SnmpOID enterprise,
int genericType,
int specificType)
Get the trap definition matching the given enterprise, generic type and specific type values. |
java.lang.String |
getModuleNameDefinition(java.lang.String file)
This method lets you know the module name contained in the file. |
java.util.Vector |
getModuleNames()
Returns a Vector containing the MibModule names loaded in this instance. |
java.util.Vector |
getModules()
Returns a Vector containing the MibModules loaded in this instance. |
int |
getModuleSize()
Returns the number of modules loaded now |
MibNode |
getNearestNode(SnmpOID oid)
This does a search of all MIB modules in SnmpAPI specified and fills in the Nearest MibNode for this SnmpOID instance if found. |
java.util.Vector |
getNodesFromNames(java.util.Vector nodes)
Return as a Vector of MibNodes, the MIB nodes specified in Vector argument of Strings, i.e, names of nodes. |
java.util.Vector |
getNodesFromString(java.lang.String nodeList)
Return as a Vector of MibNodes, the MIB nodes specified in String argument, i.e, space and/or comma-separated list of names of nodes. |
boolean |
getOverwriteCMI()
Gets the overwrite compiled mibs boolean. |
byte |
getParsingLevel()
Returns the parsingLevel. |
java.lang.String |
getSerializedMibFileName()
Gets the Serialized MIB File Name |
SnmpOID |
getSnmpOID(java.lang.String s)
Create an SnmpOID instance based on loaded MIBs. |
LeafSyntax |
getSyntaxByName(java.lang.String name)
Return the LeafSyntax represented by the String argument, i.e, name |
boolean |
getThrowFileNotFound()
Deprecated. |
boolean |
isDisplayHintEnabled()
|
boolean |
isLoadFromCompiledMibs()
Gets the loadFromCompiledMibs boolean. |
boolean |
isLoadFromSerializedMibs()
Gets the loadFromSerializedMibs boolean |
boolean |
isOverwriteCMI()
|
boolean |
isReadDesc()
Returns true if reading descriptions from compiled modules is enabled |
boolean |
isSerializeMibs()
Gets the serializeMibs boolean |
MibModule |
loadMibModule(java.lang.String file)
Load a MIB Module from file |
void |
loadMibModules(java.lang.String mibs)
Load a set of MIB Modules from files, specified by a space separated list of files. |
void |
registerParsingLevel(byte parsingLevel,
byte[] checks)
|
void |
removeChecks(byte[] checks,
byte parsingLevel)
|
void |
setDebug(boolean debug)
Defines whether debugging output should be generated to stdout. |
void |
setDebugMessageLevel(int level)
Sets the debug message level. |
void |
setImportsParsingLevel(byte parsingLevel)
|
void |
setLoadFromCompiledMibs(boolean flag)
Defines whether to load mib from compiled MIBs. |
void |
setLoadFromSerializedMibs(boolean flag)
Defines whether to load mib from serialized MIB file. |
void |
setOverwriteCMI(boolean overWrite)
Defines whether to overwrite the existing compiled files. |
void |
setParsingLevel(byte parsingLevel)
|
void |
setReadDesc(boolean readFlag)
Sets the flag to read descriptions from compiled mib modules. |
void |
setSerializedMibFileName(java.lang.String fileName)
Defines the name in which the serialized MIB file to be saved. |
void |
setSerializeMibs(boolean flag)
Defines whether to serialize the MibModule. |
void |
setThrowFileNotFound(boolean value)
Deprecated. |
java.lang.String |
toShortString(SnmpOID oid)
For display or printing, this method provides the short translated name (node label only, e.g, sysDescr.0) representation for the SnmpOID instance if found in loaded Mibs |
java.lang.String |
toString(SnmpOID oid)
For display or printing, this method provides the translated name (from .iso as far as loaded MIBs allow, e.g, .iso.org.myVar.3.4) representation for the SnmpOID instance if found in loaded Mibs |
java.lang.String |
toString(SnmpPDU pdu)
For display or printing, this method returns detailed information on the PDU, including variable bindings using information from the loaded MIBs. |
java.lang.String |
toString(SnmpVarBind varbind)
For display or printing, this method provides a translated value for an SNMP variable binding using information from the loaded MIBs. |
java.lang.String |
toString(SnmpVar var,
SnmpOID oid)
For display or printing, this method provides a translated value for an SNMP variable using information from the loaded MIBs. |
java.lang.String |
toTagString(SnmpVarBind varbind)
For display or printing, this method provides a translated value for an SNMP variable using information from the loaded MIBs. |
void |
unloadAllMibModules()
Unload all the loaded MibModules |
boolean |
unloadMibModule(MibModule module)
Unload the MibModule from the modules table |
MibModule |
unloadMibModule(java.lang.String name)
Unload the MibModule from the modules table |
java.lang.String |
varBindsToString(SnmpPDU pdu)
For display or printing, this method returns variable bindings in the PDU, using information from the loaded MIBs. |
| Method Detail |
public void setThrowFileNotFound(boolean value)
throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean getThrowFileNotFound()
throws java.rmi.RemoteException
java.rmi.RemoteException
public void setDebug(boolean debug)
throws java.rmi.RemoteException
java.rmi.RemoteException
public void setSerializeMibs(boolean flag)
throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean isSerializeMibs()
throws java.rmi.RemoteException
java.rmi.RemoteException
public void setLoadFromSerializedMibs(boolean flag)
throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean isLoadFromSerializedMibs()
throws java.rmi.RemoteException
java.rmi.RemoteException
public void setSerializedMibFileName(java.lang.String fileName)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String getSerializedMibFileName()
throws java.rmi.RemoteException
java.rmi.RemoteException
public void setLoadFromCompiledMibs(boolean flag)
throws java.rmi.RemoteException
If both loadFromSerializedMibs and loadFromCompiledMibs is set to true, it will just try to load the MIB as a serialized file.
java.rmi.RemoteException
public boolean isLoadFromCompiledMibs()
throws java.rmi.RemoteException
java.rmi.RemoteException
public void setOverwriteCMI(boolean overWrite)
throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean getOverwriteCMI()
throws java.rmi.RemoteException
java.rmi.RemoteException
public void loadMibModules(java.lang.String mibs)
throws java.rmi.RemoteException
MibException - is thrown upon parse errors.
java.io.IOException - is thrown upon IO errors.
java.io.FileNotFoundException - is thrown if the file is not found.
java.rmi.RemoteException
public MibModule loadMibModule(java.lang.String file)
throws java.rmi.RemoteException
MibException - is thrown upon parse errors.
java.io.IOException - is thrown upon IO errors.
java.io.FileNotFoundException - is thrown if the file is not found.
java.rmi.RemoteException
public void createCompiledMibs(java.lang.String mibs)
throws java.rmi.RemoteException
MibException - is thrown upon parse errors.
java.io.IOException - is thrown upon IO errors.
java.io.FileNotFoundException - is thrown if the file is not found.
java.rmi.RemoteException
public MibModule getMibModule(java.lang.String name)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String getModuleNameDefinition(java.lang.String file)
throws java.rmi.RemoteException
In most cases API users would not require this method as they would only need to load MIBs.
if - there are parse exceptions upto the MIB module definition
MibException - is thrown upon parse errors.
java.io.IOException - is thrown upon IO errors.
java.io.FileNotFoundException - is thrown if the file is not found.
java.rmi.RemoteException
public MibModule getMibModule(MibNode node)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.util.Enumeration getMibModules()
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.util.Vector getModules()
throws java.rmi.RemoteException
java.rmi.RemoteException
public void setDebugMessageLevel(int level)
throws java.rmi.RemoteException
java.rmi.RemoteException
public SnmpVarBind createVariableBinding(java.lang.String varName,
java.lang.String[] indexes,
java.lang.String value)
throws java.rmi.RemoteException
varName - The name, or numeric object ID, of MIB variable
for which this request is being createdindexes - The ordered list of index values (of type
String or SnmpVar values. Parameter can
be null for non-tabular columnsvalue - The SnmpVar value to use for sets. Is null for gets.
SnmpException - is thrown upon variable creation errors.
java.lang.IllegalArgumentException - is thrown if arguments are invalid.
java.rmi.RemoteException
public SnmpOID getSnmpOID(java.lang.String s)
throws java.rmi.RemoteException
java.rmi.RemoteException
public LeafSyntax getLeafSyntax(SnmpOID oid)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String varBindsToString(SnmpPDU pdu)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String getErrorString(SnmpPDU pdu)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String toString(SnmpPDU pdu)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String toString(SnmpVarBind varbind)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String toTagString(SnmpVarBind varbind)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String toString(SnmpVar var,
SnmpOID oid)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String toString(SnmpOID oid)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String toShortString(SnmpOID oid)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String getInstanceString(SnmpOID oid)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.lang.String getInstanceString(SnmpOID oid,
MibNode node)
throws java.rmi.RemoteException
java.rmi.RemoteException
public MibNode getMibNode(SnmpOID oid)
throws java.rmi.RemoteException
java.rmi.RemoteException
public MibNode getNearestNode(SnmpOID oid)
throws java.rmi.RemoteException
java.rmi.RemoteException
public MibTrap getMibTrap(SnmpOID enterprise,
int genericType,
int specificType)
throws java.rmi.RemoteException
java.rmi.RemoteException
public MibNode getMibNode(java.util.Vector oid)
throws java.rmi.RemoteException
oid - Vector of Strings OID
java.rmi.RemoteException
public MibNode getMibNode(java.lang.String nodeLabel)
throws java.rmi.RemoteException
java.rmi.RemoteException
public MibNode getMibNode(java.lang.String nodeLabel,
java.lang.String mib)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.util.Vector getNodesFromNames(java.util.Vector nodes)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.util.Vector getNodesFromString(java.lang.String nodeList)
throws java.rmi.RemoteException
java.rmi.RemoteException
public int getModuleSize()
throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean unloadMibModule(MibModule module)
throws java.rmi.RemoteException
java.rmi.RemoteException
public MibModule unloadMibModule(java.lang.String name)
throws java.rmi.RemoteException
java.rmi.RemoteException
public void unloadAllMibModules()
throws java.rmi.RemoteException
java.rmi.RemoteException
public void addLabel(java.lang.String addLabel)
throws java.rmi.RemoteException
java.rmi.RemoteException
public void setReadDesc(boolean readFlag)
throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean isReadDesc()
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.util.Enumeration getMibModuleNames()
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.util.Vector getModuleNames()
throws java.rmi.RemoteException
java.rmi.RemoteException
public LeafSyntax getSyntaxByName(java.lang.String name)
throws java.rmi.RemoteException
java.rmi.RemoteException
public void setParsingLevel(byte parsingLevel)
throws java.rmi.RemoteException
java.rmi.RemoteException
public void setImportsParsingLevel(byte parsingLevel)
throws java.rmi.RemoteException
java.rmi.RemoteException
public void registerParsingLevel(byte parsingLevel,
byte[] checks)
throws java.rmi.RemoteException
java.rmi.RemoteException
public void addChecks(byte[] checks,
byte parsingLevel)
throws java.rmi.RemoteException
java.rmi.RemoteException
public void removeChecks(byte[] checks,
byte parsingLevel)
throws java.rmi.RemoteException
java.rmi.RemoteException
public byte getParsingLevel()
throws java.rmi.RemoteException
java.rmi.RemoteExceptionsetParsingLevel(byte)
public byte getImportsParsingLevel()
throws java.rmi.RemoteException
java.rmi.RemoteException
public byte[] getChecks(byte parsingLevel)
throws java.rmi.RemoteException
java.rmi.RemoteException
public java.util.Vector getErrorModuleNames()
throws java.rmi.RemoteException
java.rmi.RemoteExceptiongetErrorMessages(String)
public java.util.Vector getErrorMessages(java.lang.String module)
throws java.rmi.RemoteException
java.rmi.RemoteExceptiongetErrorModuleNames
public void enableDisplayHint(boolean flag)
throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean isDisplayHintEnabled()
throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean isOverwriteCMI()
throws java.rmi.RemoteException
java.rmi.RemoteException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||