Class SubscriptionAck
- java.lang.Object
-
- org.forgerock.openig.tools.notifications.ws.SubscriptionAck
-
public final class SubscriptionAck extends Object
ASubscriptionAckis a response message to aSubscriptionRequest. It can be a success or a failure acknowledgement. It is immutable.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SubscriptionAckfailedSubscription(String id, String message)Builds a failure acknowledgement.StringgetId()Returns the request message id.StringgetMessage()Returns acknowledgement message.StringgetTopic()Returns the name of the topic, subject of the (un-)subscription request (isnullfor failure).booleanisError()Returnstrueif this acknowledgment message is a failure,falseotherwise.booleanisSuccess()Returnstrueif this acknowledgment message is a success,falseotherwise.static SubscriptionAcksuccessfulSubscription(String id, String message, String topic)Builds a successful acknowledgement.
-
-
-
Method Detail
-
failedSubscription
public static SubscriptionAck failedSubscription(String id, String message)
Builds a failure acknowledgement.- Parameters:
id- correlation idmessage- 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 idmessage- success messagetopic- 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 (isnullfor failure).- Returns:
- the name of the topic (or
null).
-
isSuccess
public boolean isSuccess()
Returnstrueif this acknowledgment message is a success,falseotherwise.- Returns:
trueif this acknowledgment message is a success,falseotherwise.
-
isError
public boolean isError()
Returnstrueif this acknowledgment message is a failure,falseotherwise.- Returns:
trueif this acknowledgment message is a failure,falseotherwise.
-
getMessage
public String getMessage()
Returns acknowledgement message.- Returns:
- acknowledgement message.
-
-