public class HarResponse
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TABLE_NAME
Database table name where the data is stored
|
Constructor and Description |
---|
HarResponse(HarDatabaseConfig config,
long entryId)
Creates a new
HarResponse object from a database. |
HarResponse(int status,
java.lang.String statusText,
java.lang.String httpVersion,
HarCookies cookies,
HarHeaders headers,
HarContent content,
java.lang.String redirectURL)
Creates a new
HarResponse object with all mandatory fields |
HarResponse(int status,
java.lang.String statusText,
java.lang.String httpVersion,
HarCookies cookies,
HarHeaders headers,
HarContent content,
java.lang.String redirectURL,
long headersSize,
long bodySize,
java.lang.String comment)
Creates a new
HarResponse object |
HarResponse(org.codehaus.jackson.JsonParser jp,
java.util.List<HarWarning> warnings)
Creates a new
HarResponse object from a JsonParser already
positioned at the beginning of the element content |
Modifier and Type | Method and Description |
---|---|
void |
deleteFromJDBC(HarDatabaseConfig config,
long logId,
boolean dropTables)
Delete objects in the database referencing the specified logId.
|
long |
getBodySize()
Returns the bodySize value.
|
java.lang.String |
getComment()
Returns the comment value.
|
HarContent |
getContent()
Returns the content value.
|
HarCookies |
getCookies()
Returns the cookies value.
|
HarHeaders |
getHeaders()
Returns the headers value.
|
long |
getHeadersSize()
Returns the headersSize value.
|
java.lang.String |
getHttpVersion()
Returns the httpVersion value.
|
java.lang.String |
getRedirectURL()
Returns the redirectURL value.
|
int |
getStatus()
Returns the status value.
|
java.lang.String |
getStatusText()
Returns the statusText value.
|
void |
setBodySize(long bodySize)
Sets the bodySize value.
|
void |
setComment(java.lang.String comment)
Sets the comment value.
|
void |
setContent(HarContent content)
Sets the content value.
|
void |
setCookies(HarCookies cookies)
Sets the cookies value.
|
void |
setHeaders(HarHeaders headers)
Sets the headers value.
|
void |
setHeadersSize(long headersSize)
Sets the headersSize value.
|
void |
setHttpVersion(java.lang.String httpVersion)
Sets the httpVersion value.
|
void |
setRedirectURL(java.lang.String redirectURL)
Sets the redirectURL value.
|
void |
setStatus(int status)
Sets the status value.
|
void |
setStatusText(java.lang.String statusText)
Sets the statusText value.
|
java.lang.String |
toString() |
void |
writeHar(org.codehaus.jackson.JsonGenerator g)
Write this object on a JsonGenerator stream
|
void |
writeJDBC(long entryId,
HarDatabaseConfig config,
long logId)
Write this object to a database according to the given configuration
|
public static java.lang.String TABLE_NAME
public HarResponse(int status, java.lang.String statusText, java.lang.String httpVersion, HarCookies cookies, HarHeaders headers, HarContent content, java.lang.String redirectURL, long headersSize, long bodySize, java.lang.String comment)
HarResponse
objectstatus
- status [number] - Response status.statusText
- statusText [string] - Response status description.httpVersion
- httpVersion [string] - Response HTTP Version.cookies
- cookies [array] - List of cookie objects.headers
- headers [array] - List of header objects.content
- content [object] - Details about the response body.redirectURL
- redirectURL [string] - Redirection target URL from the
Location response header.headersSize
- headersSize [number]* - Total number of bytes from the
start of the HTTP response message until (and including) the
double CRLF before the body. Set to -1 if the info is not
available.bodySize
- bodySize [number] - Size of the received response body in
bytes. Set to zero in case of responses coming from the cache
(304). Set to -1 if the info is not available.comment
- comment [string, optional] (new in 1.2) - A comment provided
by the user or the application.public HarResponse(int status, java.lang.String statusText, java.lang.String httpVersion, HarCookies cookies, HarHeaders headers, HarContent content, java.lang.String redirectURL)
HarResponse
object with all mandatory fieldsstatus
- status [number] - Response status.statusText
- statusText [string] - Response status description.httpVersion
- httpVersion [string] - Response HTTP Version.cookies
- cookies [array] - List of cookie objects.headers
- headers [array] - List of header objects.content
- content [object] - Details about the response body.redirectURL
- redirectURL [string] - Redirection target URL from the
Location response header.public HarResponse(org.codehaus.jackson.JsonParser jp, java.util.List<HarWarning> warnings) throws org.codehaus.jackson.JsonParseException, java.io.IOException
HarResponse
object from a JsonParser already
positioned at the beginning of the element contentjp
- a JsonParser already positioned at the beginning of the element
contentwarnings
- null if parser should fail on first error, pointer to
warning list if warnings can be issued for missing fieldsorg.codehaus.jackson.JsonParseException
java.io.IOException
public HarResponse(HarDatabaseConfig config, long entryId) throws java.sql.SQLException
HarResponse
object from a database. Retrieves
the HarResponse objects that corresponds to the specified entry id.config
- the database configuration to useentryId
- the entry id to readjava.sql.SQLException
- if a database error occurspublic void writeHar(org.codehaus.jackson.JsonGenerator g) throws org.codehaus.jackson.JsonGenerationException, java.io.IOException
g
- a JsonGeneratorjava.io.IOException
- if an IO error occursorg.codehaus.jackson.JsonGenerationException
- if the generator failsHarFileWriter.writeHarFile(HarLog, java.io.File)
public void writeJDBC(long entryId, HarDatabaseConfig config, long logId) throws java.sql.SQLException
entryId
- the entry id this object refers toconfig
- the database configuration to usejava.sql.SQLException
- if a database error occurspublic void deleteFromJDBC(HarDatabaseConfig config, long logId, boolean dropTables) throws java.sql.SQLException
logId
- the logId this object refers toconfig
- the database configurationdropTables
- true if tables must be droppedjava.sql.SQLException
- if a database access error occurspublic int getStatus()
public void setStatus(int status)
status
- The status to set.public java.lang.String getStatusText()
public void setStatusText(java.lang.String statusText)
statusText
- The statusText to set.public java.lang.String getHttpVersion()
public void setHttpVersion(java.lang.String httpVersion)
httpVersion
- The httpVersion to set.public HarCookies getCookies()
public void setCookies(HarCookies cookies)
cookies
- The cookies to set.public HarHeaders getHeaders()
public void setHeaders(HarHeaders headers)
headers
- The headers to set.public HarContent getContent()
public void setContent(HarContent content)
content
- The content to set.public java.lang.String getRedirectURL()
public void setRedirectURL(java.lang.String redirectURL)
redirectURL
- The redirectURL to set.public long getHeadersSize()
public void setHeadersSize(long headersSize)
headersSize
- The headersSize to set.public long getBodySize()
public void setBodySize(long bodySize)
bodySize
- The bodySize to set.public java.lang.String getComment()
public void setComment(java.lang.String comment)
comment
- The comment to set.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
Copyright © 2011 Emmanuel Cecchet - University of Massachusetts - All Rights Reserved.