Github user ctubbsii commented on a diff in the pull request:
https://github.com/apache/accumulo/pull/150#discussion_r78467243
--- Diff:
server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BasicServlet.java
---
@@ -51,8 +52,18 @@
abstract protected String getTitle(HttpServletRequest req);
+ public void checkIfActive() throws IOException {
+ // If the HighlyAvailableService is not initialized or it's not the
active service, throw an exception
+ // to prevent processing of the servlet.
+ if (null == Monitor.HA_SERVICE_INSTANCE ||
!Monitor.HA_SERVICE_INSTANCE.isActiveService()) {
+ throw new IOException("This is not the active Monitor", new
NotActiveServiceException());
--- End diff --
[`HttpServletResponse`][1] has several useful methods for sending
redirects, errors, or otherwise manipulating the status.
[1]:
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletResponse.html
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---