Class ClientSender

All Implemented Interfaces:
AutoCloseable, Link<Sender>, Sender

public final class ClientSender extends ClientSenderLinkType<Sender> implements Sender
Proton based AMQP Sender
  • Method Details

    • send

      public Tracker send(Message<?> message) throws ClientException
      Description copied from interface: Sender
      Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit.

      Upon successfully sending the message the methods returns a Tracker that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.

      Specified by:
      send in interface Sender
      Parameters:
      message - the Message to send.
      Returns:
      the Tracker for the message delivery
      Throws:
      ClientException - if an error occurs while initiating the send operation.
    • send

      public Tracker send(Message<?> message, Map<String,Object> deliveryAnnotations) throws ClientException
      Description copied from interface: Sender
      Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.

      Upon successfully sending the message the methods returns a Tracker that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.

      Specified by:
      send in interface Sender
      Parameters:
      message - the Message to send.
      deliveryAnnotations - the delivery annotations that should be included in the sent Message.
      Returns:
      the Tracker for the message delivery
      Throws:
      ClientException - if an error occurs while initiating the send operation.
    • trySend

      public Tracker trySend(Message<?> message) throws ClientException
      Description copied from interface: Sender
      Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt.

      Upon successfully sending the message the methods returns a Tracker that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.

      Specified by:
      trySend in interface Sender
      Parameters:
      message - the Message to send if credit is available.
      Returns:
      the Tracker for the message delivery or null if no credit for sending.
      Throws:
      ClientException - if an error occurs while initiating the send operation.
    • trySend

      public Tracker trySend(Message<?> message, Map<String,Object> deliveryAnnotations) throws ClientException
      Description copied from interface: Sender
      Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.

      Upon successfully sending the message the methods returns a Tracker that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.

      Specified by:
      trySend in interface Sender
      Parameters:
      message - the Message to send if credit is available.
      deliveryAnnotations - the delivery annotations that should be included in the sent Message.
      Returns:
      the Tracker for the message delivery or null if no credit for sending.
      Throws:
      ClientException - if an error occurs while initiating the send operation.
    • self

      protected Sender self()
      Specified by:
      self in class ClientLinkType<Sender,Sender>
    • linkSpecificLocalOpenHandler

      protected void linkSpecificLocalOpenHandler()
      Specified by:
      linkSpecificLocalOpenHandler in class ClientLinkType<Sender,Sender>
    • recreateLinkForReconnect

      protected void recreateLinkForReconnect()
      Specified by:
      recreateLinkForReconnect in class ClientLinkType<Sender,Sender>
    • linkSpecificCleanupHandler

      protected void linkSpecificCleanupHandler(ClientException failureCause)
      Specified by:
      linkSpecificCleanupHandler in class ClientLinkType<Sender,Sender>
    • linkSpecificLocalCloseHandler

      protected void linkSpecificLocalCloseHandler()
      Specified by:
      linkSpecificLocalCloseHandler in class ClientLinkType<Sender,Sender>
    • linkSpecificRemoteOpenHandler

      protected void linkSpecificRemoteOpenHandler()
      Specified by:
      linkSpecificRemoteOpenHandler in class ClientLinkType<Sender,Sender>
    • linkSpecificRemoteCloseHandler

      protected void linkSpecificRemoteCloseHandler()
      Specified by:
      linkSpecificRemoteCloseHandler in class ClientLinkType<Sender,Sender>