Class UserSession


  • public class UserSession
    extends java.lang.Object

    Represents a user's session on the liberator

    A UserSession instance contains an AuthenticationUser and information about the session and its connection details.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.String getApplicationId()
      The application identifier provided by the client.
      java.util.Date getConnectionTime()
      The time at which the session was connected.
      java.lang.String getIpAddress()
      The source ip address of the client's host.
      java.lang.String getMachineId()
      The machine identifier provided by the client.
      java.lang.String getSessionId()
      The unique session identifier for this session.
      AuthenticationUser getUser()
      The user of this session.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getApplicationId

        public java.lang.String getApplicationId()

        The application identifier provided by the client.

        This information can be used for application-specific authentication.

        Returns:
        the application identifier provided by the client attempting login
      • getIpAddress

        public java.lang.String getIpAddress()

        The source ip address of the client's host.

        This information can be used for location-based permissioning or blocking specific ip-address ranges. Also can be useful when ejecting sessions using the SessionManager

        N.B. This ip address may be a proxy or gateway rather than the client's true ip address

        Returns:
        the source ip address of the session's connection
      • getMachineId

        public java.lang.String getMachineId()

        The machine identifier provided by the client.

        This information can be used for machine-specific permissioning. Can also be useful when ejecting sessions using the SessionManager

        Returns:
        the machine identifier provided by the client attempting login
      • getConnectionTime

        public java.util.Date getConnectionTime()
        The time at which the session was connected.
        Returns:
        the time at which the session was connected.
      • getSessionId

        public java.lang.String getSessionId()

        The unique session identifier for this session.

        These session identifiers are unique per session present in the liberator.

        Returns:
        the unique session identifier allocated by the liberator for this user session
      • toString

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

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

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