Class SubscriptionAck
java.lang.Object
org.forgerock.openig.tools.notifications.ws.SubscriptionAck
A
SubscriptionAck is a response message to a SubscriptionRequest.
It can be a success or a failure acknowledgement.
It is immutable.-
Method Summary
Modifier and TypeMethodDescriptionstatic SubscriptionAckfailedSubscription(String id, String message) Builds a failure acknowledgement.static SubscriptionAckDecode a JSON encodedSubscriptionAck.getId()Returns the request message id.Returns acknowledgement message.getTopic()Returns the name of the topic, subject of the (un-)subscription request (isnullfor failure).booleanisError()Returnstrueif this acknowledgment message is a failure,falseotherwise.booleanReturnstrueif this acknowledgment message is a success,falseotherwise.static SubscriptionAcksuccessfulSubscription(String id, String message, String topic) Builds a successful acknowledgement.toString()
-
Method Details
-
fromJson
Decode a JSON encodedSubscriptionAck.- Parameters:
message- the jsonEncoded Ack- Returns:
- the decoded
SubscriptionAck.
-
failedSubscription
Builds a failure acknowledgement.- Parameters:
id- correlation idmessage- error message- Returns:
- a new failed subscription
-
successfulSubscription
Builds a successful acknowledgement.- Parameters:
id- correlation idmessage- success messagetopic- name of the subscribed topic- Returns:
- a new success subscription
-
getId
Returns the request message id. This can be used to correlate request and response messages together.- Returns:
- the request message id.
-
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
Returns acknowledgement message.- Returns:
- acknowledgement message
-
toString
-