public final class SubscriptionAck extends Object
SubscriptionAck
is a response message to a SubscriptionRequest
.
It can be a success or a failure acknowledgement.
It is immutable.Modifier and Type | Method and Description |
---|---|
static SubscriptionAck |
failedSubscription(String id,
String message)
Builds a failure acknowledgement.
|
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 (is
null for failure). |
boolean |
isError()
Returns
true if this acknowledgment message is a failure, false otherwise. |
boolean |
isSuccess()
Returns
true if this acknowledgment message is a success, false otherwise. |
static SubscriptionAck |
successfulSubscription(String id,
String message,
String topic)
Builds a successful acknowledgement.
|
public static SubscriptionAck failedSubscription(String id, String message)
id
- correlation idmessage
- error messagepublic static SubscriptionAck successfulSubscription(String id, String message, String topic)
id
- correlation idmessage
- success messagetopic
- name of the subscribed topicpublic String getId()
public String getTopic()
null
for failure).null
).public boolean isSuccess()
true
if this acknowledgment message is a success, false
otherwise.true
if this acknowledgment message is a success, false
otherwise.public boolean isError()
true
if this acknowledgment message is a failure, false
otherwise.true
if this acknowledgment message is a failure, false
otherwise.public String getMessage()
Copyright 2011-2017 ForgeRock AS.