public class Epilogue extends Object implements LogInfo
Modifier and Type | Field and Description |
---|---|
protected int |
code |
protected static long |
LENGTH_UNKNOWN |
protected String |
logMessage |
protected String |
status |
Constructor and Description |
---|
Epilogue(String logMessage,
javax.ws.rs.core.Response.StatusType response,
CacheLastObserver<Long> responseLengthObserver)
Builds the block containing the common information for every request that is saved when the logging of a
request is finalized.
|
Modifier and Type | Method and Description |
---|---|
long |
getResponseLength() |
boolean |
isConnectionClosedPrematurely()
The connection between Bard and the client is considered to be closed prematurely if the connection is closed
before Bard finishes streaming the results back to the client.
|
protected static final long LENGTH_UNKNOWN
protected final String status
protected final int code
protected final String logMessage
public Epilogue(String logMessage, javax.ws.rs.core.Response.StatusType response, CacheLastObserver<Long> responseLengthObserver)
logMessage
- The message to logresponse
- The status of the responseresponseLengthObserver
- An Observer that receives the length of the response streamed back to the client
once streaming is completepublic long getResponseLength()
public boolean isConnectionClosedPrematurely()
When this happens, an EOFException
is thrown. So as an approximation (it is theoretically possible for
an EOFException
to be thrown for other reasons), we consider the connection to be closed prematurely
if an EOFException
is generated while sending the response back to the client.
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.