Class DummyTransport.DummyTransportResponder
java.lang.Object
org.snmp4j.transport.AbstractTransportMapping<A>
org.snmp4j.transport.DummyTransport.DummyTransportResponder
- All Implemented Interfaces:
Closeable, AutoCloseable, TransportMapping<A>
- Enclosing class:
DummyTransport<A extends IpAddress>
- Since:
- 2.0
- Author:
- Frank Fock
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this resource and releases any associated system resources.Returns the address that represents the actual incoming address this transport mapping uses to listen for incoming packets.Gets theWorkerTaskthat is responsible for receiving new messages.Gets the primaryAddressclass that is supported by this transport mapping.booleanReturnstrueif the transport mapping is listening for incoming messages.voidlisten()Starts listening for incoming connections or events.voidsendMessage(A address, byte[] message, TransportStateReference tmStateReference, long timeoutMillis, int retries) Sends a message to the supplied address using this transport.Methods inherited from class AbstractTransportMapping
addTransportAuditListener, addTransportListener, addTransportStateListener, fireConnectionStateChanged, fireProcessMessage, fireTransportAuditEvent, getAuditListenAddress, getMaxInboundMessageSize, getPriority, getSocketCleaner, getSuspendedAddresses, getThreadName, handleDroppedMessageToSend, isAsyncMsgProcessingSupported, isTransportAudit, removeAllTransportAuditListeners, removeAllTransportListeners, removeTransportAuditListener, removeTransportListener, removeTransportStateListener, resumeAddress, setAsyncMsgProcessingSupported, setPriority, setThreadName, suspendAddressMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TransportMapping
getMaxOutboundMessageSize, getSupportedAddressClasses, getSupportedTransportType, isAddressSupported, isAddressSupported
-
Constructor Details
-
DummyTransportResponder
public DummyTransportResponder()
-
-
Method Details
-
getSupportedAddressClass
Description copied from interface:TransportMappingGets the primaryAddressclass that is supported by this transport mapping.- Specified by:
getSupportedAddressClassin interfaceTransportMapping<A extends IpAddress>- Specified by:
getSupportedAddressClassin classAbstractTransportMapping<A extends IpAddress>- 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.- Specified by:
getListenAddressin interfaceTransportMapping<A extends IpAddress>- Specified by:
getListenAddressin classAbstractTransportMapping<A extends IpAddress>- Returns:
- the address for incoming packets or
nullthis transport mapping is not configured to listen for incoming packets.
-
sendMessage
public void sendMessage(A address, byte[] message, TransportStateReference tmStateReference, long timeoutMillis, int retries) throws IOException Description copied from class:AbstractTransportMappingSends a message to the supplied address using this transport. If the target address has been suspended, then instead actually sending the message on the wire, the methodAbstractTransportMapping.handleDroppedMessageToSend(Address, byte[], TransportStateReference, long, int)will be called. To stop suspending of a target address, callAbstractTransportMapping.resumeAddress(Address)for that address.- Specified by:
sendMessagein interfaceTransportMapping<A extends IpAddress>- Specified by:
sendMessagein classAbstractTransportMapping<A extends IpAddress>- 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.timeoutMillis- maximum number of milliseconds the connection creation might take (if connection-based).retries- maximum retries during connection creation.- Throws:
IOException- if any underlying IO operation fails.
-
close
Description copied from class:AbstractTransportMappingCloses this resource and releases any associated system resources. If the resource is already closed, invoking this method has no effect.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceTransportMapping<A extends IpAddress>- Specified by:
closein classAbstractTransportMapping<A extends IpAddress>- Throws:
IOException- if an I/O error occurs while closing the resource
-
listen
Description copied from class:AbstractTransportMappingStarts listening for incoming connections or events. This method is intended to be implemented by subclasses to define the specific behavior required for listening operations in various contexts (e.g., network connections, event streams).- Specified by:
listenin interfaceTransportMapping<A extends IpAddress>- Specified by:
listenin classAbstractTransportMapping<A extends IpAddress>- Throws:
IOException- if an I/O error occurs during the listening process.
-
getListenWorkerTask
Description copied from class:AbstractTransportMappingGets theWorkerTaskthat is responsible for receiving new messages.- Overrides:
getListenWorkerTaskin classAbstractTransportMapping<A extends IpAddress>- Returns:
- a
WorkerTaskinstance which is most likely aDefaultThreadFactory.WorkerThread.
-
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.- Specified by:
isListeningin interfaceTransportMapping<A extends IpAddress>- Overrides:
isListeningin classAbstractTransportMapping<A extends IpAddress>- Returns:
trueif this transport mapping is listening for messages.
-