org.friendlysnmp.mib
Class BaseMib

java.lang.Object
  extended by org.friendlysnmp.mib.BaseMib
Direct Known Subclasses:
FriendlySnmpMibFriend, SnmpCommunityMibF, SnmpFrameworkMibF, SnmpNotificationMibF, SnmpProxyMibF, SnmpTargetMibF, SnmpUsmMibF, SnmpV2MibF, SnmpVacmMibF

public abstract class BaseMib
extends java.lang.Object

Base class for MIBs compiled by FriendlyPro.

Version:
$Revision: 1.29 $

Constructor Summary
BaseMib()
          Default constructor
 
Method Summary
 void addHandler(FHandler handler)
          Adds handler to the MIB
protected  void addNode(FNode node)
          Adds node to the MIB
 AgentWorker agent()
          Returns SNMP agent.
 void collectHandlers(java.util.Collection<FHandler> c)
          Collect handlers from this object
 void collectNodes(java.util.Map<FID,FNode> c)
          Collect nodes from this object
 void exceptionThrown(FException e)
          Sends exception to all registered listeners in the application.
 void exceptionThrown(FTable table, FException e)
          Sends exception to the registered listeners in the application with a message that a problem is found while updating the table.
 void exceptionThrown(java.lang.String msg, FException e)
          Sends exception to the registered listener in the application
 void init(AgentWorker agent)
          Actual implementation is provided in generated MIB-to-Java class.
 boolean isInited()
          Checks the state of this MIB object.
abstract  void registerMOs(org.snmp4j.agent.MOServer server, org.snmp4j.smi.OctetString context)
          Registers objects.
 void reportException(java.lang.String comment, java.lang.Throwable e)
          Use this method to report caught exception to MIB browser via SNMP.
abstract  void unregisterMOs(org.snmp4j.agent.MOServer server, org.snmp4j.smi.OctetString context)
          Unregisters objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseMib

public BaseMib()
Default constructor

Method Detail

addHandler

public void addHandler(FHandler handler)
                throws FException
Adds handler to the MIB

Parameters:
handler -
Throws:
FException

addNode

protected void addNode(FNode node)
Adds node to the MIB

Parameters:
node -

collectHandlers

public void collectHandlers(java.util.Collection<FHandler> c)
Collect handlers from this object

Parameters:
c - collection handlers from MIB are added to this collection

collectNodes

public void collectNodes(java.util.Map<FID,FNode> c)
Collect nodes from this object

Parameters:
c - collection nodes from MIB are added to this collection

init

public void init(AgentWorker agent)
          throws FException
Actual implementation is provided in generated MIB-to-Java class.

Parameters:
agent - SNMP agent
Throws:
FException

isInited

public boolean isInited()
Checks the state of this MIB object.

Returns:
true if the method init(AgentWorker) was called.

agent

public AgentWorker agent()
Returns SNMP agent. The method name cannot be getAgent() because it may conflict with getters in derived generated classes for declared object "agent" in a MIB.

Returns:
SNMP agent.

registerMOs

public abstract void registerMOs(org.snmp4j.agent.MOServer server,
                                 org.snmp4j.smi.OctetString context)
                          throws org.snmp4j.agent.DuplicateRegistrationException
Registers objects.

Parameters:
server - SNMP4J agent
context - context
Throws:
org.snmp4j.agent.DuplicateRegistrationException

unregisterMOs

public abstract void unregisterMOs(org.snmp4j.agent.MOServer server,
                                   org.snmp4j.smi.OctetString context)
Unregisters objects.

Parameters:
server - SNMP4J server
context - context

exceptionThrown

public void exceptionThrown(FException e)
Sends exception to all registered listeners in the application.

Parameters:
e - exception
See Also:
FExceptionListener

exceptionThrown

public void exceptionThrown(FTable table,
                            FException e)
Sends exception to the registered listeners in the application with a message that a problem is found while updating the table.

Parameters:
table - the table with the exception
e - exception

exceptionThrown

public void exceptionThrown(java.lang.String msg,
                            FException e)
Sends exception to the registered listener in the application

Parameters:
msg - message with details about the exception, or null
e - exception

reportException

public void reportException(java.lang.String comment,
                            java.lang.Throwable e)
Use this method to report caught exception to MIB browser via SNMP.

Parameters:
comment - error message (empty or null)
e - exception