Class BaseREST
java.lang.Object
org.gcube.resourcemanagement.rest.BaseREST
- Direct Known Subclasses:
Admin,ContextManager,PlanManager,ResourceManager
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringContent type for JSON APIstatic final StringContent type for JSON with UTF-8 charsetstatic final StringKey name for count values in JSON responsesprotected jakarta.ws.rs.core.HttpHeadersHTTP headers contextprotected static final StringHeader name for location headerprotected final org.slf4j.LoggerLogger instance for this classstatic final StringQuery parameter name for purge operationsprotected jakarta.ws.rs.core.UriInfoURI info context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.ws.rs.core.Response.ResponseBuilderaddLocation(jakarta.ws.rs.core.Response.ResponseBuilder responseBuilder, String id) Add a location header to the response builderprotected StringcreateCountJson(int count) Create a JSON string containing a count valueprotected voidsetAccountingMethod(String method) Set the accounting method name for tracking operations
-
Field Details
-
logger
protected final org.slf4j.Logger loggerLogger instance for this class -
APPLICATION_JSON_CHARSET_UTF_8
Content type for JSON with UTF-8 charset- See Also:
-
APPLICATION_JSON_API
Content type for JSON API- See Also:
-
COUNT_KEY
Key name for count values in JSON responses- See Also:
-
PURGE_QUERY_PARAMETER
Query parameter name for purge operations- See Also:
-
httpHeaders
@Context protected jakarta.ws.rs.core.HttpHeaders httpHeadersHTTP headers context -
uriInfo
@Context protected jakarta.ws.rs.core.UriInfo uriInfoURI info context -
LOCATION_HEADER
Header name for location header- See Also:
-
-
Constructor Details
-
BaseREST
public BaseREST()
-
-
Method Details
-
addLocation
protected jakarta.ws.rs.core.Response.ResponseBuilder addLocation(jakarta.ws.rs.core.Response.ResponseBuilder responseBuilder, String id) Add a location header to the response builder- Parameters:
responseBuilder- the response builder to modifyid- the resource identifier to append to the location- Returns:
- the modified response builder
-
createCountJson
Create a JSON string containing a count value- Parameters:
count- the count value to include- Returns:
- JSON string with the count
-
setAccountingMethod
Set the accounting method name for tracking operations- Parameters:
method- the method name to set for accounting
-