public class ResponseFromResourceRegistry extends Object
RequestToResourceRegistry.| Modifier | Constructor and Description |
|---|---|
protected |
ResponseFromResourceRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static ResponseFromResourceRegistry |
fromErrorCode(org.gcube.common.gxrest.response.outbound.ErrorCode e)
Creates a response from an error code.
|
static ResponseFromResourceRegistry |
fromException(Exception e)
Creates a response from an exception.
|
Optional<org.gcube.common.gxrest.response.outbound.ErrorCode> |
getErrorCode()
The
ErrorCode occurred when preparing the response. |
Optional<Exception> |
getException()
The
Exception returned by the RR. |
URI |
getLocation()
Gets the location of the new resource.
|
Optional<String> |
getMessage()
Gets the message associated to the response
|
static ResponseFromResourceRegistry |
newFailureResponse(String reason)
Creates a failure response
|
static ResponseFromResourceRegistry |
newSuccessResponse(URI context_id)
Creates a success response
|
static ResponseFromResourceRegistry |
newSuccessResponseWithMessage(String message,
URI context_id)
Creates a success response with an associated message.
|
ResponseFromResourceRegistry |
setMessage(String message)
Sets the message for the response.
|
boolean |
wasSuccessful() |
public boolean wasSuccessful()
public Optional<String> getMessage()
public URI getLocation()
public ResponseFromResourceRegistry setMessage(String message)
message - the messagepublic Optional<Exception> getException()
Exception returned by the RR.public static ResponseFromResourceRegistry fromException(Exception e)
e - public Optional<org.gcube.common.gxrest.response.outbound.ErrorCode> getErrorCode()
ErrorCode occurred when preparing the response.public static ResponseFromResourceRegistry fromErrorCode(org.gcube.common.gxrest.response.outbound.ErrorCode e)
e - public static ResponseFromResourceRegistry newFailureResponse(String reason)
public static ResponseFromResourceRegistry newSuccessResponseWithMessage(String message, URI context_id)
message - the message associated to the responsecontext_id - the uri of the new contextpublic static ResponseFromResourceRegistry newSuccessResponse(URI context_id)
context_id - the uri of the new contextCopyright © 2019. All Rights Reserved.