Class GXOutboundSuccessResponse
java.lang.Object
org.gcube.common.gxrest.response.outbound.GXOutboundSuccessResponse
An outbound success response message for applications.
- Author:
- Manuele Simi (ISTI CNR), Luca Frosini (ISTI-CNR)
-
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Responsebuild()Builds the response to return.static GXOutboundSuccessResponsenewCREATEResponse(URI location) Builds a new response with the CREATE HTTP status.static GXOutboundSuccessResponseBuilds a new response with the OK HTTP status.ofType(jakarta.ws.rs.core.MediaType type) Adds a type to the response message.Adds a type to the response message.Reads from the stream the content to set in the response.Sets the object as response's content.withContent(String message) Sets the message as the response's content.withHeader(String name, Object value) Add an arbitrary header.
-
Method Details
-
newOKResponse
Builds a new response with the OK HTTP status.- Returns:
- the updated response
-
newCREATEResponse
Builds a new response with the CREATE HTTP status.- Parameters:
location- the location- Returns:
- the updated response
-
withContent
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- if an I/O error occurs
-
withContent
Reads from the stream the content to set in the response.- Parameters:
is- the stream- Returns:
- the updated response
- Throws:
IOException- if an I/O error occurs
-
withContent
Sets the message as the response's content.- Parameters:
message- the message- Returns:
- the updated response
-
ofType
Adds a type to the response message.- Parameters:
type- the media type- Returns:
- the updated response
-
ofType
Adds a type to the response message.- Parameters:
type- the media type- Returns:
- the updated response
-
withHeader
Add an arbitrary header.- Parameters:
name- the name of the headervalue- the value of the header, the header will be serialized using aRuntimeDelegate.HeaderDelegateif one is available viaRuntimeDelegate.createHeaderDelegate(java.lang.Class)for the class ofvalueor using itstoStringmethod if a header delegate is not available. Ifvalueisnullthen 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
-