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:
- Serialized Form
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionRepositoryIO(Object source, String moduleName)
Creates anRepositoryEvent
to 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.boolean
Indicates whether the deletion of the MIB module specified by the module name of this event object was successfully completed.void
setInputStream(InputStream inputStream)
Sets theInputStream
to be used to load a compiled MIB module from persistent storage.void
setModuleDeleted(boolean moduleDeleted)
Sets the flag that indicates whether a MIB module has been successfully removed from persistent storage.void
setOutputStream(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 anRepositoryEvent
to 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 theInputStream
to 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
- anInputStream
that 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
- anOutputStream
instance.
-
getOutputStream
Gets the output stream to write the MIB module.- Returns:
- an
OutputStream
instance.
-
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 theRepositoryDriver
interface 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:
true
if the MIB module was removed from persistent storage.
-