Class SubscriptionAck
- java.lang.Object
-
- org.forgerock.openig.tools.notifications.ws.SubscriptionAck
-
public final class SubscriptionAck extends Object
ASubscriptionAck
is 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 SubscriptionAck
failedSubscription(String id, String message)
Builds a failure acknowledgement.static SubscriptionAck
fromJson(JsonValue message)
Decode a JSON encodedSubscriptionAck
.String
getId()
Returns the request message id.String
getMessage()
Returns acknowledgement message.String
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
isSuccess()
Returnstrue
if this acknowledgment message is a success,false
otherwise.static SubscriptionAck
successfulSubscription(String id, String message, String topic)
Builds a successful acknowledgement.String
toString()
-
-
-
Method Detail
-
fromJson
public static SubscriptionAck fromJson(JsonValue message)
Decode a JSON encodedSubscriptionAck
.- 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 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 (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
public String getMessage()
Returns acknowledgement message.- Returns:
- acknowledgement message.
-
-