Package org.astrogrid.samp.web
Class LoggingCorsHttpServer
java.lang.Object
org.astrogrid.samp.httpd.HttpServer
org.astrogrid.samp.web.CorsHttpServer
org.astrogrid.samp.web.LoggingCorsHttpServer
CorsHttpServer subclass which performs logging to a given print stream
at the HTTP level. Logging is not done through the logging system.
- Since:
- 2 Feb 2011
- Author:
- Mark Taylor
-
Nested Class Summary
Nested classes/interfaces inherited from class org.astrogrid.samp.httpd.HttpServer
HttpServer.Handler, HttpServer.Request, HttpServer.Response -
Field Summary
Fields inherited from class org.astrogrid.samp.web.CorsHttpServer
EXTRAHOSTS_PROPFields inherited from class org.astrogrid.samp.httpd.HttpServer
HDR_CONTENT_TYPE, STATUS_OK -
Constructor Summary
ConstructorsConstructorDescriptionLoggingCorsHttpServer(ServerSocket socket, OriginAuthorizer auth, PrintStream out) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionserve(HttpServer.Request request) Does the work for providing output corresponding to a given HTTP request.Methods inherited from class org.astrogrid.samp.web.CorsHttpServer
createNonLocalErrorResponse, isExtraHost, isLocalHost, isPermittedHostMethods inherited from class org.astrogrid.samp.httpd.HttpServer
addHandler, create405Response, createErrorResponse, createErrorResponse, getBaseUrl, getHeader, getSocket, isRunning, removeHandler, serveRequest, setDaemon, start, stop
-
Constructor Details
-
LoggingCorsHttpServer
public LoggingCorsHttpServer(ServerSocket socket, OriginAuthorizer auth, PrintStream out) throws IOException Constructor.- Parameters:
socket- socket hosting the serviceauth- defines which domains requests will be permitted fromout- destination stream for logging- Throws:
IOException
-
-
Method Details
-
serve
Description copied from class:HttpServerDoes the work for providing output corresponding to a given HTTP request. This implementation calls each Handler in turn and the first one to provide a non-null response is used.- Overrides:
servein classCorsHttpServer- Parameters:
request- represents an HTTP request that has been received- Returns:
- represents the content of an HTTP response that should be sent
-