Class RequestResponseApiConstants

    • Field Detail

      • CONTENT_TYPE_APPLICATION_JSON

        public static final String CONTENT_TYPE_APPLICATION_JSON
        The MIME type representing the String representation of a JSON Object.
        See Also:
        Constant Field Values
      • FIELD_PAYLOAD_DEFAULTS

        public static final String FIELD_PAYLOAD_DEFAULTS
        The name of the property which contains default properties that protocol adapters should add to messages published by a device.
        See Also:
        Constant Field Values
      • FIELD_PAYLOAD_DEVICE_ID

        public static final String FIELD_PAYLOAD_DEVICE_ID
        The name of the property that contains the identifier of a device.
        See Also:
        Constant Field Values
      • FIELD_PAYLOAD_SUBJECT_DN

        public static final String FIELD_PAYLOAD_SUBJECT_DN
        The name of the property that contains the subject DN of the CA certificate that has been configured for a tenant. The subject DN is serialized as defined by RFC 2253, Section 2.
        See Also:
        Constant Field Values
      • FIELD_PAYLOAD_TENANT_ID

        public static final String FIELD_PAYLOAD_TENANT_ID
        The name of the property that contains the identifier of a tenant.
        See Also:
        Constant Field Values
      • FIELD_ENABLED

        public static final String FIELD_ENABLED
        The name of the field that contains a boolean indicating the status of an entity.
        See Also:
        Constant Field Values
      • FIELD_ERROR

        public static final String FIELD_ERROR
        The name of the field that contains additional information about an error that has occurred while processing a request message.
        See Also:
        Constant Field Values
      • FIELD_PAYLOAD

        public static final String FIELD_PAYLOAD
        The name of the field that contains the payload of a request or response message.
        See Also:
        Constant Field Values
      • FIELD_OBJECT_ID

        public static final String FIELD_OBJECT_ID
        The name of the field that contains the identifier of the object.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RequestResponseApiConstants

        protected RequestResponseApiConstants()
        Empty default constructor.
    • Method Detail

      • getAmqpReply

        public static final org.apache.qpid.proton.message.Message getAmqpReply​(String endpoint,
                                                                                EventBusMessage response)
        Creates an AMQP message from a response to a service invocation.
        Parameters:
        endpoint - The service endpoint that the operation has been invoked on.
        response - The response message.
        Returns:
        The AMQP message.
        Throws:
        NullPointerException - if endpoint is null.
        IllegalArgumentException - if the response does not contain a correlation ID.
      • getAmqpReply

        public static final org.apache.qpid.proton.message.Message getAmqpReply​(String endpoint,
                                                                                String tenantId,
                                                                                org.apache.qpid.proton.message.Message request,
                                                                                RequestResponseResult<io.vertx.core.json.JsonObject> result)
        Creates an AMQP message from a result to a service invocation.
        Parameters:
        endpoint - The service endpoint that the operation has been invoked on.
        tenantId - The id of the tenant (may be null).
        request - The request message.
        result - The result message.
        Returns:
        The AMQP message.
        Throws:
        NullPointerException - if endpoint, request or result is null.
        IllegalArgumentException - if the result does not contain a correlation ID.
      • getErrorMessage

        public static final org.apache.qpid.proton.message.Message getErrorMessage​(int status,
                                                                                   String errorDescription,
                                                                                   org.apache.qpid.proton.message.Message requestMessage)
        Creates an AMQP (response) message for conveying an erroneous outcome of an operation.
        Parameters:
        status - The status code.
        errorDescription - An (optional) error description which will be put to a Data section.
        requestMessage - The request message.
        Returns:
        The response message.