Package kieker.analysis.behavior.model
Class UserSession
java.lang.Object
kieker.analysis.behavior.model.UserSession
Represents a user session.
- Since:
- 2.0.0
- Author:
- Robert Heinrich, Alessandro Giusa, Christoph Dornieden
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<EntryCallEvent>Simple comparator for comparing the entry times.static final Comparator<EntryCallEvent>Simple comparator for comparing the exit times. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(EntryCallEvent event) Add the given event to this user session.voidadd(EntryCallEvent event, boolean sortByEntryTime) Add the given event to this user session and sort the internal list by the entry time if true is set for sortByEntrytime.static StringParse the id which would be constructed by theUserSessionclass if it contained that event.static StringcreateUserSessionId(ISessionEvent event) Parse the id which would be constructed by theUserSessionclass if it contained that event.booleanlongGet the entry time of this entire session.longGet the exit time of this entire session.getHost()inthashCode()iterator()Get the iterator of the internal event list.intsize()Return the size of the events for this user session.voidSort the internal events by the givenComparator.toString()
-
Field Details
-
SORT_ENTRY_CALL_EVENTS_BY_ENTRY_TIME
Simple comparator for comparing the entry times. -
SORT_ENTRY_CALL_EVENTS_BY_EXIT_TIME
Simple comparator for comparing the exit times.
-
-
Constructor Details
-
UserSession
Simple constructor. Create a user session.- Parameters:
host- host namesessionId- unique session id
-
-
Method Details
-
toString
-
sortEventsBy
Sort the internal events by the givenComparator. This class has a default oneSORT_ENTRY_CALL_EVENTS_BY_ENTRY_TIME- Parameters:
cmp- comparator to sort user sessions
-
add
Add the given event to this user session.- Parameters:
event- event to be added
-
add
Add the given event to this user session and sort the internal list by the entry time if true is set for sortByEntrytime.- Parameters:
event- event to be addedsortByEntryTime- true will trigger sort of the internal list
-
iterator
Get the iterator of the internal event list.- Returns:
- iterator
-
size
public int size()Return the size of the events for this user session.- Returns:
- size
-
createUserSessionId
Parse the id which would be constructed by theUserSessionclass if it contained that event.- Parameters:
event- event- Returns:
- unique id
-
createUserSessionId
Parse the id which would be constructed by theUserSessionclass if it contained that event.- Parameters:
event- event- Returns:
- unique id
-
getExitTime
public long getExitTime()Get the exit time of this entire session.- Returns:
- 0 if no events available at all and > 0 else.
-
getEntryTime
public long getEntryTime()Get the entry time of this entire session.- Returns:
- 0 if no events available at all and > 0 else.
-
getEvents
-
getSessionId
-
getHost
-
hashCode
public int hashCode() -
equals
-