Class UserSession

java.lang.Object
kieker.analysis.behavior.model.UserSession

public final class UserSession
extends java.lang.Object
Represents a user session.
Since:
2.0.0
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.util.Comparator<EntryCallEvent> SORT_ENTRY_CALL_EVENTS_BY_ENTRY_TIME
    Simple comparator for comparing the entry times.
    static java.util.Comparator<EntryCallEvent> SORT_ENTRY_CALL_EVENTS_BY_EXIT_TIME
    Simple comparator for comparing the exit times.
  • Constructor Summary

    Constructors 
    Constructor Description
    UserSession​(java.lang.String host, java.lang.String sessionId)
    Simple constructor.
  • Method Summary

    Modifier and Type Method Description
    void add​(EntryCallEvent event)
    Add the given event to this user session.
    void add​(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 java.lang.String createUserSessionId​(EntryCallEvent event)
    Parse the id which would be constructed by the UserSession class if it contained that event.
    static java.lang.String createUserSessionId​(kieker.common.record.session.ISessionEvent event)
    Parse the id which would be constructed by the UserSession class if it contained that event.
    boolean equals​(java.lang.Object obj)  
    long getEntryTime()
    Get the entry time of this entire session.
    java.util.List<EntryCallEvent> getEvents()  
    long getExitTime()
    Get the exit time of this entire session.
    java.lang.String getHost()  
    java.lang.String getSessionId()  
    int hashCode()  
    java.util.Iterator<EntryCallEvent> iterator()
    Get the iterator of the internal event list.
    int size()
    Return the size of the events for this user session.
    void sortEventsBy​(java.util.Comparator<EntryCallEvent> cmp)
    Sort the internal events by the given Comparator.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • UserSession

      public UserSession​(java.lang.String host, java.lang.String sessionId)
      Simple constructor. Create a user session.
      Parameters:
      host - host name
      sessionId - unique session id
  • Method Details

    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • sortEventsBy

      public void sortEventsBy​(java.util.Comparator<EntryCallEvent> cmp)
      Sort the internal events by the given Comparator. This class has a default one SORT_ENTRY_CALL_EVENTS_BY_ENTRY_TIME
      Parameters:
      cmp - comparator to sort user sessions
    • add

      public void add​(EntryCallEvent event)
      Add the given event to this user session.
      Parameters:
      event - event to be added
    • add

      public void add​(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.
      Parameters:
      event - event to be added
      sortByEntryTime - true will trigger sort of the internal list
    • iterator

      public java.util.Iterator<EntryCallEvent> 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

      public static java.lang.String createUserSessionId​(EntryCallEvent event)
      Parse the id which would be constructed by the UserSession class if it contained that event.
      Parameters:
      event - event
      Returns:
      unique id
    • createUserSessionId

      public static java.lang.String createUserSessionId​(kieker.common.record.session.ISessionEvent event)
      Parse the id which would be constructed by the UserSession class 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

      public java.util.List<EntryCallEvent> getEvents()
    • getSessionId

      public java.lang.String getSessionId()
    • getHost

      public java.lang.String getHost()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object