Package com.snmp4j.smi
Class RepositoryIO
java.lang.Object
java.util.EventObject
com.snmp4j.smi.RepositoryIO
- All Implemented Interfaces:
Serializable
The RepositoryIO class is used to return the
InputStream or OutputStream
instances provided by a RepositoryDriver instance to read or store a compiled
MIB module from/into persistent storage. In addition, it can indicate that a MIB module
should be removed from the MIB repository.- Author:
- Frank Fock
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionRepositoryIO(Object source, String moduleName) Creates anRepositoryEventto load or store a given MIB module. -
Method Summary
Modifier and TypeMethodDescriptionGets the input stream to be used to load a compiled MIB module from persistent storage.Gets the module name of the MIB module to read or write.Gets the output stream to write the MIB module.booleanIndicates whether the deletion of the MIB module specified by the module name of this event object was successfully completed.voidsetInputStream(InputStream inputStream) Sets theInputStreamto be used to load a compiled MIB module from persistent storage.voidsetModuleDeleted(boolean moduleDeleted) Sets the flag that indicates whether a MIB module has been successfully removed from persistent storage.voidsetOutputStream(OutputStream outputStream) Sets the output stream to write a MIB module with the given name to the repository.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
RepositoryIO
Creates anRepositoryEventto load or store a given MIB module.- Parameters:
source- the event source, typically a IRepositoryManager instance.moduleName- the module name of the MIB module to read or write from/to persitent storage.
-
-
Method Details
-
getInputStream
Gets the input stream to be used to load a compiled MIB module from persistent storage.- Returns:
- an
InputStream.
-
setInputStream
Sets theInputStreamto be used to load a compiled MIB module from persistent storage. The input stream must be set when aRepositoryDriver.readModule(com.snmp4j.smi.RepositoryIO)event is processed.- Parameters:
inputStream- anInputStreamthat reads the MIB module with the name specified bygetModuleName().
-
setOutputStream
Sets the output stream to write a MIB module with the given name to the repository. The output stream must be set when aRepositoryDriver.writeModule(com.snmp4j.smi.RepositoryIO)event is received.- Parameters:
outputStream- anOutputStreaminstance.
-
getOutputStream
Gets the output stream to write the MIB module.- Returns:
- an
OutputStreaminstance.
-
getModuleName
Gets the module name of the MIB module to read or write.- Returns:
- a module name String.
-
setModuleDeleted
public void setModuleDeleted(boolean moduleDeleted) Sets the flag that indicates whether a MIB module has been successfully removed from persistent storage. This flag must be set when an implementer of theRepositoryDriverinterface receives a request to delete a MIB module.- Parameters:
moduleDeleted- a boolean value that indicates whether the MIB module has been deleted.
-
isModuleDeleted
public boolean isModuleDeleted()Indicates whether the deletion of the MIB module specified by the module name of this event object was successfully completed.- Returns:
trueif the MIB module was removed from persistent storage.
-