Class SubscriptionAck

java.lang.Object
org.forgerock.openig.tools.notifications.ws.SubscriptionAck

public final class SubscriptionAck extends Object
A SubscriptionAck is a response message to a SubscriptionRequest. It can be a success or a failure acknowledgement. It is immutable.
  • Method Details

    • fromJson

      public static SubscriptionAck fromJson(JsonValue message)
      Decode a JSON encoded SubscriptionAck.
      Parameters:
      message - the jsonEncoded Ack
      Returns:
      the decoded SubscriptionAck.
    • failedSubscription

      public static SubscriptionAck failedSubscription(String id, String message)
      Builds a failure acknowledgement.
      Parameters:
      id - correlation id
      message - error message
      Returns:
      a new failed subscription
    • successfulSubscription

      public static SubscriptionAck successfulSubscription(String id, String message, String topic)
      Builds a successful acknowledgement.
      Parameters:
      id - correlation id
      message - success message
      topic - name of the subscribed topic
      Returns:
      a new success subscription
    • getId

      public String getId()
      Returns the request message id. This can be used to correlate request and response messages together.
      Returns:
      the request message id.
    • getTopic

      public String getTopic()
      Returns the name of the topic, subject of the (un-)subscription request (is null for failure).
      Returns:
      the name of the topic (or null).
    • isSuccess

      public boolean isSuccess()
      Returns true if this acknowledgment message is a success, false otherwise.
      Returns:
      true if this acknowledgment message is a success, false otherwise.
    • isError

      public boolean isError()
      Returns true if this acknowledgment message is a failure, false otherwise.
      Returns:
      true if this acknowledgment message is a failure, false otherwise.
    • getMessage

      public String getMessage()
      Returns acknowledgement message.
      Returns:
      acknowledgement message.
    • toString

      public String toString()
      Overrides:
      toString in class Object