class ApiAccessRejectionFilter implements Filter {

  @Override
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
      throws IOException, ServletException {
    HttpServletResponse resp = (HttpServletResponse) response;
    resp.setStatus(500);
    resp.getOutputStream().write(ERROR_MESSAGE_IN_BYTES);
  }

}