public class HarEntry extends java.lang.Object implements java.lang.Comparable<HarEntry>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TABLE_NAME
Database table name where the data is stored
|
Constructor and Description |
---|
HarEntry(java.util.Date startedDateTime,
long time,
HarRequest request,
HarResponse response,
HarCache cache,
HarEntryTimings timings)
Creates a new
HarEntry object |
HarEntry(HarDatabaseConfig config,
long entryId)
Creates a new
HarEntry object from a database. |
HarEntry(org.codehaus.jackson.JsonParser jp,
java.util.List<HarWarning> warnings)
Creates a new
HarEntry object from a JsonParser already
positioned at the beginning of the element content |
HarEntry(java.lang.String pageRef,
java.util.Date startedDateTime,
long time,
HarRequest request,
HarResponse response,
HarCache cache,
HarEntryTimings timings,
java.lang.String serverIPAddress,
java.lang.String connection,
java.lang.String comment)
Creates a new
HarEntry object |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(HarEntry o) |
void |
deleteFromJDBC(HarDatabaseConfig config,
long logId,
boolean dropTables)
Delete entries objects in the database referencing the specified logId.
|
HarCache |
getCache()
Returns the cache value.
|
java.lang.String |
getComment()
Returns the comment value.
|
java.lang.String |
getConnection()
Returns the connection value.
|
HarCustomFields |
getCustomFields()
Returns the customFields value.
|
java.lang.String |
getPageRef()
Returns the pageRef value.
|
HarRequest |
getRequest()
Returns the request value.
|
HarResponse |
getResponse()
Returns the response value.
|
java.lang.String |
getServerIPAddress()
Returns the serverIPAddress value.
|
java.util.Date |
getStartedDateTime()
Returns the startedDateTime value.
|
long |
getTime()
Returns the time value.
|
HarEntryTimings |
getTimings()
Returns the timings value.
|
void |
setCache(HarCache cache)
Sets the cache value.
|
void |
setComment(java.lang.String comment)
Sets the comment value.
|
void |
setConnection(java.lang.String connection)
Sets the connection value.
|
void |
setCustomFields(HarCustomFields customFields)
Sets the customFields value.
|
void |
setPageRef(java.lang.String pageRef)
Sets the pageRef value.
|
void |
setRequest(HarRequest request)
Sets the request value.
|
void |
setResponse(HarResponse response)
Sets the response value.
|
void |
setServerIPAddress(java.lang.String serverIPAddress)
Sets the serverIPAddress value.
|
void |
setStartedDateTime(java.util.Date startedDateTime)
Sets the startedDateTime value.
|
void |
setTime(long time)
Sets the time value.
|
void |
setTimings(HarEntryTimings timings)
Sets the timings value.
|
java.lang.String |
toString() |
void |
writeHar(org.codehaus.jackson.JsonGenerator g)
Write this object on a JsonGenerator stream
|
void |
writeJDBC(long logId,
java.sql.PreparedStatement entryPs,
HarDatabaseConfig config)
Write this object in the given database referencing the specified logId.
|
public static java.lang.String TABLE_NAME
public HarEntry(java.util.Date startedDateTime, long time, HarRequest request, HarResponse response, HarCache cache, HarEntryTimings timings)
HarEntry
objectstartedDateTime
- startedDateTime [string] - Date and time stamp of
the request start (ISO 8601 - YYYY-MM-DDThh:mm:ss.sTZD).time
- time [number] - Total elapsed time of the request in
milliseconds. This is the sum of all timings available in the
timings object (i.e. not including -1 values) .request
- request [object] - Detailed info about the request.response
- response [object] - Detailed info about the response.cache
- cache [object] - Info about cache usage.timings
- timings [object] - Detailed timing info about
request/response round trip.public HarEntry(java.lang.String pageRef, java.util.Date startedDateTime, long time, HarRequest request, HarResponse response, HarCache cache, HarEntryTimings timings, java.lang.String serverIPAddress, java.lang.String connection, java.lang.String comment)
HarEntry
objectpageRef
- pageref [string, unique, optional] - Reference to the parent
page. Leave out this field if the application does not support
grouping by pages.startedDateTime
- startedDateTime [string] - Date and time stamp of
the request start (ISO 8601 - YYYY-MM-DDThh:mm:ss.sTZD).time
- time [number] - Total elapsed time of the request in
milliseconds. This is the sum of all timings available in the
timings object (i.e. not including -1 values) .request
- request [object] - Detailed info about the request.response
- response [object] - Detailed info about the response.cache
- cache [object] - Info about cache usage.timings
- timings [object] - Detailed timing info about
request/response round trip.serverIPAddress
- serverIPAddress [string, optional] (new in 1.2) - IP
address of the server that was connected (result of DNS
resolution).connection
- connection [string, optional] (new in 1.2) - Unique ID of
the parent TCP/IP connection, can the client port number. Note
that a port number doesn't have to be unique identifier in cases
where the port is shared for more connections. If the port isn't
available for the application, any other unique connection ID can
be used instead (e.g. connection index). Leave out this field if
the application doesn't support this info.comment
- comment [string, optional] (new in 1.2) - A comment provided
by the user or the application.public HarEntry(org.codehaus.jackson.JsonParser jp, java.util.List<HarWarning> warnings) throws org.codehaus.jackson.JsonParseException, java.io.IOException
HarEntry
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 HarEntry(HarDatabaseConfig config, long entryId) throws java.sql.SQLException
HarEntry
object from a database. Retrieves the
HarEntry objects that corresponds to the specified page 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 logId, java.sql.PreparedStatement entryPs, HarDatabaseConfig config) throws java.sql.SQLException
logId
- the logId this object refers toentryPs
- PreparedStatement to write entry dataconfig
- the database configurationjava.sql.SQLException
- if a database access 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 java.lang.String getPageRef()
public void setPageRef(java.lang.String pageRef)
pageRef
- The pageRef to set.public java.util.Date getStartedDateTime()
public void setStartedDateTime(java.util.Date startedDateTime)
startedDateTime
- The startedDateTime to set.public long getTime()
public void setTime(long time)
time
- The time to set.public HarRequest getRequest()
public void setRequest(HarRequest request)
request
- The request to set.public HarResponse getResponse()
public void setResponse(HarResponse response)
response
- The response to set.public HarCache getCache()
public void setCache(HarCache cache)
cache
- The cache to set.public HarEntryTimings getTimings()
public void setTimings(HarEntryTimings timings)
timings
- The timings to set.public java.lang.String getServerIPAddress()
public void setServerIPAddress(java.lang.String serverIPAddress)
serverIPAddress
- The serverIPAddress to set.public java.lang.String getConnection()
public void setConnection(java.lang.String connection)
connection
- The connection 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.