public class HarCacheRequest
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 |
---|
HarCacheRequest(java.util.Date expires,
java.util.Date lastAccess,
java.lang.String tag,
int hitCount,
java.lang.String comment,
boolean isBefore)
Creates a new
HarCacheRequest object |
HarCacheRequest(java.util.Date lastAccess,
java.lang.String tag,
int hitCount,
boolean isBefore)
Creates a new
HarCacheRequest object |
HarCacheRequest(HarDatabaseConfig config,
long cacheId,
boolean isBefore)
Creates a new
HarCacheRequest object from a database. |
HarCacheRequest(org.codehaus.jackson.JsonParser jp,
boolean isBefore,
java.util.List<HarWarning> warnings)
Creates a new
HarCacheRequest object from a JsonParser already
positioned at the beginning of the element content |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getComment()
Returns the comment value.
|
java.lang.String |
getETag()
Returns the eTag value.
|
java.util.Date |
getExpires()
Returns the expires value.
|
int |
getHitCount()
Returns the hitCount value.
|
java.util.Date |
getLastAccess()
Returns the lastAccess value.
|
void |
setComment(java.lang.String comment)
Sets the comment value.
|
void |
setETag(java.lang.String tag)
Sets the eTag value.
|
void |
setExpires(java.util.Date expires)
Sets the expires value.
|
void |
setHitCount(int hitCount)
Sets the hitCount value.
|
void |
setLastAccess(java.util.Date lastAccess)
Sets the lastAccess value.
|
java.lang.String |
toString() |
void |
writeHar(org.codehaus.jackson.JsonGenerator g)
Write this object on a JsonGenerator stream
|
void |
writeJDBC(long cacheId,
HarDatabaseConfig config,
java.sql.PreparedStatement cachePs,
long logId)
Write this object to a database according to the given configuration
|
public static java.lang.String TABLE_NAME
public HarCacheRequest(java.util.Date expires, java.util.Date lastAccess, java.lang.String tag, int hitCount, java.lang.String comment, boolean isBefore)
HarCacheRequest
objectexpires
- expires [string, optional] - Expiration time of the cache
entry.lastAccess
- lastAccess [string] - The last time the cache entry was
opened.tag
- eTag [string] - EtaghitCount
- hitCount [number] - The number of times the cache entry has
been opened.comment
- comment [string, optional] (new in 1.2) - A comment provided
by the user or the application.isBefore
- true if this is a beforeCache entry, false for an
afterCachepublic HarCacheRequest(java.util.Date lastAccess, java.lang.String tag, int hitCount, boolean isBefore)
HarCacheRequest
objectlastAccess
- tag
- hitCount
- isBefore
- true if this is a beforeCache entry, false for an
afterCachepublic HarCacheRequest(org.codehaus.jackson.JsonParser jp, boolean isBefore, java.util.List<HarWarning> warnings) throws org.codehaus.jackson.JsonParseException, java.io.IOException
HarCacheRequest
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 fieldsisBefore
- true if this is a beforeCache entry, false for an
afterCacheorg.codehaus.jackson.JsonParseException
java.io.IOException
public HarCacheRequest(HarDatabaseConfig config, long cacheId, boolean isBefore) throws java.sql.SQLException
HarCacheRequest
object from a database.
Retrieves the HarCacheRequest objects that corresponds to the specified
cache id.config
- the database configuration to usecacheId
- the cache id that we refer toisBefore
- true if this is a beforeCache entry, false for an
afterCachejava.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 cacheId, HarDatabaseConfig config, java.sql.PreparedStatement cachePs, long logId) throws java.sql.SQLException
cacheId
- the cache id this object refers tocachePs
- PreparedStatement to write data tojava.sql.SQLException
- if a database error occurspublic java.util.Date getExpires()
public void setExpires(java.util.Date expires)
expires
- The expires to set.public java.util.Date getLastAccess()
public void setLastAccess(java.util.Date lastAccess)
lastAccess
- The lastAccess to set.public java.lang.String getETag()
public void setETag(java.lang.String tag)
tag
- The eTag to set.public int getHitCount()
public void setHitCount(int hitCount)
hitCount
- The hitCount 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.