Class BaseManagementResource
java.lang.Object
com.tangosol.coherence.management.internal.BaseManagementResource
- Direct Known Subclasses:
ManagementRootResource,VersionedRootResource
A base JAX-RS root resource that supports management info requests.
- Since:
- 22.06
- Author:
- Jonathan Knight 2022.01.25
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.tangosol.net.management.MBeanServerProxyThe Mbean server proxy.protected jakarta.ws.rs.container.ContainerRequestContextThe container request context.protected jakarta.ws.rs.core.HttpHeadersThe request headers, available in the context.protected jakarta.ws.rs.core.UriInfoThe UriInfo available in the context.static final StringConstant used for json application type.static final StringConstant used for applicable media types in the management REST interface. -
Constructor Summary
ConstructorsConstructorDescriptionBaseManagementResource(com.tangosol.internal.management.ManagementRoutes routes) Create a root management resource. -
Method Summary
Modifier and TypeMethodDescriptionprotected JaxRsRequestcreateJaxRsRequest(jakarta.ws.rs.container.ContainerRequestContext containerRequest) jakarta.ws.rs.core.ResponsedoDelete(org.glassfish.jersey.server.ContainerRequest request) Handle a management over rest DELETE request.jakarta.ws.rs.core.ResponsedoGet(org.glassfish.jersey.server.ContainerRequest request) Handle a management over rest GET request.jakarta.ws.rs.core.ResponsedoPost(org.glassfish.jersey.server.ContainerRequest request) Handle a management over rest POST request.jakarta.ws.rs.core.ResponsedoPut(org.glassfish.jersey.server.ContainerRequest request) Handle a management over rest PUT request.jakarta.ws.rs.core.Responseget(org.glassfish.jersey.server.ContainerRequest request) Handle a management over rest GET request.protected URIThe URI of the current resource.The parent URI of the resource.getParentUri(jakarta.ws.rs.core.UriInfo uriInfo) intgetParentUriSegmentsCount(jakarta.ws.rs.core.UriInfo uriInfo) Return the number of URI segments in the parent URL.static URIAppend the provided segments to the current URI.protected jakarta.ws.rs.core.Responsehandle(jakarta.ws.rs.container.ContainerRequestContext containerRequest, com.tangosol.internal.management.ManagementRoutes router) Forward the specified request to the router and convert the router response to a jax-rs response.voidsetClusterName(String sClusterName) static jakarta.ws.rs.core.ResponsetoJaxRsResponse(com.tangosol.internal.http.Response response) Convert a CoherenceResponseto a jax-rsResponse.
-
Field Details
-
MEDIA_TYPE_JSON
Constant used for json application type.- See Also:
-
MEDIA_TYPES
Constant used for applicable media types in the management REST interface.- See Also:
-
m_mBeanServerProxy
@Context protected com.tangosol.net.management.MBeanServerProxy m_mBeanServerProxyThe Mbean server proxy. -
m_requestHeaders
@Context protected jakarta.ws.rs.core.HttpHeaders m_requestHeadersThe request headers, available in the context. -
m_uriInfo
@Context protected jakarta.ws.rs.core.UriInfo m_uriInfoThe UriInfo available in the context. -
m_requestContext
@Context protected jakarta.ws.rs.container.ContainerRequestContext m_requestContextThe container request context.
-
-
Constructor Details
-
BaseManagementResource
public BaseManagementResource(com.tangosol.internal.management.ManagementRoutes routes) Create a root management resource.
-
-
Method Details
-
get
@GET public jakarta.ws.rs.core.Response get(@Context org.glassfish.jersey.server.ContainerRequest request) Handle a management over rest GET request.- Returns:
- the response from handling the request
-
doGet
@GET @Path("{any:.*}") public jakarta.ws.rs.core.Response doGet(@Context org.glassfish.jersey.server.ContainerRequest request) Handle a management over rest GET request.- Returns:
- the response from handling the request
-
doPost
@POST @Path("{any:.*}") public jakarta.ws.rs.core.Response doPost(@Context org.glassfish.jersey.server.ContainerRequest request) Handle a management over rest POST request.- Returns:
- the response from handling the request
-
doPut
@PUT @Path("{any:.*}") public jakarta.ws.rs.core.Response doPut(@Context org.glassfish.jersey.server.ContainerRequest request) Handle a management over rest PUT request.- Returns:
- the response from handling the request
-
doDelete
@DELETE @Path("{any:.*}") public jakarta.ws.rs.core.Response doDelete(@Context org.glassfish.jersey.server.ContainerRequest request) Handle a management over rest DELETE request.- Returns:
- the response from handling the request
-
handle
protected jakarta.ws.rs.core.Response handle(jakarta.ws.rs.container.ContainerRequestContext containerRequest, com.tangosol.internal.management.ManagementRoutes router) Forward the specified request to the router and convert the router response to a jax-rs response.- Parameters:
containerRequest- the current requestrouter- the router to handle the request- Returns:
- the jax-rs response to return to the caller
-
createJaxRsRequest
protected JaxRsRequest createJaxRsRequest(jakarta.ws.rs.container.ContainerRequestContext containerRequest) -
getCurrentUri
The URI of the current resource.- Returns:
- the resource URI
-
getSubUri
Append the provided segments to the current URI.- Parameters:
uriInfo- the URI info objectasSegments- the segments to be appended- Returns:
- the resulting URI
-
getParentUri
The parent URI of the resource.- Returns:
- the parent URI
-
getParentUri
-
getParentUriSegmentsCount
public int getParentUriSegmentsCount(jakarta.ws.rs.core.UriInfo uriInfo) Return the number of URI segments in the parent URL.- Parameters:
uriInfo- the URI Info- Returns:
- the number of segments in the parent URL
-
getClusterName
-
setClusterName
-
toJaxRsResponse
public static jakarta.ws.rs.core.Response toJaxRsResponse(com.tangosol.internal.http.Response response) Convert a CoherenceResponseto a jax-rsResponse.- Parameters:
response- theResponseto convert- Returns:
- a jax-rs
Response
-