# Class RepositoryIO

java.lang.Object
java.util.EventObject
com.snmp4j.smi.RepositoryIO

All Implemented Interfaces:
  `Serializable`

public class RepositoryIO extends EventObject
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 EventObject

  `source`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RepositoryIO(Object source, String moduleName)`
  Creates an `RepositoryEvent` to load or store a given MIB module.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `InputStream`
  `getInputStream()`
  Gets the input stream to be used to load a compiled MIB module from persistent storage.
  `String`
  `getModuleName()`
  Gets the module name of the MIB module to read or write.
  `OutputStream`
  `getOutputStream()`
  Gets the output stream to write the MIB module.
  `boolean`
  `isModuleDeleted()`
  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 the `InputStream` 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 EventObject

  `getSource, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### RepositoryIO

    public RepositoryIO(Object source, String moduleName)
    Creates an `RepositoryEvent` 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

    public InputStream getInputStream()
    Gets the input stream to be used to load a compiled MIB module from persistent storage.
    Returns:
      an `InputStream`.

  - ### setInputStream

    public void setInputStream(InputStream inputStream)
    Sets the `InputStream` to be used to load a compiled MIB module from persistent storage. The input stream must be set when a `RepositoryDriver.readModule(RepositoryIO)` event is processed.
    Parameters:
      `inputStream` - an `InputStream` that reads the MIB module with the name specified by `getModuleName()`.

  - ### setOutputStream

    public void setOutputStream(OutputStream outputStream)
    Sets the output stream to write a MIB module with the given name to the repository. The output stream must be set when a `RepositoryDriver.writeModule(RepositoryIO)` event is received.
    Parameters:
      `outputStream` - an `OutputStream` instance.

  - ### getOutputStream

    public OutputStream getOutputStream()
    Gets the output stream to write the MIB module.
    Returns:
      an `OutputStream` instance.

  - ### getModuleName

    public String 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 the `RepositoryDriver` 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.