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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
XmlLoggingInternalServer.LoggingResponse
-
Field Summary
Fields Modifier and Type Field Description private java.io.PrintStream
out_
-
Constructor Summary
Constructors Constructor Description XmlLoggingInternalServer(java.io.PrintStream out)
Constructs a server running with default characteristics on any free port.XmlLoggingInternalServer(HttpServer server, java.lang.String path, java.io.PrintStream out)
Constructor based on a given HTTP server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HttpServer.Response
getXmlRpcResponse(HttpServer.Request request)
Returns the HTTP response object given an incoming XML-RPC POST request.-
Methods inherited from class org.astrogrid.samp.xmlrpc.internal.InternalServer
addHandler, getEndpoint, getHttpServer, handleCall, removeHandler
-
-
-
-
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 requestspath
- 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 classInternalServer
- Parameters:
request
- POSTed HTTP request- Returns:
- XML-RPC response (possibly fault)
-
-