public class HarCache
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 |
---|
HarCache()
Creates a new
HarCache object - no mandatory field |
HarCache(HarCacheRequest beforeRequest,
HarCacheRequest afterRequest,
java.lang.String comment)
Creates a new
HarCache object |
HarCache(HarDatabaseConfig config,
long entryId)
Creates a new
HarCache object from a database. |
HarCache(org.codehaus.jackson.JsonParser jp,
java.util.List<HarWarning> warnings)
Creates a new
HarCache 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)
Delete objects in the database referencing the specified logId.
|
HarCacheRequest |
getAfterRequest()
Returns the afterRequest value.
|
HarCacheRequest |
getBeforeRequest()
Returns the beforeRequest value.
|
java.lang.String |
getComment()
Returns the comment value.
|
HarCustomFields |
getCustomFields()
Returns the customFields value.
|
void |
setAfterRequest(HarCacheRequest afterRequest)
Sets the afterRequest value.
|
void |
setBeforeRequest(HarCacheRequest beforeRequest)
Sets the beforeRequest value.
|
void |
setComment(java.lang.String comment)
Sets the comment value.
|
void |
setCustomFields(HarCustomFields customFields)
Sets the customFields 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 HarCache()
HarCache
object - no mandatory fieldpublic HarCache(HarCacheRequest beforeRequest, HarCacheRequest afterRequest, java.lang.String comment)
HarCache
objectbeforeRequest
- beforeRequest [object, optional] - State of a cache
entry before the request. Leave out this field if the information
is not available.afterRequest
- afterRequest [object, optional] - State of a cache
entry after the request. Leave out this field if the information
is not available.comment
- comment [string, optional] (new in 1.2) - A comment provided
by the user or the application.public HarCache(org.codehaus.jackson.JsonParser jp, java.util.List<HarWarning> warnings) throws org.codehaus.jackson.JsonParseException, java.io.IOException
HarCache
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 HarCache(HarDatabaseConfig config, long entryId) throws java.sql.SQLException
HarCache
object from a database. Retrieves the
HarCache 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) throws java.sql.SQLException
logId
- the logId this object refers toconfig
- the database configurationjava.sql.SQLException
- if a database access error occurspublic HarCacheRequest getBeforeRequest()
public void setBeforeRequest(HarCacheRequest beforeRequest)
beforeRequest
- The beforeRequest to set.public HarCacheRequest getAfterRequest()
public void setAfterRequest(HarCacheRequest afterRequest)
afterRequest
- The afterRequest to set.public java.lang.String getComment()
public void setComment(java.lang.String comment)
comment
- The comment to set.public HarCustomFields getCustomFields()
public void setCustomFields(HarCustomFields customFields)
customFields
- The customFields 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.