Package com.nimbusds.common.servlet
Class MonitorServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.codahale.metrics.servlets.AdminServlet
-
- com.nimbusds.common.servlet.MonitorServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class MonitorServlet extends com.codahale.metrics.servlets.AdminServlet
Monitor servlet for exposing Dropwizard metrics and health checks, requires an OAuth 2.0 bearer token for access.The access token is defined by a
Java property
obtained from 1) system properties or from 2) a properties file specified byservlet context parameter
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MonitorServlet.Configuration
The monitor servlet access token configuration.
-
Field Summary
Fields Modifier and Type Field Description protected MasterAccessTokenValidator
tokenValidator
The access token validator.-
Fields inherited from class com.codahale.metrics.servlets.AdminServlet
CPU_PROFILE_ENABLED_PARAM_KEY, CPU_PROFILE_URI_PARAM_KEY, DEFAULT_CPU_PROFILE_URI, DEFAULT_HEALTHCHECK_URI, DEFAULT_METRICS_URI, DEFAULT_PING_URI, DEFAULT_THREADS_URI, HEALTHCHECK_ENABLED_PARAM_KEY, HEALTHCHECK_URI_PARAM_KEY, METRICS_ENABLED_PARAM_KEY, METRICS_URI_PARAM_KEY, PING_ENABLED_PARAM_KEY, PING_URI_PARAM_KEY, SERVICE_NAME_PARAM_KEY, THREADS_ENABLED_PARAM_KEY, THREADS_URI_PARAM_KEY
-
-
Constructor Summary
Constructors Constructor Description MonitorServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
void
init(javax.servlet.ServletConfig config)
protected void
service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Field Detail
-
tokenValidator
protected MasterAccessTokenValidator tokenValidator
The access token validator.
-
-
Constructor Detail
-
MonitorServlet
public MonitorServlet()
-
-
Method Detail
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
- Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classcom.codahale.metrics.servlets.AdminServlet
- Throws:
javax.servlet.ServletException
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
- Overrides:
doGet
in classcom.codahale.metrics.servlets.AdminServlet
- Throws:
javax.servlet.ServletException
IOException
-
service
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
- Overrides:
service
in classcom.codahale.metrics.servlets.AdminServlet
- Throws:
javax.servlet.ServletException
IOException
-
-