org.apache.ace.server.log.servlet
Class LogServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.apache.ace.server.log.servlet.LogServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class LogServlet
extends javax.servlet.http.HttpServlet

This class acts as a servlet and handles the log protocol. This means a number of requests will be handled: The endpoint is configured externally, 'auditlog' is used as an example here. Querying existing audit log event id's: http://host:port/auditlog/query - Return all known event ranges http://host:port/auditlog/query?gwid=myid&logid=123712636323 - Return the event range belonging to the specified gateway and log id Accepting new audit log events: http://host:port/auditlog/send - Gets a new log event and puts it in the store, the event is inside the request and should be a formatted as done in LogEvent.toRepresentation(). Querying existing audit log events: http://host:port/auditlog/receive - Return all known events http://host:port/auditlog/receive?gwid=myid - Return all known events belonging to the specified gateway ID http://host:port/auditlog/receive?gwid=myid&logid=2374623874 - Return all known events belonging to the specified gateway ID If the request is not correctly formatted or other problems arise error code HttpServletResponse.SC_NOT_FOUND will be sent in the response.

See Also:
Serialized Form

Constructor Summary
LogServlet(String name)
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 String getServletInfo()
           
protected  boolean handleQuery(String gatewayID, String logID, String filter, javax.servlet.ServletOutputStream output)
           
protected  boolean handleReceive(String gatewayID, String logID, String range, String filter, javax.servlet.ServletOutputStream output)
           
protected  boolean handleSend(javax.servlet.ServletInputStream input)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogServlet

public LogServlet(String name)
Method Detail

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
Overrides:
doPost in class javax.servlet.http.HttpServlet

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
Overrides:
doGet in class javax.servlet.http.HttpServlet

handleQuery

protected boolean handleQuery(String gatewayID,
                              String logID,
                              String filter,
                              javax.servlet.ServletOutputStream output)
                       throws IOException
Throws:
IOException

handleReceive

protected boolean handleReceive(String gatewayID,
                                String logID,
                                String range,
                                String filter,
                                javax.servlet.ServletOutputStream output)
                         throws IOException
Throws:
IOException

handleSend

protected boolean handleSend(javax.servlet.ServletInputStream input)
                      throws IOException
Throws:
IOException

getServletInfo

public String getServletInfo()
Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.