public class DefaultSshTransportMapping extends AbstractTransportMapping<SshAddress>
DefaultSshTransportMapping
implements a TCP transport
mapping with TLS according to RFC 5592 (named SSHTM therein).Modifier and Type | Class and Description |
---|---|
protected class |
DefaultSshTransportMapping.SessionID |
asyncMsgProcessingSupported, maxInboundMessageSize, transportListener
Constructor and Description |
---|
DefaultSshTransportMapping(SshTransportAdapter transportAdapter) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the transport an releases all bound resources synchronously.
|
protected void |
fireIncrementCounter(CounterEvent e) |
SshAddress |
getListenAddress()
Returns the address that represents the actual incoming address this transport
mapping uses to listen for incoming packets.
|
Class<? extends Address> |
getSupportedAddressClass()
Gets the
Address class that is supported by this transport mapping. |
boolean |
isListening()
Returns
true if the transport mapping is listening for
incoming messages. |
void |
listen()
Listen for incoming messages.
|
protected SshSession |
openSession(SshAddress address,
TransportStateReference tmStateReference,
int maxMessageSize) |
void |
sendMessage(SshAddress address,
byte[] message,
TransportStateReference tmStateReference)
Sends a message to the supplied address using this transport.
|
addTransportListener, fireProcessMessage, getMaxInboundMessageSize, isAsyncMsgProcessingSupported, removeTransportListener, setAsyncMsgProcessingSupported
public DefaultSshTransportMapping(SshTransportAdapter transportAdapter)
public Class<? extends Address> getSupportedAddressClass()
TransportMapping
Address
class that is supported by this transport mapping.getSupportedAddressClass
in interface TransportMapping<SshAddress>
getSupportedAddressClass
in class AbstractTransportMapping<SshAddress>
Address
.public SshAddress getListenAddress()
TransportMapping
null
this transport
mapping is not configured to listen for incoming packets.public void sendMessage(SshAddress address, byte[] message, TransportStateReference tmStateReference) throws IOException
TransportMapping
sendMessage
in interface TransportMapping<SshAddress>
sendMessage
in class AbstractTransportMapping<SshAddress>
address
- an Address
instance 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.IOException
- if any underlying IO operation fails.protected SshSession openSession(SshAddress address, TransportStateReference tmStateReference, int maxMessageSize)
public void close() throws IOException
TransportMapping
close
in interface TransportMapping<SshAddress>
close
in class AbstractTransportMapping<SshAddress>
IOException
- if any IO operation for the close fails.public void listen() throws IOException
TransportMapping
TransportMapping.sendMessage(A, byte[], org.snmp4j.TransportStateReference)
is called for the
first time.listen
in interface TransportMapping<SshAddress>
listen
in class AbstractTransportMapping<SshAddress>
IOException
- if an IO operation exception occurs while starting the listener.public boolean isListening()
TransportMapping
true
if 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.true
if this transport mapping is listening for messages.protected void fireIncrementCounter(CounterEvent e)
Copyright © 2020 SNMP4J.org. All rights reserved.