public class ApacheUserSessionBuilder extends UserSessionBuilder<ApacheUserSession,ApacheUserRequest>
UserSessionProcessor<ApacheUserSession> listener;
UserRequestFilter<ApacheUserRequest> includeFilter;
UserRequestFilter<ApacheUserRequest> excludeFilter;
// ...
newInstance().logFormat(ApacheLogFormatPatternBuilder.COMMON_LOG_FORMAT)
.sessionTimeout(ApacheUserSessionBuilder.DEFAULT_TIMEOUT)
.include(includeFilter)
.exclude(excludeFilter)
.addListener(listener)
.buildSessions(new FileInputStream("apache-web.log"));
ApacheUserSession,
ApacheLogFormatPatternBuilder| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_TIMEOUT
The default timeout for the sessions.
|
| Modifier and Type | Method and Description |
|---|---|
void |
buildSessions(InputStream input)
Build the session from the different request of the
InputStream. |
ApacheUserSessionBuilder |
logFormat(String logFormat)
Specify the log format to use.
|
static ApacheUserSessionBuilder |
newInstance()
Returns a new instance of this class.
|
ApacheUserSessionBuilder |
sessionTimeout(long timeout)
Set the timeout to consider for the user sessions.
|
addListener, exclude, include, isAcceptedRequest, sessionCompletedpublic static final long DEFAULT_TIMEOUT
public static ApacheUserSessionBuilder newInstance()
public ApacheUserSessionBuilder logFormat(String logFormat)
ApacheLogFormatPatternBuilder.COMMON_LOG_FORMAT.logFormat - The new log format to use.public ApacheUserSessionBuilder sessionTimeout(long timeout)
ApacheUserSessionBuilder.DEFAULT_TIMEOUTtimeout - The new timeout.public void buildSessions(InputStream input) throws SessionBuildException
UserSessionBuilderInputStream.
Each time a session is build, the sessionCompleted(Session) method is
called to notify the listeners of the builder. All the requests in the
builded sessions have to satisfy isAcceptedRequest(Request).buildSessions in class UserSessionBuilder<ApacheUserSession,ApacheUserRequest>input - The InputStream to read.SessionBuildException - If an exception occurs during the building
of the sessions.Copyright © 2014–2018 University of Namur. All rights reserved.