Package ca.uqac.lif.cep.apache
Class ParseCommonLog
java.lang.Object
ca.uqac.lif.cep.functions.Function
ca.uqac.lif.cep.functions.UnaryFunction<String,HttpRequest>
ca.uqac.lif.cep.apache.ParseCommonLog
- All Implemented Interfaces:
ca.uqac.lif.cep.Duplicable,ca.uqac.lif.cep.functions.DuplicableFunction
Parses a line of an Apache log in the
common log format
and creates an
HttpRequest object with it.- Author:
- Sylvain Hallé
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParseCommonLogprotected final CalendarAn instance of calendar to convert dates into timestampsprotected static final PatternThe pattern to parse a line of the logprotected static final PatternThe pattern to parse a URLFields inherited from class ca.uqac.lif.cep.functions.Function
s_maxInputArity -
Method Summary
Modifier and TypeMethodDescriptionstatic final StringCreates a string out of a methodparseParameters(String param_string) static longqueryToMap(String query, HttpRequest.Method m) Convenience method to transform a GET query into a map of attribute-value pairs.static HttpRequest.Methodstatic intMethods inherited from class ca.uqac.lif.cep.functions.UnaryFunction
duplicate, evaluate, getInputArity, getInputTypesFor, getOutputArity, getOutputTypeFor, resetMethods inherited from class ca.uqac.lif.cep.functions.Function
duplicate, evaluate, evaluate, evaluateLazy, evaluatePartial, printState, readState
-
Field Details
-
instance
-
m_calendar
An instance of calendar to convert dates into timestamps -
s_linePattern
The pattern to parse a line of the log -
s_urlPattern
The pattern to parse a URL
-
-
Method Details
-
getValue
- Specified by:
getValuein classca.uqac.lif.cep.functions.UnaryFunction<String,HttpRequest>
-
parseTime
-
stringToMonth
-
queryToMap
Convenience method to transform a GET query into a map of attribute-value pairs. For example, given an URI object representing the URL "http://abc.com/xyz?a=1&b=2", the method will return an object mapping "a" to "1" and "b" to "2".- Parameters:
query- The URI to processm- The method (GET, POST, etc.) of the request- Returns:
- A map of attribute-value pairs
-
methodToString
Creates a string out of a method- Parameters:
m- The method- Returns:
- The method in string
-
stringToMethod
-
parseParameters
-