Class 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.String TYPE
      Type of this command.
      • Fields inherited from interface org.eclipse.ditto.base.model.signals.commands.Command

        TYPE_QUALIFIER
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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)  
      protected boolean canEqual​(java.lang.Object other)  
      boolean equals​(java.lang.Object obj)  
      static SudoStreamSnapshots fromJson​(org.eclipse.ditto.json.JsonObject jsonObject, org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
      Creates a new SudoStreamSnapshots from a JSON object.
      int getBurst()
      Returns the streaming burst.
      org.eclipse.ditto.base.model.signals.commands.Command.Category getCategory()  
      org.eclipse.ditto.base.model.entity.id.EntityId getLowerBound()
      Return the lower-bound PID to resume a stream.
      org.eclipse.ditto.json.JsonPointer getResourcePath()  
      java.lang.String getResourceType()  
      org.eclipse.ditto.json.JsonArray getSnapshotFields()
      Return snapshot fields to request for each streamed snapshot.
      long getTimeoutMillis()
      Returns the timeout in milliseconds.
      java.lang.String getTypePrefix()  
      int hashCode()  
      boolean hasNonEmptyLowerBound()
      Return whether the command has a non-empty lower bound.
      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 new SudoStreamSnapshots command.
      SudoStreamSnapshots setDittoHeaders​(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)  
      java.lang.String toString()  
      SudoStreamSnapshots withLowerBound​(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
      • Methods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate

        toJson, toJsonString, toJsonString
      • Methods inherited from interface org.eclipse.ditto.base.model.signals.Signal

        getName
    • Field Detail

    • 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 new SudoStreamSnapshots command.
        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 is null.
      • fromJson

        public static SudoStreamSnapshots fromJson​(org.eclipse.ditto.json.JsonObject jsonObject,
                                                   org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
        Creates a new SudoStreamSnapshots from 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 - if jsonObject is null.
        org.eclipse.ditto.json.JsonMissingFieldException - if the passed in jsonObject was 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: StartStreamRequest
        Returns the streaming burst.
        Specified by:
        getBurst in interface StartStreamRequest
        Returns:
        number of elements to send per message.
      • 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:
        appendPayload in class org.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
      • getTypePrefix

        public java.lang.String getTypePrefix()
        Specified by:
        getTypePrefix in interface org.eclipse.ditto.base.model.signals.commands.Command<SudoStreamSnapshots>
      • getCategory

        public org.eclipse.ditto.base.model.signals.commands.Command.Category getCategory()
        Specified by:
        getCategory in interface org.eclipse.ditto.base.model.signals.commands.Command<SudoStreamSnapshots>
      • setDittoHeaders

        public SudoStreamSnapshots setDittoHeaders​(org.eclipse.ditto.base.model.headers.DittoHeaders dittoHeaders)
        Specified by:
        setDittoHeaders in interface org.eclipse.ditto.base.model.signals.commands.Command<SudoStreamSnapshots>
        Specified by:
        setDittoHeaders in interface org.eclipse.ditto.base.model.headers.DittoHeadersSettable<SudoStreamSnapshots>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class org.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object obj)
        Overrides:
        equals in class org.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
      • canEqual

        protected boolean canEqual​(@Nullable
                                   java.lang.Object other)
        Overrides:
        canEqual in class org.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class org.eclipse.ditto.base.model.signals.commands.AbstractCommand<SudoStreamSnapshots>
      • getResourcePath

        public org.eclipse.ditto.json.JsonPointer getResourcePath()
        Specified by:
        getResourcePath in interface org.eclipse.ditto.base.model.signals.WithResource
      • getResourceType

        public java.lang.String getResourceType()
        Specified by:
        getResourceType in interface org.eclipse.ditto.base.model.signals.WithResource