Class ReceiptPolicy

java.lang.Object
org.schlunzis.zis.stomp.client.ReceiptPolicy

public final class ReceiptPolicy extends Object

Policy for requesting receipts from the STOMP server. If the policy is enabled for a specific command, the client will request a receipt from the server for that command.

You can use the all() method to create a policy that requests receipts for all supported commands, or the none() method to create a policy that does not request any receipts. You can also use the add(Policy) method to add specific policies to an existing receipt policy.

A ReceiptPolicy can be set on the StompClientBuilder to define the default receipt policy for the client.

Since:
1.0.0
  • Method Details

    • all

      public static ReceiptPolicy all()
      Creates a receipt policy that requests receipts for all supported commands.
      Returns:
      a receipt policy that requests receipts for all supported commands
      Since:
      1.0.0
    • none

      public static ReceiptPolicy none()
      Creates a receipt policy that does not request any receipts.
      Returns:
      a receipt policy that does not request any receipts
      Since:
      1.0.0
    • add

      public ReceiptPolicy add(ReceiptPolicy.Policy policy)
      Adds a policy to request receipts for the specified command.
      Parameters:
      policy - the policy to add
      Returns:
      the receipt policy instance
      Since:
      1.0.0
    • isEnabled

      public boolean isEnabled(ReceiptPolicy.Policy policy)
      Checks if the receipt policy is enabled for the specified command.
      Parameters:
      policy - the policy to check
      Returns:
      true if the receipt policy is enabled for the specified command, false otherwise
      Since:
      1.0.0