Package org.snmp4j.transport
Interface ConnectionOrientedTransportMapping<A extends Address>
- All Superinterfaces:
 TransportMapping<A>
- All Known Implementing Classes:
 DefaultTcpTransportMapping,TcpTransportMapping,TLSTM
Transport mappings for connection oriented transport protocols have to
 implement this interface.
- Since:
 - 1.7
 - Version:
 - 2.8.6
 - Author:
 - Frank Fock
 
- 
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a transport state listener that is to be informed about connection state changes.booleanCloses the connection to the given remote address (socket).Returns theMessageLengthDecoderused by this transport mapping.voidRemoves the supplied transport state listener.booleanresumeAddress(A addressToResumeSending) Resume sending of messages to the specified address.voidsetConnectionTimeout(long connectionTimeout) Sets the connection timeout.voidsetMessageLengthDecoder(MessageLengthDecoder messageLengthDecoder) Sets theMessageLengthDecoderthat decodes the total message length from the header of a message.voidsuspendAddress(A addressToSuspendSending) Suspend sending of messages to the specified address, regardless if a connection is already established or not.Methods inherited from interface org.snmp4j.TransportMapping
addTransportListener, close, getListenAddress, getMaxInboundMessageSize, getMaxOutboundMessageSize, getSupportedAddressClass, isListening, listen, removeTransportListener, sendMessage 
- 
Method Details
- 
getMessageLengthDecoder
MessageLengthDecoder getMessageLengthDecoder()Returns theMessageLengthDecoderused by this transport mapping.- Returns:
 - a MessageLengthDecoder instance.
 
 - 
setMessageLengthDecoder
Sets theMessageLengthDecoderthat 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
Adds a transport state listener that is to be informed about connection state changes.- Parameters:
 l- a TransportStateListener.
 - 
removeTransportStateListener
Removes the supplied transport state listener.- Parameters:
 l- a TransportStateListener.
 - 
close
Closes the connection to the given remote address (socket).- Parameters:
 remoteAddress- the address of the remote socket.- Returns:
 trueif the connection could be closed andfalseif the connection does not exists.- Throws:
 IOException- if closing the connection with the specified remote address fails.- Since:
 - 1.7.1
 
 - 
resumeAddress
Resume sending of messages to the specified address.- Parameters:
 addressToResumeSending- an arbitrary remote address for which any messages send byTransportMapping.sendMessage(Address, byte[], TransportStateReference)should be dropped before sending and reopening a connection to that address.- Returns:
 trueif the specified address was previously suspended and is now resumed to allow sending messages,falseotherwise.- Since:
 - 2.8.6
 
 - 
suspendAddress
Suspend sending of messages to the specified address, regardless if a connection is already established or not. To be able to send messages again to the specified address usingTransportMapping.sendMessage(Address, byte[], TransportStateReference), callresumeAddress(A).- Parameters:
 addressToSuspendSending- an arbitrary remote address for which any messages send byTransportMapping.sendMessage(Address, byte[], TransportStateReference)should be dropped before sending and reopening a connection to that address.- Since:
 - 2.8.6
 
 
 -