AmqpsConnection Class
- java.
lang. Object - BaseHandler
- ErrorLoggingBaseHandler
- ErrorLoggingBaseHandlerWithCleanup
- com.
microsoft. azure. sdk. iot. provisioning. device. transport. amqp. AmqpsConnection
- com.
public class AmqpsConnection extends ErrorLoggingBaseHandlerWithCleanup
Constructor Summary
Constructor | Description |
---|---|
AmqpsConnection(String hostName, AmqpDeviceOperations amqpDeviceOperations, SSLContext sslContext, SaslHandler saslHandler, boolean useWebSockets) |
Constructor for the Amqp library |
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection |
String | getConnectionId() |
String | getHostName() |
boolean |
isConnected()
Returns the status of the connection |
void | onConnectionBound(Event event) |
void |
onConnectionInit(Event event)
Event handler for the connection init event |
void | onConnectionUnbound(Event event) |
void |
onDelivery(Event event)
Event handler for the delivery event. This method handles both sending and receiving a message. |
void |
onLinkFlow(Event event)
Event handler for the link flow event. Handles sending a single message. |
void |
onLinkInit(Event event)
Event handler for the link init event. Sets the proper target address on the link. |
void |
onLinkRemoteOpen(Event event)
Event handler for the link remote open event. This signifies that the org.apache.qpid.proton.reactor.Reactor is ready, so we set the connection to OPEN. |
void | onReactorFinal(Event event) |
void |
onReactorInit(Event event)
Event handler for reactor init event. |
void |
onTransportError(Event event)
Event handler for the transport error event. This triggers reconnection attempts until successful. |
void | onTransportHeadClosed(Event event) |
void |
open()
Opens the connection. |
void |
openAmqpAsync()
Spawns another thread that attempts to open the AMQP connection. Use isConnected() to check when this operation has succeeded. Do not attempt to send messages before this connection has been opened |
boolean |
sendAmqpMessage(AmqpMessage message)
Send message to the Amqp Endpoint |
void |
setListener(AmqpListener listener)
Sets the listener for this connection. |
Inherited Members
Constructor Details
AmqpsConnection
public AmqpsConnection(String hostName, AmqpDeviceOperations amqpDeviceOperations, SSLContext sslContext, SaslHandler saslHandler, boolean useWebSockets)
Constructor for the Amqp library
Parameters:
Throws:
Method Details
close
public void close()
Closes the connection
Throws:
getConnectionId
public String getConnectionId()
getHostName
public String getHostName()
isConnected
public boolean isConnected()
Returns the status of the connection
Returns:
onConnectionBound
public void onConnectionBound(Event event)
Parameters:
onConnectionInit
public void onConnectionInit(Event event)
Event handler for the connection init event
Parameters:
onConnectionUnbound
public void onConnectionUnbound(Event event)
Parameters:
onDelivery
public void onDelivery(Event event)
Event handler for the delivery event. This method handles both sending and receiving a message.
Parameters:
onLinkFlow
public void onLinkFlow(Event event)
Event handler for the link flow event. Handles sending a single message.
Parameters:
onLinkInit
public void onLinkInit(Event event)
Event handler for the link init event. Sets the proper target address on the link.
Parameters:
onLinkRemoteOpen
public void onLinkRemoteOpen(Event event)
Event handler for the link remote open event. This signifies that the org.apache.qpid.proton.reactor.Reactor is ready, so we set the connection to OPEN.
Parameters:
onReactorFinal
public void onReactorFinal(Event event)
Parameters:
onReactorInit
public void onReactorInit(Event event)
Event handler for reactor init event.
Parameters:
onTransportError
public void onTransportError(Event event)
Event handler for the transport error event. This triggers reconnection attempts until successful.
Parameters:
onTransportHeadClosed
public void onTransportHeadClosed(Event event)
Parameters:
open
public void open()
Opens the connection.
Throws:
openAmqpAsync
public void openAmqpAsync()
Spawns another thread that attempts to open the AMQP connection. Use isConnected() to check when this operation has succeeded. Do not attempt to send messages before this connection has been opened
sendAmqpMessage
public boolean sendAmqpMessage(AmqpMessage message)
Send message to the Amqp Endpoint
Parameters:
Returns:
Throws:
setListener
public void setListener(AmqpListener listener)
Sets the listener for this connection.
Parameters:
Applies to
Azure SDK for Java