org.snmp4j.transport
Interface ConnectionOrientedTransportMapping

All Superinterfaces:
TransportMapping
All Known Implementing Classes:
DefaultTcpTransportMapping, TcpTransportMapping

public interface ConnectionOrientedTransportMapping
extends TransportMapping

Transport mappings for connection oriented transport protocols have to implement this interface.

Since:
1.7
Version:
1.7.1
Author:
Frank Fock

Method Summary
 void addTransportStateListener(TransportStateListener l)
          Adds a transport state listener that is to be informed about connection state changes.
 boolean close(Address remoteAddress)
          Closes the connection to the given remote address (socket).
 MessageLengthDecoder getMessageLengthDecoder()
          Returns the MessageLengthDecoder used by this transport mapping.
 void removeTransportStateListener(TransportStateListener l)
          Removes the supplied transport state listener.
 void setConnectionTimeout(long connectionTimeout)
          Sets the connection timeout.
 void setMessageLengthDecoder(MessageLengthDecoder messageLengthDecoder)
          Sets the MessageLengthDecoder that decodes the total message length from the header of a message.
 
Methods inherited from interface org.snmp4j.TransportMapping
addMessageDispatcher, addTransportListener, close, getListenAddress, getMaxInboundMessageSize, getSupportedAddressClass, isListening, listen, removeMessageDispatcher, removeTransportListener, sendMessage
 

Method Detail

getMessageLengthDecoder

MessageLengthDecoder getMessageLengthDecoder()
Returns the MessageLengthDecoder used by this transport mapping.

Returns:
a MessageLengthDecoder instance.

setMessageLengthDecoder

void setMessageLengthDecoder(MessageLengthDecoder messageLengthDecoder)
Sets the MessageLengthDecoder that decodes the total message length from the header of a message.

Parameters:
messageLengthDecoder - a MessageLengthDecoder instance.

setConnectionTimeout

void setConnectionTimeout(long connectionTimeout)
Sets the connection timeout. This timeout specifies the time a connection may be idle before it is closed.

Parameters:
connectionTimeout - the idle timeout in milliseconds. A zero or negative value will disable any timeout and connections opened by this transport mapping will stay opened until they are explicitly closed.

addTransportStateListener

void addTransportStateListener(TransportStateListener l)
Adds a transport state listener that is to be informed about connection state changes.

Parameters:
l - a TransportStateListener.

removeTransportStateListener

void removeTransportStateListener(TransportStateListener l)
Removes the supplied transport state listener.

Parameters:
l - a TransportStateListener.

close

boolean close(Address remoteAddress)
              throws java.io.IOException
Closes the connection to the given remote address (socket).

Parameters:
remoteAddress - the address of the remote socket.
Returns:
true if the connection could be closed and false if either the connection does not exists.
Throws:
java.io.IOException
Since:
1.7.1

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.