Class InterceptorResource


  • @Path("/")
    public class InterceptorResource
    extends java.lang.Object
    InterceptorResource : intercept request between elastic and kibana replace underscore by sharp and suppress undesired header
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.ws.rs.core.Response handleHeadElasticRequestFromKibana​(javax.ws.rs.core.UriInfo info, java.lang.String url, javax.servlet.http.HttpServletRequest req, javax.ws.rs.core.HttpHeaders headers)
      Juste Filter the request not the response
      javax.ws.rs.core.Response process​(java.lang.String url, javax.ws.rs.core.UriInfo info, javax.servlet.http.HttpServletRequest req, javax.ws.rs.core.HttpHeaders headers)
      Filter kibana request and response
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • handleHeadElasticRequestFromKibana

        @HEAD
        @Path("{url: .*}")
        public javax.ws.rs.core.Response handleHeadElasticRequestFromKibana​(@Context
                                                                            javax.ws.rs.core.UriInfo info,
                                                                            @PathParam("url")
                                                                            java.lang.String url,
                                                                            @Context
                                                                            javax.servlet.http.HttpServletRequest req,
                                                                            @Context
                                                                            javax.ws.rs.core.HttpHeaders headers)
        Juste Filter the request not the response
        Parameters:
        url - url
        info - UriInfo
        req - HttpServletRequest
        headers - HttpHeaders
        Returns:
        elasticSearch response.
      • process

        @GET
        @POST
        @OPTIONS
        @DELETE
        @PUT
        @Path("{url: .*}")
        public javax.ws.rs.core.Response process​(@PathParam("url")
                                                 java.lang.String url,
                                                 @Context
                                                 javax.ws.rs.core.UriInfo info,
                                                 @Context
                                                 javax.servlet.http.HttpServletRequest req,
                                                 @Context
                                                 javax.ws.rs.core.HttpHeaders headers)
                                          throws java.io.IOException
        Filter kibana request and response
        Parameters:
        url - url
        info - UriInfo
        req - HttpServletRequest
        headers - HttpHeaders
        Returns:
        the given elasticsearch Response filtered with sharp
        Throws:
        java.io.IOException - IOException