Class AbstractRestService
java.lang.Object
org.eclipse.dirigible.commons.api.service.AbstractRestService
- All Implemented Interfaces:
IRestService
public abstract class AbstractRestService extends Object implements IRestService
The AbstractRestService is the parent of all the RESTful services in Dirigible.
-
Field Summary
Fields Modifier and Type Field Description static StringNO_LOGGED_IN_USERThe Constant NO_LOGGED_IN_USER. -
Constructor Summary
Constructors Constructor Description AbstractRestService() -
Method Summary
Modifier and Type Method Description protected javax.ws.rs.core.ResponsecreateErrorResponse(javax.ws.rs.core.Response.Status status, String message)Create general error response for given status.protected javax.ws.rs.core.ResponsecreateErrorResponseBadRequest(String message)Create error response bad request.protected javax.ws.rs.core.ResponsecreateErrorResponseForbidden(String message)Create error response forbidden.protected javax.ws.rs.core.ResponsecreateErrorResponseInternalServerError(String message)Create error response internal server error.protected javax.ws.rs.core.ResponsecreateErrorResponseNotFound(String message)Create error response not found.protected javax.ws.rs.core.ResponsecreateErrorResponseUnauthorized(String message)Create error response unathorized.protected abstract org.slf4j.LoggergetLogger()Gets the logger.
-
Field Details
-
NO_LOGGED_IN_USER
The Constant NO_LOGGED_IN_USER.- See Also:
- Constant Field Values
-
-
Constructor Details
-
AbstractRestService
public AbstractRestService()
-
-
Method Details
-
getLogger
protected abstract org.slf4j.Logger getLogger()Gets the logger.- Returns:
- the logger
-
createErrorResponse
protected javax.ws.rs.core.Response createErrorResponse(javax.ws.rs.core.Response.Status status, String message)Create general error response for given status.- Parameters:
status- the statusmessage- the message- Returns:
- the error response
-
createErrorResponseNotFound
Create error response not found.- Parameters:
message- the message- Returns:
- the error response
-
createErrorResponseForbidden
Create error response forbidden.- Parameters:
message- the message- Returns:
- the error response
-
createErrorResponseBadRequest
Create error response bad request.- Parameters:
message- the message- Returns:
- the error response
-
createErrorResponseUnauthorized
Create error response unathorized.- Parameters:
message- the message- Returns:
- the error response
-
createErrorResponseInternalServerError
Create error response internal server error.- Parameters:
message- the message- Returns:
- the error response
-