Package org.snmp4j.transport
Class DefaultSshTransportMapping
java.lang.Object
org.snmp4j.transport.AbstractTransportMapping<SshAddress>
org.snmp4j.transport.DefaultSshTransportMapping
- All Implemented Interfaces:
 TransportMapping<SshAddress>
The 
DefaultSshTransportMapping implements a TCP transport
 mapping with TLS according to RFC 5592 (named SSHTM therein).- Since:
 - 2.0
 - Version:
 - 2.0
 - Author:
 - Frank Fock
 
- 
Nested Class Summary
Nested Classes - 
Field Summary
Fields inherited from class org.snmp4j.transport.AbstractTransportMapping
asyncMsgProcessingSupported, maxInboundMessageSize, maxOutboundMessageSize, transportListener - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the transport an releases all bound resources synchronously.protected voidReturns the address that represents the actual incoming address this transport mapping uses to listen for incoming packets.Gets theAddressclass that is supported by this transport mapping.booleanReturnstrueif the transport mapping is listening for incoming messages.voidlisten()Listen for incoming messages.protected SshSessionopenSession(SshAddress address, TransportStateReference tmStateReference, int maxMessageSize) voidsendMessage(SshAddress address, byte[] message, TransportStateReference tmStateReference) Sends a message to the supplied address using this transport.Methods inherited from class org.snmp4j.transport.AbstractTransportMapping
addTransportListener, fireProcessMessage, getMaxInboundMessageSize, getMaxOutboundMessageSize, isAsyncMsgProcessingSupported, removeAllTransportListeners, removeTransportListener, setAsyncMsgProcessingSupported 
- 
Constructor Details
- 
DefaultSshTransportMapping
 
 - 
 - 
Method Details
- 
getSupportedAddressClass
Description copied from interface:TransportMappingGets theAddressclass that is supported by this transport mapping.- Specified by:
 getSupportedAddressClassin interfaceTransportMapping<SshAddress>- Specified by:
 getSupportedAddressClassin classAbstractTransportMapping<SshAddress>- Returns:
 - a subclass of 
Address. 
 - 
getListenAddress
Description copied from interface:TransportMappingReturns the address that represents the actual incoming address this transport mapping uses to listen for incoming packets.- Returns:
 - the address for incoming packets or 
nullthis transport mapping is not configured to listen for incoming packets. 
 - 
sendMessage
public void sendMessage(SshAddress address, byte[] message, TransportStateReference tmStateReference) throws IOException Description copied from interface:TransportMappingSends a message to the supplied address using this transport.- Specified by:
 sendMessagein interfaceTransportMapping<SshAddress>- Specified by:
 sendMessagein classAbstractTransportMapping<SshAddress>- Parameters:
 address- anAddressinstance denoting the target address.message- the whole message as an array of bytes.tmStateReference- the (optional) transport model state reference as defined by RFC 5590 section 6.1.- Throws:
 IOException- if any underlying IO operation fails.
 - 
openSession
protected SshSession openSession(SshAddress address, TransportStateReference tmStateReference, int maxMessageSize)  - 
close
Description copied from interface:TransportMappingCloses the transport an releases all bound resources synchronously.- Specified by:
 closein interfaceTransportMapping<SshAddress>- Specified by:
 closein classAbstractTransportMapping<SshAddress>- Throws:
 IOException- if any IO operation for the close fails.
 - 
listen
Description copied from interface:TransportMappingListen for incoming messages. For connection oriented transports, this method needs to be called beforeTransportMapping.sendMessage(A, byte[], org.snmp4j.TransportStateReference)is called for the first time.- Specified by:
 listenin interfaceTransportMapping<SshAddress>- Specified by:
 listenin classAbstractTransportMapping<SshAddress>- Throws:
 IOException- if an IO operation exception occurs while starting the listener.
 - 
isListening
public boolean isListening()Description copied from interface:TransportMappingReturnstrueif the transport mapping is listening for incoming messages. For connection oriented transport mappings this is a prerequisite to be able to send SNMP messages. For connectionless transport mappings it is a prerequisite to be able to receive responses.- Returns:
 trueif this transport mapping is listening for messages.
 - 
fireIncrementCounter
 
 -