|
JASMI API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IRepositoryManager
Interface for Repository Managers of SNMP MIB repositories.
| Field Summary | |
|---|---|
static int |
NOCHECK_INCONSISTENT_ACCESS
|
static int |
NOCHECK_INCONSISTENT_STATUS
|
static int |
NOCHECK_INCONSISTENT_SYNTAX
|
static int |
NOCHECK_NOT_IN_GROUP
|
| Method Summary | |
|---|---|
void |
addModule(IModule module)
Adds a MIB module to the repository. |
IModuleInfo[] |
addModules(java.io.File file)
Adds a MIB file to the repository. |
void |
addRepositoryListener(RepositoryListener listener)
Adds a RepositoryListener to this repository that provides
Input- and OutputStreams to read and write MIB modules from persistent
storage (i.e. the MIB repository). |
void |
checkModules(java.io.InputStream file)
Check whether an InputStream contains valid MIB modules. |
IModuleInfo[] |
checkModules(java.io.InputStream file,
boolean lenientSyntaxCheck)
Check whether an InputStream contains valid MIB modules. |
java.lang.Integer |
createModuleID()
Creates a new unique module ID for the current MIB repository. |
java.lang.String |
getErrorText(int errorCode,
java.lang.String message)
Deprecated. |
java.lang.String |
getErrorText(com.agentpp.smiparser.SMIParseException parseException)
Get an error text for a SMIParseException. |
IObject[] |
getImportedObjects(java.lang.String moduleName)
Get those MIBObjects for a MIB module with the specified name, that are imported from other MIBs. |
IObject[] |
getImportedObjects(java.lang.String moduleName,
java.util.Hashtable moduleIDs)
Get those MIBObjects for a MIB module with the specified name, that are imported from other MIBs. |
IModule |
getModule(java.lang.String moduleName)
Return a given MIB module including its objects. |
IModuleInfo[] |
getModuleInfo(java.io.File file)
Get MIB module information (module name and imports) from a MIB file. |
IModuleInfo[] |
getModuleInfo(java.io.InputStream inputStream,
java.lang.String name)
Get MIB module information (module name and imports) from an input stream. |
IModuleInfo[] |
getModuleInfos()
Get module information about all MIB modules in the MIB repository. |
java.lang.String[] |
getModuleNames()
Return an array of all module names available from the repository managed by the receiver. |
IModule[] |
getModules()
Return an array of all MIB modules. |
IModule[] |
getModules(java.io.InputStream stream,
ImportModuleListener importer)
Get the modules contained in a MIB file. |
IObject[] |
getObjects(java.lang.String moduleName)
Get the MIBObjects of the MIB module with the given name. |
int |
getParserOptions()
Get actual parser options. |
java.io.File |
getRepositoryDirectory()
Gets the repository directory used to store compiled MIB modules by default. |
void |
initialize()
Initialize the repository, thus remove all modules from the repository. |
void |
open(java.io.File directory)
Open the MIB Repository located at the given path. |
boolean |
removeModule(java.lang.String moduleName)
Remove a module from the repository. |
void |
removeRepositoryListener(RepositoryListener listener)
Removes a RepositoryListener from this repository. |
void |
setParserOptions(int options)
Set parser options. |
| Field Detail |
|---|
static final int NOCHECK_NOT_IN_GROUP
static final int NOCHECK_INCONSISTENT_SYNTAX
static final int NOCHECK_INCONSISTENT_STATUS
static final int NOCHECK_INCONSISTENT_ACCESS
| Method Detail |
|---|
void open(java.io.File directory)
throws java.io.IOException
directory - a possibly empty directory to store MIB repository data.
java.io.IOException - if given MIB repository path is invalid.
IModuleInfo[] addModules(java.io.File file)
throws com.agentpp.smiparser.SMIParseException
file - a file containing one or more MIB modules.
com.agentpp.smiparser.SMIParseException - if file contains any errors.
IModule[] getModules(java.io.InputStream stream,
ImportModuleListener importer)
throws com.agentpp.smiparser.SMIParseException
stream - an InputStream containing one or more MIB modules.importer - an ImportModuleListener instance used as callback to parse or load
objects of imported MIB modules and for creating a module ID for
any MIB modules parsed from stream.
com.agentpp.smiparser.SMIParseException - if any syntax or semantic
error has been detected in file.
void checkModules(java.io.InputStream file)
throws com.agentpp.smiparser.SMIParseException
file - an InputStream containing SMIv1/v2 MIB module(s).
com.agentpp.smiparser.SMIParseException - if file has an error.
IModuleInfo[] checkModules(java.io.InputStream file,
boolean lenientSyntaxCheck)
throws com.agentpp.smiparser.SMIParseException
file - an InputStream containing SMIv1/v2 MIB module(s).lenientSyntaxCheck - if true the syntax checking is minimal, otherwise
it is the default (SMI standard).
com.agentpp.smiparser.SMIParseException - if the syntax check fails.
IModuleInfo[] getModuleInfo(java.io.File file)
throws com.agentpp.smiparser.SMIParseException
file - a SMIv1/v2 MIB File instance.
com.agentpp.smiparser.SMIParseException - if file contains any errors.
IModuleInfo[] getModuleInfo(java.io.InputStream inputStream,
java.lang.String name)
throws com.agentpp.smiparser.SMIParseException
inputStream - an InputStream instance containing SMIv1/v2 MIB modules.name - a String representing name of the source, for example the path of a
FileInputStream.
com.agentpp.smiparser.SMIParseException - if inputStream contains any errors.
IModuleInfo[] getModuleInfos()
throws java.io.IOException
java.io.IOException - if the MIB repository is invalid or on any other IO error.
boolean removeModule(java.lang.String moduleName)
throws java.io.IOException
moduleName - the name of the victim.
java.io.IOException
void initialize()
throws java.io.IOException
java.io.IOException - thrown if an exception occured while accessing the MIB repository.
IModule[] getModules()
throws java.io.IOException
java.io.IOException
IModule getModule(java.lang.String moduleName)
throws java.io.IOException
moduleName - a module name.
java.io.IOException
java.lang.String[] getModuleNames()
throws java.io.IOException
java.io.IOException
IObject[] getObjects(java.lang.String moduleName)
throws java.io.IOException
moduleName - the name of a MIB module.
java.io.IOException
IObject[] getImportedObjects(java.lang.String moduleName)
throws java.io.IOException
moduleName - the name of a MIB module.
java.io.IOException
IObject[] getImportedObjects(java.lang.String moduleName,
java.util.Hashtable moduleIDs)
throws java.io.IOException
moduleName - the name of a MIB module.moduleIDs - an empty Hashtable. On return, it contains a mapping from
all module names of the visited MIB modules to their respective module
IDs.
java.io.IOException
java.lang.String getErrorText(int errorCode,
java.lang.String message)
errorCode - the errorCode from a com.agentpp.smiparser.SMIParseException.message - the message of a com.agentpp.smiparser.SMIParseException.
java.lang.String getErrorText(com.agentpp.smiparser.SMIParseException parseException)
parseException - a com.agentpp.smiparser.SMIParseException.
void setParserOptions(int options)
options - a bitwise OR of option values.int getParserOptions()
java.io.File getRepositoryDirectory()
addRepositoryListener(com.agentpp.smi.event.RepositoryListener) method.
File instance representing a directory.void addRepositoryListener(RepositoryListener listener)
RepositoryListener to this repository that provides
Input- and OutputStreams to read and write MIB modules from persistent
storage (i.e. the MIB repository). This can be used, for example, to
store and read compiled MIB modules from JAR or ZIP files instead from a
directory, which is the default.
listener - a RepositoryListener that provides InputStreams
and OutputStreams on demand to read or write a precompiled
MIB module identified by its name from persistent storage.void removeRepositoryListener(RepositoryListener listener)
RepositoryListener from this repository. If no
listeners are left, MIB modules will be read and written from the default
MIB repository directory.
listener - a RepositoryListener.
void addModule(IModule module)
throws java.io.IOException
module - an IModule instance that will be written to the MIB repository.
RepositoryEvent listeners will be called to provide
an alternative output stream.
java.io.IOException
java.lang.Integer createModuleID()
throws java.io.IOException
IModule instance when this instance has been created
programmatically by using means provided by the JASMI Ext API for example.
When parsing MIB modules from a text source file, a module ID is automatically allocated.
When a MIB module is removed from a IB repository, its module ID is freed and can be reused again for any other new module.
java.io.IOException
|
JASMI API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||