Class GXOutboundSuccessResponse


  • public class GXOutboundSuccessResponse
    extends Object
    An outbound success response message for applications.
    Author:
    Manuele Simi (ISTI CNR)
    • Method Detail

      • newOKResponse

        public static GXOutboundSuccessResponse newOKResponse()
        Builds a new response with the OK HTTP status.
        Returns:
        the updated response
      • newCREATEResponse

        public static GXOutboundSuccessResponse newCREATEResponse​(URI location)
        Builds a new response with the CREATE HTTP status.
        Returns:
        the updated response
      • withContent

        public GXOutboundSuccessResponse withContent​(Object o)
                                              throws IOException
        Sets the object as response's content. Any Java type instance for a response entity, that is supported by the runtime can be passed.
        Parameters:
        o - the content
        Returns:
        the updated response
        Throws:
        IOException
      • withContent

        public GXOutboundSuccessResponse withContent​(String message)
        Sets the message as the response's content.
        Parameters:
        message -
        Returns:
        the updated response
      • ofType

        public GXOutboundSuccessResponse ofType​(jakarta.ws.rs.core.MediaType type)
        Adds a type to the response message.
        Parameters:
        type -
        Returns:
        the updated response
      • withHeader

        public GXOutboundSuccessResponse withHeader​(String name,
                                                    Object value)
        Add an arbitrary header.
        Parameters:
        name - the name of the header
        value - the value of the header, the header will be serialized using a RuntimeDelegate.HeaderDelegate if one is available via RuntimeDelegate.createHeaderDelegate(java.lang.Class) for the class of value or using its toString method if a header delegate is not available. If value is null then all current headers of the same name will be removed.
        Returns:
        the updated response.
      • build

        public jakarta.ws.rs.core.Response build()
        Builds the response to return.
        Returns:
        the response