public class AmqpsConnection
extends org.apache.qpid.proton.engine.BaseHandler
| Constructor and Description |
|---|
AmqpsConnection(String hostName,
AmqpDeviceOperations amqpDeviceOperations,
SSLContext sslContext,
SaslHandler saslHandler,
boolean useWebSockets)
Constructor for the Amqp library
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection
|
boolean |
isConnected()
Returns the status of the connection
|
void |
onConnectionBound(org.apache.qpid.proton.engine.Event event) |
void |
onConnectionInit(org.apache.qpid.proton.engine.Event event)
Event handler for the connection init event
|
void |
onConnectionUnbound(org.apache.qpid.proton.engine.Event event) |
void |
onDelivery(org.apache.qpid.proton.engine.Event event)
Event handler for the delivery event.
|
void |
onLinkFlow(org.apache.qpid.proton.engine.Event event)
Event handler for the link flow event.
|
void |
onLinkInit(org.apache.qpid.proton.engine.Event event)
Event handler for the link init event.
|
void |
onLinkRemoteClose(org.apache.qpid.proton.engine.Event event)
Event handler for the link remote close event.
|
void |
onLinkRemoteOpen(org.apache.qpid.proton.engine.Event event)
Event handler for the link remote open event.
|
void |
onReactorFinal(org.apache.qpid.proton.engine.Event event) |
void |
onReactorInit(org.apache.qpid.proton.engine.Event event)
Event handler for reactor init event.
|
void |
onTransportError(org.apache.qpid.proton.engine.Event event)
Event handler for the transport error event.
|
void |
onTransportHeadClosed(org.apache.qpid.proton.engine.Event event) |
void |
open()
Opens the connection.
|
void |
openAmqpAsync()
Spawns another thread that attempts to open the AMQP connection.
|
boolean |
sendAmqpMessage(AmqpMessage message)
Send message to the Amqp Endpoint
|
void |
setListener(AmqpListener listener)
Sets the listener for this connection.
|
add, children, getHandler, getHandler, handle, onConnectionFinal, onConnectionLocalClose, onConnectionLocalOpen, onConnectionRemoteClose, onConnectionRemoteOpen, onLinkFinal, onLinkLocalClose, onLinkLocalDetach, onLinkLocalOpen, onLinkRemoteDetach, onReactorQuiesced, onSelectableError, onSelectableExpired, onSelectableFinal, onSelectableInit, onSelectableReadable, onSelectableUpdated, onSelectableWritable, onSessionFinal, onSessionInit, onSessionLocalClose, onSessionLocalOpen, onSessionRemoteClose, onSessionRemoteOpen, onTimerTask, onTransport, onTransportClosed, onTransportTailClosed, onUnhandled, setHandler, setHandlerpublic AmqpsConnection(String hostName, AmqpDeviceOperations amqpDeviceOperations, SSLContext sslContext, SaslHandler saslHandler, boolean useWebSockets) throws IOException
hostName - Name of the AMQP EndpointamqpDeviceOperations - Object holding details of the links used in this connectionsslContext - SSL Context to be set over TLS.saslHandler - The sasl frame handler. This may be null if no sasl frames will be exchanged (When using x509
authentication for example)useWebSockets - WebSockets to be used or disabled.IOException - This exception is thrown if for any reason constructor cannot succeed.public void setListener(AmqpListener listener)
listener - Listener to be used for this connection.public boolean isConnected()
throws Exception
Exceptionpublic void open()
throws IOException
IOException - If connection could not be opened.public void openAmqpAsync()
isConnected() to check when
this operation has succeeded. Do not attempt to send messages before this connection has been openedpublic void close()
throws IOException
IOException - If connection could not be closed.public void onReactorInit(org.apache.qpid.proton.engine.Event event)
onReactorInit in interface org.apache.qpid.proton.engine.CoreHandleronReactorInit in class org.apache.qpid.proton.engine.BaseHandlerevent - Proton Event objectpublic void onReactorFinal(org.apache.qpid.proton.engine.Event event)
onReactorFinal in interface org.apache.qpid.proton.engine.CoreHandleronReactorFinal in class org.apache.qpid.proton.engine.BaseHandlerpublic void onConnectionInit(org.apache.qpid.proton.engine.Event event)
onConnectionInit in interface org.apache.qpid.proton.engine.CoreHandleronConnectionInit in class org.apache.qpid.proton.engine.BaseHandlerevent - The Proton Event object.public void onConnectionBound(org.apache.qpid.proton.engine.Event event)
onConnectionBound in interface org.apache.qpid.proton.engine.CoreHandleronConnectionBound in class org.apache.qpid.proton.engine.BaseHandlerpublic void onConnectionUnbound(org.apache.qpid.proton.engine.Event event)
onConnectionUnbound in interface org.apache.qpid.proton.engine.CoreHandleronConnectionUnbound in class org.apache.qpid.proton.engine.BaseHandlerpublic void onLinkInit(org.apache.qpid.proton.engine.Event event)
onLinkInit in interface org.apache.qpid.proton.engine.CoreHandleronLinkInit in class org.apache.qpid.proton.engine.BaseHandlerevent - The Proton Event object.public void onLinkRemoteOpen(org.apache.qpid.proton.engine.Event event)
Reactor is ready, so we set the connection to OPEN.onLinkRemoteOpen in interface org.apache.qpid.proton.engine.CoreHandleronLinkRemoteOpen in class org.apache.qpid.proton.engine.BaseHandlerevent - The Proton Event object.public boolean sendAmqpMessage(AmqpMessage message) throws Exception
message - Message to be sentIOException - If message could not be sent.Exceptionpublic void onDelivery(org.apache.qpid.proton.engine.Event event)
onDelivery in interface org.apache.qpid.proton.engine.CoreHandleronDelivery in class org.apache.qpid.proton.engine.BaseHandlerevent - The Proton Event object.public void onLinkFlow(org.apache.qpid.proton.engine.Event event)
onLinkFlow in interface org.apache.qpid.proton.engine.CoreHandleronLinkFlow in class org.apache.qpid.proton.engine.BaseHandlerevent - The Proton Event object.public void onLinkRemoteClose(org.apache.qpid.proton.engine.Event event)
onLinkRemoteClose in interface org.apache.qpid.proton.engine.CoreHandleronLinkRemoteClose in class org.apache.qpid.proton.engine.BaseHandlerevent - The Proton Event object.public void onTransportError(org.apache.qpid.proton.engine.Event event)
onTransportError in interface org.apache.qpid.proton.engine.CoreHandleronTransportError in class org.apache.qpid.proton.engine.BaseHandlerevent - The Proton Event object.public void onTransportHeadClosed(org.apache.qpid.proton.engine.Event event)
onTransportHeadClosed in interface org.apache.qpid.proton.engine.CoreHandleronTransportHeadClosed in class org.apache.qpid.proton.engine.BaseHandlerCopyright © 2019. All rights reserved.