com.ibm.di.connector
Class SNMPServerConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.SNMPServerConnector
All Implemented Interfaces:
ConnectorInterface, VersionInfoInterface

public class SNMPServerConnector
extends Connector

The SNMP Server Connector is used by a monitoring console (an SNMP Manager). The SNMP Server Connector receives SNMP packets on a specified port, and returns appropriate SNMP response packets.


Nested Class Summary
 class SNMPServerConnector.EmptyValue
           
 
Field Summary
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
SNMPServerConnector()
          Default constructor.
 
Method Summary
 com.tivoli.snmp.data.BadValue createBadValue()
          Convenient methods to create SNMP object types
 com.tivoli.snmp.data.Boolean createBoolean(boolean aValue)
           
 com.tivoli.snmp.data.Counter createCounter(long aValue)
           
 com.tivoli.snmp.data.Counter64 createCounter64(long aValue)
           
 com.tivoli.snmp.data.FixedLengthOctetString createFixedLengthOctetString(String aValue)
           
 com.tivoli.snmp.data.FullCounter64 createFullCounter64(BigInteger aValue)
           
 com.tivoli.snmp.data.Gauge createGauge(long aValue)
           
 com.tivoli.snmp.data.IPAddress createIPAddress(String aValue)
           
 com.tivoli.snmp.data.NoChange createNoChange()
           
 com.tivoli.snmp.data.NoSuchInstance createNoSuchInstance()
           
 com.tivoli.snmp.data.NoSuchObject createNoSuchObject()
           
 com.tivoli.snmp.data.NotSupported createNotSupported()
           
 com.tivoli.snmp.data.Null createNull()
           
 com.tivoli.snmp.data.OctetString createOctetString(String aValue)
           
 com.tivoli.snmp.data.OID createOID(String aValue)
           
 com.tivoli.snmp.data.Opaque createOpaque(byte[] aValue)
           
 com.tivoli.snmp.data.TimeTicks createTimeTicks(long aValue)
           
 ConnectorInterface getNextClient()
          Server mode - returns a new instance of the Connector for each client connection.
 Entry getNextEntry()
          Returns the next Entry from the SNMP client(Manager).
 SNMPServerConnector getServerConnector()
          Returns the server Connector if this Connector is handling a client session.
 String getVersion()
          Return version information
 void initialize(Object aObj)
          Initialize the Connector.
 boolean isAccepting()
          Returns true if this Connector is currently waiting for a client connection.
 boolean isTerminating()
           
 void putEntry(Entry aEntry)
          Send response to the SNMP client (Manager).
 void replyEntry(Entry aEntry)
          Send response to the SNMP client (Manager).
 void setCommunity(String aCommunity)
          Sets community parameter
 void setServerConnector(SNMPServerConnector aServerConnector)
          Sets the server Connector for this Connector.
 void terminate()
          Terminate the connector.
 void terminateServer()
          This method tries to terminate the server by setting the termination flag for the Connector returned by getServerConnector and immediatly connecting to its port.
 
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, deleteEntry, findEntry, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logmsg, modEntry, modEntry, pushback, queryOperations, queryReply, querySchema, queryTables, reconnect, reconnect, registerScriptBeans, selectEntries, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SNMPServerConnector

public SNMPServerConnector()
Default constructor.

Method Detail

getServerConnector

public SNMPServerConnector getServerConnector()
Returns the server Connector if this Connector is handling a client session.

Returns:
SNMPServerConnector The parent SNMPServerConnector

setCommunity

public void setCommunity(String aCommunity)
Sets community parameter

Parameters:
aCommunity - The community

setServerConnector

public void setServerConnector(SNMPServerConnector aServerConnector)
Sets the server Connector for this Connector.

Parameters:
aServerConnector - The serverConnector.

isAccepting

public boolean isAccepting()
Returns true if this Connector is currently waiting for a client connection.


isTerminating

public boolean isTerminating()
Returns:
true if this Connector has the termination flag set.

initialize

public void initialize(Object aObj)
                throws Exception
Initialize the Connector. To initialize this Connector with a DatagramPacket object for the obj parameter. In all other cases, the Connector will initialize a SNMP server(Agent) session.

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
aObj - Null, DatagramPacket or ConnectorMode class
Throws:
Exception - If invalid Connector parameter values are supplied.

getNextClient

public ConnectorInterface getNextClient()
                                 throws Exception
Server mode - returns a new instance of the Connector for each client connection.

Specified by:
getNextClient in interface ConnectorInterface
Overrides:
getNextClient in class Connector
Returns:
ConnectorInterface child SNMPServerConnector object that process client request
Throws:
Exception

getNextEntry

public Entry getNextEntry()
                   throws Exception
Returns the next Entry from the SNMP client(Manager).

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
- the next Entry, or null if the connection has been closed.
Throws:
Exception - If retrieving the next Entry fails.
See Also:
Connector.selectEntries()

replyEntry

public void replyEntry(Entry aEntry)
                throws Exception
Send response to the SNMP client (Manager).

Specified by:
replyEntry in interface ConnectorInterface
Overrides:
replyEntry in class Connector
Parameters:
aEntry - The entry.
Throws:
Exception - If sending response fails.

putEntry

public void putEntry(Entry aEntry)
              throws Exception
Send response to the SNMP client (Manager).

Specified by:
putEntry in interface ConnectorInterface
Overrides:
putEntry in class Connector
Parameters:
aEntry - The entry.
Throws:
Exception - If sending response fails.

terminateServer

public void terminateServer()
                     throws Exception
This method tries to terminate the server by setting the termination flag for the Connector returned by getServerConnector and immediatly connecting to its port.

Specified by:
terminateServer in interface ConnectorInterface
Overrides:
terminateServer in class Connector
Throws:
Exception

terminate

public void terminate()
               throws Exception
Terminate the connector.

Specified by:
terminate in interface ConnectorInterface
Overrides:
terminate in class Connector
Throws:
Exception

createBadValue

public com.tivoli.snmp.data.BadValue createBadValue()
Convenient methods to create SNMP object types


createBoolean

public com.tivoli.snmp.data.Boolean createBoolean(boolean aValue)

createCounter

public com.tivoli.snmp.data.Counter createCounter(long aValue)

createCounter64

public com.tivoli.snmp.data.Counter64 createCounter64(long aValue)

createFixedLengthOctetString

public com.tivoli.snmp.data.FixedLengthOctetString createFixedLengthOctetString(String aValue)

createFullCounter64

public com.tivoli.snmp.data.FullCounter64 createFullCounter64(BigInteger aValue)

createGauge

public com.tivoli.snmp.data.Gauge createGauge(long aValue)

createIPAddress

public com.tivoli.snmp.data.IPAddress createIPAddress(String aValue)

createNoChange

public com.tivoli.snmp.data.NoChange createNoChange()

createNoSuchInstance

public com.tivoli.snmp.data.NoSuchInstance createNoSuchInstance()

createNoSuchObject

public com.tivoli.snmp.data.NoSuchObject createNoSuchObject()

createNotSupported

public com.tivoli.snmp.data.NotSupported createNotSupported()

createNull

public com.tivoli.snmp.data.Null createNull()

createOctetString

public com.tivoli.snmp.data.OctetString createOctetString(String aValue)

createOID

public com.tivoli.snmp.data.OID createOID(String aValue)

createOpaque

public com.tivoli.snmp.data.Opaque createOpaque(byte[] aValue)

createTimeTicks

public com.tivoli.snmp.data.TimeTicks createTimeTicks(long aValue)

getVersion

public String getVersion()
Return version information