Class XmlLoggingInternalServer

java.lang.Object
org.astrogrid.samp.xmlrpc.internal.InternalServer
org.astrogrid.samp.xmlrpc.internal.XmlLoggingInternalServer
All Implemented Interfaces:
SampXmlRpcServer

public class XmlLoggingInternalServer extends InternalServer
Freestanding InternalServer implementation which logs all incoming and outgoing HTTP data.
Since:
2 Dec 2008
Author:
Mark Taylor
  • Constructor Details

    • XmlLoggingInternalServer

      public XmlLoggingInternalServer(HttpServer server, String path, PrintStream out) throws IOException
      Constructor based on a given HTTP server. It is the caller's responsibility to configure and start the HttpServer.
      Parameters:
      server - server for processing HTTP requests
      path - path part of server endpoint (starts with "/");
      out - output stream for loggging
      Throws:
      IOException
    • XmlLoggingInternalServer

      public XmlLoggingInternalServer(PrintStream out) throws IOException
      Constructs a server running with default characteristics on any free port. The server is started as a daemon thread.
      Parameters:
      out - output stream for loggging
      Throws:
      IOException
  • Method Details

    • getXmlRpcResponse

      protected HttpServer.Response getXmlRpcResponse(HttpServer.Request request)
      Description copied from class: InternalServer
      Returns the HTTP response object given an incoming XML-RPC POST request. Any error should be handled by returning a fault-type methodResponse element rather than by throwing an exception.
      Overrides:
      getXmlRpcResponse in class InternalServer
      Parameters:
      request - POSTed HTTP request
      Returns:
      XML-RPC response (possibly fault)