Class StreamAck
- java.lang.Object
-
- org.eclipse.ditto.services.utils.akka.streaming.StreamAck
-
- All Implemented Interfaces:
org.eclipse.ditto.model.base.json.Jsonifiable
@Immutable public final class StreamAck extends Object implements org.eclipse.ditto.model.base.json.Jsonifiable
Ack message that is used for acking elements while streaming.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStreamAck.StatusStatus of ACKs.-
Nested classes/interfaces inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable
org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<T extends Object>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,T extends Object>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static StreamAckfailure(String elementId)Create an failure ack.static StreamAckfromJson(org.eclipse.ditto.json.JsonObject jsonObject)Creates a newStreamAckfrom a JSON object.inthashCode()static StreamAcksuccess(String elementId)Create an successful ack.org.eclipse.ditto.json.JsonValuetoJson()StringtoString()
-
-
-
Method Detail
-
success
public static StreamAck success(String elementId)
Create an successful ack.- Parameters:
elementId- the element for which the ack is sent.- Returns:
- The StreamAck with status
StreamAck.Status.SUCCESS.
-
failure
public static StreamAck failure(String elementId)
Create an failure ack.- Parameters:
elementId- the element for which the ack is sent.}.- Returns:
- The StreamAck with status
StreamAck.Status.FAILURE.
-
toJson
public org.eclipse.ditto.json.JsonValue toJson()
- Specified by:
toJsonin interfaceorg.eclipse.ditto.model.base.json.Jsonifiable
-
fromJson
public static StreamAck fromJson(org.eclipse.ditto.json.JsonObject jsonObject)
Creates a newStreamAckfrom a JSON object.- Parameters:
jsonObject- the JSON object of which a new StreamAck is to be created.- Returns:
- the StreamAck which was created from the given JSON object.
- Throws:
NullPointerException- ifjsonObjectisnull.IllegalArgumentException- ifjsonObjectis empty.org.eclipse.ditto.json.JsonParseException- if the passed injsonObjectis not valid JSON.org.eclipse.ditto.json.JsonMissingFieldException- if the passed injsonObjectwas not in the expected 'StreamAck' format.
-
-