Class SudoStreamSnapshots
- java.lang.Object
-
- org.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
-
- org.eclipse.ditto.internal.models.streaming.SudoStreamSnapshots
-
- All Implemented Interfaces:
org.eclipse.ditto.base.model.headers.DittoHeadersSettable<SudoStreamSnapshots>,org.eclipse.ditto.base.model.headers.WithDittoHeaders,org.eclipse.ditto.base.model.headers.WithManifest,org.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>,org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate<org.eclipse.ditto.json.JsonObject,org.eclipse.ditto.json.JsonField>,org.eclipse.ditto.base.model.signals.commands.Command<SudoStreamSnapshots>,org.eclipse.ditto.base.model.signals.Signal<SudoStreamSnapshots>,org.eclipse.ditto.base.model.signals.WithName,org.eclipse.ditto.base.model.signals.WithResource,org.eclipse.ditto.base.model.signals.WithType,StartStreamRequest,StreamingMessage
@Immutable @AllValuesAreNonnullByDefault public final class SudoStreamSnapshots extends org.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots> implements StartStreamRequest
Command which starts a stream of snapshots.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.ditto.base.model.signals.commands.Command
org.eclipse.ditto.base.model.signals.commands.Command.Category
-
Nested classes/interfaces inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable
org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelectorAndPredicate<T extends java.lang.Object>, org.eclipse.ditto.base.model.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,T extends java.lang.Object>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTYPEType of this command.-
Fields inherited from interface org.eclipse.ditto.base.model.signals.commands.Command
TYPE_QUALIFIER
-
Fields inherited from interface org.eclipse.ditto.internal.models.streaming.StreamingMessage
TYPE_PREFIX
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendPayload(org.eclipse.ditto.json.JsonObjectBuilder jsonObjectBuilder, org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> thePredicate)protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object obj)static SudoStreamSnapshotsfromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)Creates a newSudoStreamSnapshotsfrom a JSON object.intgetBurst()Returns the streaming burst.org.eclipse.ditto.base.model.signals.commands.Command.CategorygetCategory()org.eclipse.ditto.base.model.entity.id.EntityIdgetLowerBound()Return the lower-bound PID to resume a stream.org.eclipse.ditto.json.JsonPointergetResourcePath()java.lang.StringgetResourceType()org.eclipse.ditto.json.JsonArraygetSnapshotFields()Return snapshot fields to request for each streamed snapshot.longgetTimeoutMillis()Returns the timeout in milliseconds.java.lang.StringgetTypePrefix()inthashCode()booleanhasNonEmptyLowerBound()Return whether the command has a non-empty lower bound.static SudoStreamSnapshotsof(java.lang.Integer burst, java.lang.Long timeoutMillis, java.util.List<java.lang.String> fields, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders, org.eclipse.ditto.base.model.entity.type.EntityType entityType)Creates a newSudoStreamSnapshotscommand.SudoStreamSnapshotssetDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)java.lang.StringtoString()SudoStreamSnapshotswithLowerBound(org.eclipse.ditto.base.model.entity.id.EntityId lowerBound)Create a copy of this command with a lower-bound set.-
Methods inherited from class org.eclipse.ditto.base.model.signals.commands.AbstractCommand
getDittoHeaders, getManifest, getType, toJson
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.ditto.base.model.signals.commands.Command
getImplementedSchemaVersion, toJson
-
Methods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable
getLatestSchemaVersion, getSupportedSchemaVersions, implementsSchemaVersion, implementsSchemaVersion, toJsonString
-
-
-
-
Field Detail
-
TYPE
public static final java.lang.String TYPE
Type of this command.- See Also:
- Constant Field Values
-
-
Method Detail
-
of
public static SudoStreamSnapshots of(java.lang.Integer burst, java.lang.Long timeoutMillis, java.util.List<java.lang.String> fields, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders, org.eclipse.ditto.base.model.entity.type.EntityType entityType)
Creates a newSudoStreamSnapshotscommand.- Parameters:
burst- the amount of snapshots to read in a batch.timeoutMillis- maximum time to wait for acknowledgement of each stream element.fields- selected fields of snapshots.dittoHeaders- the command headers of the request.entityType- the entity type that should be streamed.- Returns:
- the command.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
fromJson
public static SudoStreamSnapshots fromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
Creates a newSudoStreamSnapshotsfrom a JSON object.- Parameters:
jsonObject- the JSON representation of the command.dittoHeaders- the optional command headers of the request.- Returns:
- the command.
- Throws:
java.lang.NullPointerException- ifjsonObjectisnull.org.eclipse.ditto.json.JsonMissingFieldException- if the passed injsonObjectwas not in the expected format.
-
withLowerBound
public SudoStreamSnapshots withLowerBound(org.eclipse.ditto.base.model.entity.id.EntityId lowerBound)
Create a copy of this command with a lower-bound set. The lower bound must be a full PID consisting of a prefix and an entity ID.- Parameters:
lowerBound- the lower bound.- Returns:
- a copy of this command with lower-bound set.
-
getLowerBound
public org.eclipse.ditto.base.model.entity.id.EntityId getLowerBound()
Return the lower-bound PID to resume a stream.- Returns:
- the lower-bound PID.
-
hasNonEmptyLowerBound
public boolean hasNonEmptyLowerBound()
Return whether the command has a non-empty lower bound.- Returns:
- whether the command has a non-empty lower bound.
-
getSnapshotFields
public org.eclipse.ditto.json.JsonArray getSnapshotFields()
Return snapshot fields to request for each streamed snapshot.- Returns:
- the requested snapshot fields.
-
getBurst
public int getBurst()
Description copied from interface:StartStreamRequestReturns the streaming burst.- Specified by:
getBurstin interfaceStartStreamRequest- Returns:
- number of elements to send per message.
-
getTimeoutMillis
public long getTimeoutMillis()
Description copied from interface:StartStreamRequestReturns the timeout in milliseconds.- Specified by:
getTimeoutMillisin interfaceStartStreamRequest- Returns:
- the timeout.
-
appendPayload
protected void appendPayload(org.eclipse.ditto.json.JsonObjectBuilder jsonObjectBuilder, org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> thePredicate)- Specified by:
appendPayloadin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
-
getTypePrefix
public java.lang.String getTypePrefix()
- Specified by:
getTypePrefixin interfaceorg.eclipse.ditto.base.model.signals.commands.Command<SudoStreamSnapshots>
-
getCategory
public org.eclipse.ditto.base.model.signals.commands.Command.Category getCategory()
- Specified by:
getCategoryin interfaceorg.eclipse.ditto.base.model.signals.commands.Command<SudoStreamSnapshots>
-
setDittoHeaders
public SudoStreamSnapshots setDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
- Specified by:
setDittoHeadersin interfaceorg.eclipse.ditto.base.model.signals.commands.Command<SudoStreamSnapshots>- Specified by:
setDittoHeadersin interfaceorg.eclipse.ditto.base.model.headers.DittoHeadersSettable<SudoStreamSnapshots>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classorg.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
-
equals
public boolean equals(@Nullable java.lang.Object obj)- Overrides:
equalsin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
-
canEqual
protected boolean canEqual(@Nullable java.lang.Object other)- Overrides:
canEqualin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
-
getResourcePath
public org.eclipse.ditto.json.JsonPointer getResourcePath()
- Specified by:
getResourcePathin interfaceorg.eclipse.ditto.base.model.signals.WithResource
-
getResourceType
public java.lang.String getResourceType()
- Specified by:
getResourceTypein interfaceorg.eclipse.ditto.base.model.signals.WithResource
-
-