|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.snmp4j.transport.AbstractTransportMapping
org.snmp4j.transport.TcpTransportMapping
public abstract class TcpTransportMapping
The TcpTransportMapping is the abstract base class for
TCP transport mappings.
| Field Summary | |
|---|---|
protected TcpAddress |
tcpAddress
|
| Fields inherited from class org.snmp4j.transport.AbstractTransportMapping |
|---|
asyncMsgProcessingSupported, maxInboundMessageSize, transportListener |
| Constructor Summary | |
|---|---|
TcpTransportMapping(TcpAddress tcpAddress)
|
|
| Method Summary | |
|---|---|
void |
addTransportStateListener(TransportStateListener l)
Adds a transport state listener that is to be informed about connection state changes. |
abstract void |
close()
Closes the transport an releases all bound resources synchronously. |
protected void |
fireConnectionStateChanged(TransportStateEvent change)
|
TcpAddress |
getAddress()
Returns the transport address that is used by this transport mapping for sending and receiving messages. |
Address |
getListenAddress()
Returns the address that represents the incoming address this transport mapping uses to listen for incoming packets. |
abstract MessageLengthDecoder |
getMessageLengthDecoder()
Returns the MessageLengthDecoder used by this transport
mapping. |
java.lang.Class |
getSupportedAddressClass()
Gets the Address class that is this transport mapping
supports. |
abstract void |
listen()
Listen for incoming messages. |
void |
removeTransportStateListener(TransportStateListener l)
Removes the supplied transport state listener. |
abstract void |
sendMessage(Address address,
byte[] message)
Sends a message to the supplied address using this transport. |
abstract void |
setConnectionTimeout(long connectionTimeout)
Sets the connection timeout. |
abstract void |
setMessageLengthDecoder(MessageLengthDecoder messageLengthDecoder)
Sets the MessageLengthDecoder that decodes the total
message length from the header of a message. |
| Methods inherited from class org.snmp4j.transport.AbstractTransportMapping |
|---|
addMessageDispatcher, addTransportListener, fireProcessMessage, getMaxInboundMessageSize, isAsyncMsgProcessingSupported, removeMessageDispatcher, removeTransportListener, setAsyncMsgProcessingSupported |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.snmp4j.transport.ConnectionOrientedTransportMapping |
|---|
close |
| Methods inherited from interface org.snmp4j.TransportMapping |
|---|
addMessageDispatcher, addTransportListener, getMaxInboundMessageSize, isListening, removeMessageDispatcher, removeTransportListener |
| Field Detail |
|---|
protected TcpAddress tcpAddress
| Constructor Detail |
|---|
public TcpTransportMapping(TcpAddress tcpAddress)
| Method Detail |
|---|
public java.lang.Class getSupportedAddressClass()
TransportMappingAddress class that is this transport mapping
supports.
getSupportedAddressClass in interface TransportMappinggetSupportedAddressClass in class AbstractTransportMappingAddress.public TcpAddress getAddress()
Address used by this transport mapping. The returned
instance must not be modified!public Address getListenAddress()
TransportMapping
getListenAddress in interface TransportMappingnull this transport
mapping is not configured to listen for incoming packets.
public abstract void sendMessage(Address address,
byte[] message)
throws java.io.IOException
TransportMapping
sendMessage in interface TransportMappingsendMessage in class AbstractTransportMappingaddress - an Address instance denoting the target address.message - the whole message as an array of bytes.
java.io.IOException
public abstract void listen()
throws java.io.IOException
TransportMappingTransportMapping.sendMessage(org.snmp4j.smi.Address, byte[]) is called for the
first time.
listen in interface TransportMappinglisten in class AbstractTransportMappingjava.io.IOException
public abstract void close()
throws java.io.IOException
TransportMapping
close in interface TransportMappingclose in class AbstractTransportMappingjava.io.IOExceptionpublic abstract MessageLengthDecoder getMessageLengthDecoder()
MessageLengthDecoder used by this transport
mapping.
getMessageLengthDecoder in interface ConnectionOrientedTransportMappingpublic abstract void setMessageLengthDecoder(MessageLengthDecoder messageLengthDecoder)
MessageLengthDecoder that decodes the total
message length from the header of a message.
setMessageLengthDecoder in interface ConnectionOrientedTransportMappingmessageLengthDecoder - a MessageLengthDecoder instance.public abstract void setConnectionTimeout(long connectionTimeout)
setConnectionTimeout in interface ConnectionOrientedTransportMappingconnectionTimeout - 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.public void addTransportStateListener(TransportStateListener l)
ConnectionOrientedTransportMapping
addTransportStateListener in interface ConnectionOrientedTransportMappingl - a TransportStateListener.public void removeTransportStateListener(TransportStateListener l)
ConnectionOrientedTransportMapping
removeTransportStateListener in interface ConnectionOrientedTransportMappingl - a TransportStateListener.protected void fireConnectionStateChanged(TransportStateEvent change)
|
Copyright 2003-2009 Frank Fock and Jochen Katz (SNMP4J.org) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||