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 SubscriptionAck
failedSubscription
(String id, String message) Builds a failure acknowledgement.static SubscriptionAck
Decode 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 (isnull
for failure).boolean
isError()
Returnstrue
if this acknowledgment message is a failure,false
otherwise.boolean
Returnstrue
if this acknowledgment message is a success,false
otherwise.static SubscriptionAck
successfulSubscription
(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 (isnull
for failure).- Returns:
- the name of the topic (or
null
).
-
isSuccess
public boolean isSuccess()Returnstrue
if this acknowledgment message is a success,false
otherwise.- Returns:
true
if this acknowledgment message is a success,false
otherwise.
-
isError
public boolean isError()Returnstrue
if this acknowledgment message is a failure,false
otherwise.- Returns:
true
if this acknowledgment message is a failure,false
otherwise.
-
getMessage
Returns acknowledgement message.- Returns:
- acknowledgement message.
-
toString
-