Package org.astrogrid.samp.web
Class LoggingCorsHttpServer.LoggedResponse
- java.lang.Object
-
- org.astrogrid.samp.httpd.HttpServer.Response
-
- org.astrogrid.samp.web.LoggingCorsHttpServer.LoggedResponse
-
- Enclosing class:
- LoggingCorsHttpServer
private class LoggingCorsHttpServer.LoggedResponse extends HttpServer.Response
HTTP response which will log its content at an appropriate time.
-
-
Field Summary
Fields Modifier and Type Field Description private HttpServer.Response
base_
private java.lang.String
bodyText_
private java.lang.String
headText_
private boolean
logBody_
-
Constructor Summary
Constructors Constructor Description LoggedResponse(HttpServer.Response base, int iseq, boolean logBody)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
writeBody(java.io.OutputStream out)
Implemented to generate the bytes in the body of the response.void
writeResponse(java.io.OutputStream out)
Writes this response to an output stream in a way suitable for replying to the client.-
Methods inherited from class org.astrogrid.samp.httpd.HttpServer.Response
getHeaderMap, getStatusCode, getStatusPhrase
-
-
-
-
Field Detail
-
base_
private final HttpServer.Response base_
-
logBody_
private final boolean logBody_
-
headText_
private final java.lang.String headText_
-
bodyText_
private java.lang.String bodyText_
-
-
Constructor Detail
-
LoggedResponse
LoggedResponse(HttpServer.Response base, int iseq, boolean logBody)
Constructor.- Parameters:
base
- response on which this one is basediseq
- sequence number of request that this is a response tologBody
- true iff the body of the response is to be logged
-
-
Method Detail
-
writeBody
public void writeBody(java.io.OutputStream out) throws java.io.IOException
Description copied from class:HttpServer.Response
Implemented to generate the bytes in the body of the response.- Specified by:
writeBody
in classHttpServer.Response
- Parameters:
out
- destination stream for body bytes- Throws:
java.io.IOException
-
writeResponse
public void writeResponse(java.io.OutputStream out) throws java.io.IOException
Description copied from class:HttpServer.Response
Writes this response to an output stream in a way suitable for replying to the client. Status line and any headers are written, thenHttpServer.Response.writeBody(java.io.OutputStream)
is called.- Overrides:
writeResponse
in classHttpServer.Response
- Parameters:
out
- destination stream- Throws:
java.io.IOException
-
-