com.adventnet.snmp.snmp2
Interface SnmpTransportProvider

All Known Implementing Classes:
TcpTransportImpl

public interface SnmpTransportProvider

Interface that represents a transport connection between the SNMP manager and SNMP agent. Users who want to provide their own transport mechanism should implement this interface and provide implementation for their transport protocol and plug it in the transport provider framework.


Method Summary
 void close()
          Closes the transport interface after communication is over.
 void open(ProtocolOptions options)
          Opens the transport interface over which the data is sent/received.
 int read(SnmpTransportPacket buf)
          Receive data from the peer over the transport interface.
 void write(SnmpTransportPacket buf)
          Sends data to the peer over the transport interface.
 

Method Detail

open

public void open(ProtocolOptions options)
          throws java.io.IOException
Opens the transport interface over which the data is sent/received.
Parameters:
options - protocol options required for opening the SNMP session.
Throws:
java.io.IOException - in case of an error during opening the transport interface.

read

public int read(SnmpTransportPacket buf)
         throws java.io.IOException
Receive data from the peer over the transport interface.
Parameters:
buf - Transport packet containing the packet buffer in which the bytes will be read.
Returns:
number of bytes actually read from the transport interface.
Throws:
java.io.IOException - in case of an error occurs while receiving.

write

public void write(SnmpTransportPacket buf)
           throws java.io.IOException
Sends data to the peer over the transport interface.
Parameters:
buf - the transport packet that contains the destination information and the SNMP message to be sent.
Throws:
java.io.IOException - in case of an error during sending.

close

public void close()
           throws java.io.IOException
Closes the transport interface after communication is over.
Throws:
java.io.IOException - in case of an error during closing.


Copyright (c)AdventNet Inc., 1996-2004