|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.percederberg.mibble.MibLoader
A MIB file loader. This class contains a search path for locating MIB files, and also holds a refererence to previously loaded MIB files to avoid loading the same file multiple times. The MIB search path consists of directories with MIB files that can be imported into another MIB. If an import isn't found in the search path, the default IANA and IETF MIB directories are searched. Note that these files are normally stored as resources together with the compiled code.
The MIB loader is not thread-safe, i.e. it cannot be used concurrently in multiple threads.
Constructor Summary | |
MibLoader()
Creates a new MIB loader. |
Method Summary | |
void |
addAllDirs(java.io.File dir)
Adds a directory and all subdirectories to the MIB search path. |
void |
addDir(java.io.File dir)
Adds a directory to the MIB search path. |
void |
addDirs(java.io.File[] dirs)
Adds directories to the MIB search path. |
MibContext |
getDefaultContext()
Returns the default MIB context. |
Mib |
getMib(java.lang.String name)
Returns a previously loaded MIB file. |
Mib |
load(java.io.File file)
Loads a MIB file. |
Mib |
load(java.lang.String name)
Loads a MIB file. |
void |
removeAllDirs()
Removes all directories from the MIB search path. |
void |
removeDir(java.io.File dir)
Removes a directory from the MIB search path. |
void |
reset()
Resets this loader. |
void |
scheduleLoad(java.io.File file)
Schedules the loading of a MIB file. |
void |
scheduleLoad(java.lang.String name)
Schedules the loading of a MIB file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MibLoader()
Method Detail |
public void addDir(java.io.File dir)
dir
- the directory to addpublic void addDirs(java.io.File[] dirs)
dirs
- the directories to addpublic void addAllDirs(java.io.File dir)
dir
- the directory to addpublic void removeDir(java.io.File dir)
dir
- the directory to removepublic void removeAllDirs()
public void reset()
public MibContext getDefaultContext()
public Mib getMib(java.lang.String name)
name
- the MIB name
public Mib load(java.lang.String name) throws java.io.FileNotFoundException, MibLoaderException
name
- the MIB name (filename without extension)
java.io.FileNotFoundException
- if the MIB file couldn't be
found in the MIB search path
MibLoaderException
- if the MIB file couldn't be loaded
correctlypublic Mib load(java.io.File file) throws java.io.FileNotFoundException, MibLoaderException
file
- the MIB file
java.io.FileNotFoundException
- if the MIB file couldn't be
found
MibLoaderException
- if the MIB file couldn't be loaded
correctlypublic void scheduleLoad(java.lang.String name) throws java.io.FileNotFoundException
name
- the MIB name (filename without extension)
java.io.FileNotFoundException
- if the MIB file couldn't be
found in the MIB search pathpublic void scheduleLoad(java.io.File file)
file
- the MIB file
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |