Class 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
    • Field Detail

      • out_

        private final java.io.PrintStream out_
    • Constructor Detail

      • XmlLoggingInternalServer

        public XmlLoggingInternalServer​(HttpServer server,
                                        java.lang.String path,
                                        java.io.PrintStream out)
                                 throws java.io.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:
        java.io.IOException
      • XmlLoggingInternalServer

        public XmlLoggingInternalServer​(java.io.PrintStream out)
                                 throws java.io.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:
        java.io.IOException
    • Method Detail

      • 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)