Class SudoStreamPids
- java.lang.Object
-
- org.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamPids>
-
- org.eclipse.ditto.internal.models.streaming.SudoStreamPids
-
- All Implemented Interfaces:
org.eclipse.ditto.base.model.headers.DittoHeadersSettable<SudoStreamPids>,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<SudoStreamPids>,org.eclipse.ditto.base.model.signals.Signal<SudoStreamPids>,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 SudoStreamPids extends org.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamPids> implements StartStreamRequest
Command which starts a stream of persistence IDs with their latest snapshot revisions.
-
-
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, org.eclipse.ditto.base.model.signals.commands.Command.JsonFields
-
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 SudoStreamPidsfromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)Creates a newSudoStreamSnapshotRevisionsfrom a JSON object.intgetBurst()Returns the streaming burst.org.eclipse.ditto.base.model.signals.commands.Command.CategorygetCategory()EntityIdWithRevisiongetLowerBound()Return the lower-bound PID to resume a stream.org.eclipse.ditto.json.JsonPointergetResourcePath()java.lang.StringgetResourceType()longgetTimeoutMillis()Returns the timeout in milliseconds.java.lang.StringgetTypePrefix()inthashCode()booleanhasNonEmptyLowerBound()Return whether the command has a non-empty lower bound.static SudoStreamPidsof(java.lang.Integer burst, java.lang.Long timeoutMillis, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders, org.eclipse.ditto.base.model.entity.type.EntityType entityType)Creates a newSudoStreamPidscommand.SudoStreamPidssetDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)java.lang.StringtoString()SudoStreamPidswithLowerBound(EntityIdWithRevision<?> 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 SudoStreamPids of(java.lang.Integer burst, java.lang.Long timeoutMillis, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders, org.eclipse.ditto.base.model.entity.type.EntityType entityType)
Creates a newSudoStreamPidscommand.- Parameters:
burst- the amount of elements to be collected per messagetimeoutMillis- maximum time to wait for acknowledgement of each stream element.dittoHeaders- the command headers of the request.entityType- the type of the entity which should be streamed- Returns:
- the command.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
fromJson
public static SudoStreamPids fromJson(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
Creates a newSudoStreamSnapshotRevisionsfrom 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 SudoStreamPids withLowerBound(EntityIdWithRevision<?> 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 EntityIdWithRevision 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.
-
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<SudoStreamPids>
-
getTypePrefix
public java.lang.String getTypePrefix()
- Specified by:
getTypePrefixin interfaceorg.eclipse.ditto.base.model.signals.commands.Command<SudoStreamPids>
-
getCategory
public org.eclipse.ditto.base.model.signals.commands.Command.Category getCategory()
- Specified by:
getCategoryin interfaceorg.eclipse.ditto.base.model.signals.commands.Command<SudoStreamPids>
-
setDittoHeaders
public SudoStreamPids setDittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
- Specified by:
setDittoHeadersin interfaceorg.eclipse.ditto.base.model.signals.commands.Command<SudoStreamPids>- Specified by:
setDittoHeadersin interfaceorg.eclipse.ditto.base.model.headers.DittoHeadersSettable<SudoStreamPids>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classorg.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamPids>
-
equals
public boolean equals(@Nullable java.lang.Object obj)- Overrides:
equalsin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamPids>
-
canEqual
protected boolean canEqual(@Nullable java.lang.Object other)- Overrides:
canEqualin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamPids>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classorg.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamPids>
-
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
-
-