Enum DittoHeaderDefinition

    • Enum Constant Detail

      • AUTHORIZATION_CONTEXT

        public static final DittoHeaderDefinition AUTHORIZATION_CONTEXT
        Header definition for the authorization context value.

        Key: "ditto-auth-context", Java type: JsonObject.

      • CORRELATION_ID

        public static final DittoHeaderDefinition CORRELATION_ID
        Header definition for correlation Id value.

        Key: "correlation-id", Java type: String.

      • SCHEMA_VERSION

        public static final DittoHeaderDefinition SCHEMA_VERSION
        Header definition for schema version value.

        Key: "version", Java type: int.

      • RESPONSE_REQUIRED

        public static final DittoHeaderDefinition RESPONSE_REQUIRED
        Header definition for response required value.

        Key: "response-required", Java type: boolean.

      • DRY_RUN

        public static final DittoHeaderDefinition DRY_RUN
        Header definition for dry run value.

        Key: "ditto-dry-run", Java type: boolean.

      • READ_SUBJECTS

        public static final DittoHeaderDefinition READ_SUBJECTS
        Header definition for read subjects value.

        Key: "read-subjects", Java type: JsonArray.

      • READ_REVOKED_SUBJECTS

        public static final DittoHeaderDefinition READ_REVOKED_SUBJECTS
        Header definition for subjects with revoked READ subjects.

        Key: "read-revoked-subjects", Java type: JsonArray.

        Since:
        1.1.0
      • CONTENT_TYPE

        public static final DittoHeaderDefinition CONTENT_TYPE
        Header definition for a signal's content-type.

        Key: "content-type", Java type: String.

      • REPLY_TO

        public static final DittoHeaderDefinition REPLY_TO
        Header definition for the reply to address. MUST be lower-case. "reply-to" is a standard internet message header (RFC-5322).

        Key: "reply-to", Java type: String.

        Since:
        1.1.0
      • CHANNEL

        public static final DittoHeaderDefinition CHANNEL
        Header definition for channel value meaning distinguishing between live/twin.

        Key: "ditto-channel", Java type: String.

      • ORIGIN

        public static final DittoHeaderDefinition ORIGIN
        Header definition for origin value that is set to the id of the originating session.

        Key: "ditto-origin", Java type: String.

      • IF_NONE_MATCH

        public static final DittoHeaderDefinition IF_NONE_MATCH
        Header definition for "If-None-Match".

        Key: "If-None-Match", Java type: String.

      • REPLY_TARGET

        public static final DittoHeaderDefinition REPLY_TARGET
        Header definition for the internal header "ditto-reply-target". This header is evaluated for responses to be published.

        Key: "ditto-reply-target", Java type: Integer.

      • INBOUND_PAYLOAD_MAPPER

        public static final DittoHeaderDefinition INBOUND_PAYLOAD_MAPPER
        Header definition for "ditto-inbound-payload-mapper".

        Key: "ditto-inbound-payload-mapper", Java type: String.

      • ORIGINATOR

        public static final DittoHeaderDefinition ORIGINATOR
        Header definition for the authorization subject that caused an event. External header of the same name is always discarded.

        Key: "ditto-originator", Java type: String.

      • REQUESTED_ACKS

        public static final DittoHeaderDefinition REQUESTED_ACKS
        Header definition for defining which acknowledgements ("ack") are requested for a command processed by Ditto.

        Key: "requested-acks", Java type: JsonArray.

        Since:
        1.1.0
      • TIMEOUT

        public static final DittoHeaderDefinition TIMEOUT
        Header definition for the timeout of a command or message.

        Key: "timeout", Java type: String.

        Since:
        1.1.0
      • ENTITY_ID

        public static final DittoHeaderDefinition ENTITY_ID
        Header definition for the entity id related to the command/event/response/error.

        Key: "ditto-entity-id", Java type: String.

        Since:
        1.1.0
      • WWW_AUTHENTICATE

        public static final DittoHeaderDefinition WWW_AUTHENTICATE
        Header definition for the response header defining which authentication method that should be used to gain access to a resource

        Key: "www-authenticate", Java type: String.

        Since:
        1.1.0
      • LOCATION

        public static final DittoHeaderDefinition LOCATION
        Header definition for the response header defining the HTTP "Location" where a new resource was created.

        Key: "location", Java type: String.

        Since:
        1.1.0
    • Method Detail

      • values

        public static DittoHeaderDefinition[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DittoHeaderDefinition c : DittoHeaderDefinition.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DittoHeaderDefinition valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • forKey

        public static Optional<HeaderDefinition> forKey​(@Nullable
                                                        CharSequence key)
        Finds an appropriate DittoHeaderKey for the specified key.
        Parameters:
        key - the key to look up.
        Returns:
        the DittoHeaderKey or an empty Optional.
      • shouldReadFromExternalHeaders

        public boolean shouldReadFromExternalHeaders()
        Description copied from interface: HeaderDefinition
        Returns whether Ditto reads this header from headers sent by externals.
        Specified by:
        shouldReadFromExternalHeaders in interface HeaderDefinition
        Returns:
        whether externals are allowed to set this header.
      • shouldWriteToExternalHeaders

        public boolean shouldWriteToExternalHeaders()
        Description copied from interface: HeaderDefinition
        Returns whether Ditto publishes this header to externals.
        Specified by:
        shouldWriteToExternalHeaders in interface HeaderDefinition
        Returns:
        whether externals are allowed to see this header.
      • validateValue

        public void validateValue​(@Nullable
                                  CharSequence value)
        Description copied from interface: HeaderDefinition
        Checks if the specified CharSequence is a valid representation of the Java type of this definition.

        For example, if the Java type of this Definition was int.class then the value "foo" would be invalid whereas the value 42 would be recognised to be valid.

        Specified by:
        validateValue in interface HeaderDefinition
        Parameters:
        value - the value to be validated.
        See Also:
        HeaderDefinition.getJavaType()