net.sf.snmpadaptor4j.api.opennms
Class OpennmsSnmpDaemon

java.lang.Object
  extended by net.sf.snmpadaptor4j.api.opennms.OpennmsSupport
      extended by net.sf.snmpadaptor4j.api.opennms.OpennmsSnmpDaemon
All Implemented Interfaces:
SnmpDaemon, org.opennms.protocols.snmp.SnmpAgentHandler

public class OpennmsSnmpDaemon
extends OpennmsSupport
implements SnmpDaemon, org.opennms.protocols.snmp.SnmpAgentHandler

SNMP daemon implementation for joesnmp API.

Author:
Jean-Philippe MINETTI

Field Summary
protected  SnmpMib snmpMib
          SNMP Management Information Base (MIB).
 
Fields inherited from class net.sf.snmpadaptor4j.api.opennms.OpennmsSupport
logger
 
Method Summary
 boolean isStarted()
          Returns TRUE if the SNMP daemon is started.
protected static org.opennms.protocols.snmp.SnmpSyntax newSnmpValue(AttributeAccessor attributeAccessor)
          Creates and returns a new SnmpSyntax by a AttributeAccessor.
protected  void sendPduPacket(org.opennms.protocols.snmp.SnmpAgentSession session, org.opennms.protocols.snmp.SnmpPeer peer, org.opennms.protocols.snmp.SnmpPduPacket pdu)
          Sends a SnmpPduPacket.
protected static void setValue(AttributeAccessor attributeAccessor, org.opennms.protocols.snmp.SnmpSyntax newValue)
          Sets a new value to AttributeAccessor.
 void SnmpAgentSessionError(org.opennms.protocols.snmp.SnmpAgentSession session, int error, Object ref)
           
 org.opennms.protocols.snmp.SnmpPduRequest snmpReceivedGet(org.opennms.protocols.snmp.SnmpPduPacket pdu, boolean getNext)
           
 void snmpReceivedPdu(org.opennms.protocols.snmp.SnmpAgentSession session, InetAddress manager, int port, org.opennms.protocols.snmp.SnmpOctetString community, org.opennms.protocols.snmp.SnmpPduPacket pdu)
           
 org.opennms.protocols.snmp.SnmpPduRequest snmpReceivedSet(org.opennms.protocols.snmp.SnmpPduPacket pdu)
           
 void start()
          Starts the SNMP daemon.
 void stop()
          Stops the SNMP daemon.
 String toString()
           
 
Methods inherited from class net.sf.snmpadaptor4j.api.opennms.OpennmsSupport
newJmxValue, newSnmpValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

snmpMib

protected final SnmpMib snmpMib
SNMP Management Information Base (MIB).

Method Detail

start

public final void start()
                 throws Exception
Description copied from interface: SnmpDaemon
Starts the SNMP daemon.

Specified by:
start in interface SnmpDaemon
Throws:
Exception - Exception if an error has occurred.

stop

public final void stop()
Description copied from interface: SnmpDaemon
Stops the SNMP daemon.

Specified by:
stop in interface SnmpDaemon

isStarted

public final boolean isStarted()
Description copied from interface: SnmpDaemon
Returns TRUE if the SNMP daemon is started.

Specified by:
isStarted in interface SnmpDaemon
Returns:
TRUE if the SNMP daemon is started.

SnmpAgentSessionError

public final void SnmpAgentSessionError(org.opennms.protocols.snmp.SnmpAgentSession session,
                                        int error,
                                        Object ref)
Specified by:
SnmpAgentSessionError in interface org.opennms.protocols.snmp.SnmpAgentHandler

snmpReceivedPdu

public final void snmpReceivedPdu(org.opennms.protocols.snmp.SnmpAgentSession session,
                                  InetAddress manager,
                                  int port,
                                  org.opennms.protocols.snmp.SnmpOctetString community,
                                  org.opennms.protocols.snmp.SnmpPduPacket pdu)
Specified by:
snmpReceivedPdu in interface org.opennms.protocols.snmp.SnmpAgentHandler

sendPduPacket

protected void sendPduPacket(org.opennms.protocols.snmp.SnmpAgentSession session,
                             org.opennms.protocols.snmp.SnmpPeer peer,
                             org.opennms.protocols.snmp.SnmpPduPacket pdu)
                      throws Exception
Sends a SnmpPduPacket.

Parameters:
session - SNMP session.
peer - Request destination.
pdu - Request.
Throws:
Exception - Exception if an error has occurred.

snmpReceivedGet

public final org.opennms.protocols.snmp.SnmpPduRequest snmpReceivedGet(org.opennms.protocols.snmp.SnmpPduPacket pdu,
                                                                       boolean getNext)
Specified by:
snmpReceivedGet in interface org.opennms.protocols.snmp.SnmpAgentHandler

snmpReceivedSet

public org.opennms.protocols.snmp.SnmpPduRequest snmpReceivedSet(org.opennms.protocols.snmp.SnmpPduPacket pdu)
Specified by:
snmpReceivedSet in interface org.opennms.protocols.snmp.SnmpAgentHandler

newSnmpValue

protected static org.opennms.protocols.snmp.SnmpSyntax newSnmpValue(AttributeAccessor attributeAccessor)
                                                             throws Exception
Creates and returns a new SnmpSyntax by a AttributeAccessor.

Parameters:
attributeAccessor - AttributeAccessor containing all the necessary data for create the SnmpSyntax.
Returns:
New SnmpSyntax.
Throws:
Exception - Exception if an error has occurred.

setValue

protected static void setValue(AttributeAccessor attributeAccessor,
                               org.opennms.protocols.snmp.SnmpSyntax newValue)
                        throws Exception
Sets a new value to AttributeAccessor.

Parameters:
attributeAccessor - AttributeAccessor to update.
newValue - New value encapsulated to an object SnmpSyntax.
Throws:
Exception - Exception if an error has occurred.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012-2013 snmpAdaptor4j. All Rights Reserved.