Package com.tangosol.coherence.rest.util
Class RestHelper
- java.lang.Object
-
- com.tangosol.coherence.rest.util.RestHelper
-
public abstract class RestHelper extends Object
A collection of utility methods used by Coherence REST.- Author:
- ic 2011.12.17
-
-
Constructor Summary
Constructors Constructor Description RestHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
getMvelParserContext()
Return an instance of ParserContext as an Object to be used for evaluation.static Map<String,Object>
getQueryParameters(javax.ws.rs.core.UriInfo uriInfo)
Return a map containing query parameters from UriInfo instance.static void
log(Exception ex)
Log server side message for handled exceptions that return a http response ofBAD REQUEST
, status 400.static int
resolveMaxResults(int cParamMax, int cQueryMax, int cResourceMax)
Resolve the size of a result set Coherence REST resource will return.
-
-
-
Method Detail
-
getQueryParameters
public static Map<String,Object> getQueryParameters(javax.ws.rs.core.UriInfo uriInfo)
Return a map containing query parameters from UriInfo instance.- Parameters:
uriInfo
- UriInfo for invoked resource method- Returns:
- Map containing all query parameters from provided UriInfo
-
resolveMaxResults
public static int resolveMaxResults(int cParamMax, int cQueryMax, int cResourceMax)
Resolve the size of a result set Coherence REST resource will return.- Parameters:
cParamMax
- max result set size extracted from URL or -1 if not submittedcQueryMax
- max result set size configured for direct query or -1 if not configuredcResourceMax
- max result set size configured for this resource or -1 if not configured- Returns:
- max size of result set that this resource is allowed to return, or -1 if not configured nor provided by user
-
log
public static void log(Exception ex)
Log server side message for handled exceptions that return a http response ofBAD REQUEST
, status 400.- Parameters:
ex
- server side exception handled while processing a rest http request
-
getMvelParserContext
public static Object getMvelParserContext()
Return an instance of ParserContext as an Object to be used for evaluation.- Returns:
- an instance of ParserContext as an Object to be used for evaluation
-
-