Class HTTPServerResourceAccess
- java.lang.Object
-
- org.ametys.plugins.site.cache.monitoring.process.access.impl.HTTPServerResourceAccess
-
- All Implemented Interfaces:
ResourceAccess
public class HTTPServerResourceAccess extends Object implements ResourceAccess
Apache resource access. Represent an access to a resource from Apache. These objects are created will parsing the Apache access logs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
HTTPServerResourceAccess.Field
-
Field Summary
Fields Modifier and Type Field Description private static Pattern
__PATTERN
private boolean
_cacheHit
private Date
_date
private String
_httpMethod
private String
_httpPath
private String
_httpPathHash
private String
_httpQueryString
protected static org.slf4j.Logger
_LOGGER
loggerprivate String
_originalStatusCode
private String
_returnedStatusCode
private String
_site
private String
_uniqueID
-
Constructor Summary
Constructors Modifier Constructor Description protected
HTTPServerResourceAccess(Map<HTTPServerResourceAccess.Field,Object> params)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HTTPServerResourceAccess
createRecord(String entry, DateFormat df)
Create a new record instanceString
getInsertStatementId()
Retrieves the name of the SQL statement to call.Map<String,Object>
getInsertStatementParameters()
Retrieves the map of parameters to use when executing the insert statement.boolean
isOfInterest(Date date)
Indicates if this record should be persisted in the database.String
toString()
-
-
-
Field Detail
-
_LOGGER
protected static final org.slf4j.Logger _LOGGER
logger
-
_httpMethod
private final String _httpMethod
-
_httpPathHash
private final String _httpPathHash
-
_httpQueryString
private final String _httpQueryString
-
_originalStatusCode
private final String _originalStatusCode
-
_returnedStatusCode
private final String _returnedStatusCode
-
_cacheHit
private final boolean _cacheHit
-
-
Constructor Detail
-
HTTPServerResourceAccess
protected HTTPServerResourceAccess(Map<HTTPServerResourceAccess.Field,Object> params)
Constructor- Parameters:
params
- the parameters used
-
-
Method Detail
-
createRecord
public static HTTPServerResourceAccess createRecord(String entry, DateFormat df)
Create a new record instance- Parameters:
entry
- the server access log entrydf
- the date format to use for the record- Returns:
- the created record
-
getInsertStatementId
public String getInsertStatementId()
Description copied from interface:ResourceAccess
Retrieves the name of the SQL statement to call.- Specified by:
getInsertStatementId
in interfaceResourceAccess
- Returns:
- The name of the SQL statement to call.
-
getInsertStatementParameters
public Map<String,Object> getInsertStatementParameters()
Description copied from interface:ResourceAccess
Retrieves the map of parameters to use when executing the insert statement.- Specified by:
getInsertStatementParameters
in interfaceResourceAccess
- Returns:
- The map of parameters
-
isOfInterest
public boolean isOfInterest(Date date)
Indicates if this record should be persisted in the database. If it returns false, it means that this record must be filtered out and must not be inserted into the database.- Parameters:
date
- The date at which the httpserver log importer has been started.- Returns:
- True is this record is newer than the date passed as an argument.
-
-