|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbe.unamur.inference.web.UserSessionBuilder<T,U>
T - The type of UserSession to consider.U - The type of UserRequest to consider.public abstract class UserSessionBuilder<T extends UserSession<U>,U extends UserRequest>
Represents an abstract UserSessionBuilder. This object encapsulates
methods to manage the building, filtering and dispatching the
UserSessions get from an InputStream. The filtering is done
using include and exclude UserRequestFilters and the processing is
delegated to UserSessionProcessors registered as listeners of this
builder object.
| Constructor Summary | |
|---|---|
UserSessionBuilder()
Creates a new user session builder. |
|
| Method Summary | |
|---|---|
UserSessionBuilder<T,U> |
addListener(UserSessionProcessor<T> listener)
Add a listener notified when a session is built (during buildSession call). |
abstract void |
buildSessions(InputStream input)
Build the session from the different request of the InputStream. |
UserSessionBuilder<T,U> |
exclude(UserRequestFilter<U> filter)
Add an include filter to this builder. |
UserSessionBuilder<T,U> |
include(UserRequestFilter<U> filter)
Add an include filter to this builder. |
protected boolean |
isAcceptedRequest(U req)
Check if the request is accepted according to the include and exclude filters. |
protected void |
sessionCompleted(T session)
Notifies the listeners that the given session has been built. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UserSessionBuilder()
| Method Detail |
|---|
public UserSessionBuilder<T,U> addListener(UserSessionProcessor<T> listener)
listener - The listener to add.
protected void sessionCompleted(T session)
session - The session given to the listeners.public UserSessionBuilder<T,U> include(UserRequestFilter<U> filter)
filter - The filter to add
public UserSessionBuilder<T,U> exclude(UserRequestFilter<U> filter)
filter - The filter to add
protected boolean isAcceptedRequest(U req)
req - The request to process.
public abstract void buildSessions(InputStream input)
throws SessionBuildException
InputStream.
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).
input - The InputStream to read.
SessionBuildException - If an exception occurs during the building
of the sessions.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||