Class BaseManagementResource

java.lang.Object
com.tangosol.coherence.management.internal.BaseManagementResource
Direct Known Subclasses:
ManagementRootResource, VersionedRootResource

public class BaseManagementResource extends Object
A base JAX-RS root resource that supports management info requests.
Since:
22.06
Author:
Jonathan Knight 2022.01.25
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.tangosol.net.management.MBeanServerProxy
    The Mbean server proxy.
    protected jakarta.ws.rs.container.ContainerRequestContext
    The container request context.
    protected jakarta.ws.rs.core.HttpHeaders
    The request headers, available in the context.
    protected jakarta.ws.rs.core.UriInfo
    The UriInfo available in the context.
    static final String
    Constant used for json application type.
    static final String
    Constant used for applicable media types in the management REST interface.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BaseManagementResource(com.tangosol.internal.management.ManagementRoutes routes)
    Create a root management resource.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected JaxRsRequest
    createJaxRsRequest(jakarta.ws.rs.container.ContainerRequestContext containerRequest)
     
    jakarta.ws.rs.core.Response
    doDelete(org.glassfish.jersey.server.ContainerRequest request)
    Handle a management over rest DELETE request.
    jakarta.ws.rs.core.Response
    doGet(org.glassfish.jersey.server.ContainerRequest request)
    Handle a management over rest GET request.
    jakarta.ws.rs.core.Response
    doPost(org.glassfish.jersey.server.ContainerRequest request)
    Handle a management over rest POST request.
    jakarta.ws.rs.core.Response
    doPut(org.glassfish.jersey.server.ContainerRequest request)
    Handle a management over rest PUT request.
    jakarta.ws.rs.core.Response
    get(org.glassfish.jersey.server.ContainerRequest request)
    Handle a management over rest GET request.
     
    protected URI
    The URI of the current resource.
    The parent URI of the resource.
    getParentUri(jakarta.ws.rs.core.UriInfo uriInfo)
     
    int
    getParentUriSegmentsCount(jakarta.ws.rs.core.UriInfo uriInfo)
    Return the number of URI segments in the parent URL.
    static URI
    getSubUri(jakarta.ws.rs.core.UriInfo uriInfo, String... asSegments)
    Append the provided segments to the current URI.
    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.
    void
    setClusterName(String sClusterName)
     
    static jakarta.ws.rs.core.Response
    toJaxRsResponse(com.tangosol.internal.http.Response response)
    Convert a Coherence Response to a jax-rs Response.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MEDIA_TYPE_JSON

      public static final String MEDIA_TYPE_JSON
      Constant used for json application type.
      See Also:
    • MEDIA_TYPES

      public static final String 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_mBeanServerProxy
      The Mbean server proxy.
    • m_requestHeaders

      @Context protected jakarta.ws.rs.core.HttpHeaders m_requestHeaders
      The request headers, available in the context.
    • m_uriInfo

      @Context protected jakarta.ws.rs.core.UriInfo m_uriInfo
      The UriInfo available in the context.
    • m_requestContext

      @Context protected jakarta.ws.rs.container.ContainerRequestContext m_requestContext
      The 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 request
      router - 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

      protected URI getCurrentUri()
      The URI of the current resource.
      Returns:
      the resource URI
    • getSubUri

      public static URI getSubUri(jakarta.ws.rs.core.UriInfo uriInfo, String... asSegments)
      Append the provided segments to the current URI.
      Parameters:
      uriInfo - the URI info object
      asSegments - the segments to be appended
      Returns:
      the resulting URI
    • getParentUri

      public URI getParentUri()
      The parent URI of the resource.
      Returns:
      the parent URI
    • getParentUri

      public URI getParentUri(jakarta.ws.rs.core.UriInfo uriInfo)
    • 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

      public String getClusterName()
    • setClusterName

      public void setClusterName(String sClusterName)
    • toJaxRsResponse

      public static jakarta.ws.rs.core.Response toJaxRsResponse(com.tangosol.internal.http.Response response)
      Convert a Coherence Response to a jax-rs Response.
      Parameters:
      response - the Response to convert
      Returns:
      a jax-rs Response