JASMI API

com.agentpp.smi.event
Class RepositoryEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.agentpp.smi.event.RepositoryEvent
All Implemented Interfaces:
java.io.Serializable

public class RepositoryEvent
extends java.util.EventObject

The RepositoryEvent class represents MIB module read or write requests for compiled (binary) MIB modules.

Since:
1.8
Version:
1.8
Author:
Frank Fock
See Also:
Serialized Form

Field Summary
static int READ_MIB_MODULE
          Specifies that a MIB module should be read from the repository.
static int WRITE_MIB_MODULE
          Specifies that a MIB module should be written to the repository.
 
Constructor Summary
RepositoryEvent(java.lang.Object source, java.lang.String moduleName)
          Creates an RepositoryEvent to load or store a given MIB module.
RepositoryEvent(java.lang.Object source, java.lang.String moduleName, IModule module)
          Creates an RepositoryEvent to load or store a given MIB module.
 
Method Summary
 java.io.InputStream getInputStream()
          Gets the input stream to be used to load a compiled MIB module from persistent storage.
 IModule getModule()
          Gets the MIB module that should be written to persistent storage.
 java.lang.String getModuleName()
          Gets the module name of the MIB module to read or write.
 java.io.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 sucessfully completed.
 boolean isUseDefaults()
          Indicates whether a repository manager should try to use its default behavior to process the event if this listener does not set input/output stream.
 void setInputStream(java.io.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(java.io.OutputStream outputStream)
          Sets the output stream to write a MIB module with the given name to the repository.
 void setUseDefaults(boolean useDefaults)
          Sets the useDefaults that indicates whether a repository manager should try to use its default behavior to process the event if this listener does not set input/output stream.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

READ_MIB_MODULE

public static final int READ_MIB_MODULE
Specifies that a MIB module should be read from the repository.

See Also:
Constant Field Values

WRITE_MIB_MODULE

public static final int WRITE_MIB_MODULE
Specifies that a MIB module should be written to the repository.

See Also:
Constant Field Values
Constructor Detail

RepositoryEvent

public RepositoryEvent(java.lang.Object source,
                       java.lang.String moduleName,
                       IModule module)
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.
module - the module MIB module to write to persitent storage.

RepositoryEvent

public RepositoryEvent(java.lang.Object source,
                       java.lang.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 Detail

getInputStream

public java.io.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(java.io.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 RepositoryListener.readModule event is received.

Parameters:
inputStream - an InputStream that reads the MIB module with the name specified by getModuleName.

setOutputStream

public void setOutputStream(java.io.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 RepositoryListener.writeModule event is received.

Parameters:
outputStream - an OutputStream instance.

getOutputStream

public java.io.OutputStream getOutputStream()
Gets the output stream to write the MIB module.

Returns:
an OutputStream instance.

getModuleName

public java.lang.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 a implemeter of the RepositoryListener interface receives a request to delete a MIB module.

Parameters:
moduleDeleted - a boolean value that inidicates whether the MIB module has been deleted.

setUseDefaults

public void setUseDefaults(boolean useDefaults)
Sets the useDefaults that indicates whether a repository manager should try to use its default behavior to process the event if this listener does not set input/output stream.

Parameters:
useDefaults - false to disable any default behavior.
Since:
2.6

isModuleDeleted

public boolean isModuleDeleted()
Indicates whether the deletion of the MIB module specified by the module name of this event object was sucessfully completed.

Returns:
true if the MIB module is removed from persistent storage.

getModule

public IModule getModule()
Gets the MIB module that should be written to persistent storage.

Returns:
a IModule instance or null if this event is not a write module event.

isUseDefaults

public boolean isUseDefaults()
Indicates whether a repository manager should try to use its default behavior to process the event if this listener does not set input/output stream.

Returns:
true if the default behavior should be used (this is the default).
Since:
2.6

JASMI API

JASMI 3
Copyright 2001-2010 Frank Fock
All Rights Reserved