Class ActiveWebSession

java.lang.Object
com.dropbox.core.v2.team.DeviceSession
com.dropbox.core.v2.team.ActiveWebSession

public class ActiveWebSession extends DeviceSession
Information on active web sessions.
  • Field Details

    • userAgent

      @Nonnull protected final String userAgent
    • os

      @Nonnull protected final String os
    • browser

      @Nonnull protected final String browser
    • expires

      @Nullable protected final Date expires
  • Constructor Details

    • ActiveWebSession

      public ActiveWebSession(@Nonnull String sessionId, @Nonnull String userAgent, @Nonnull String os, @Nonnull String browser, @Nullable String ipAddress, @Nullable String country, @Nullable Date created, @Nullable Date updated, @Nullable Date expires)
      Information on active web sessions.

      Use newBuilder(java.lang.String,java.lang.String,java.lang.String,java.lang.String) to create instances of this class without specifying values for all optional fields.

      Parameters:
      sessionId - The session id. Must not be null.
      userAgent - Information on the hosting device. Must not be null.
      os - Information on the hosting operating system. Must not be null.
      browser - Information on the browser used for this web session. Must not be null.
      ipAddress - The IP address of the last activity from this session.
      country - The country from which the last activity from this session was made.
      created - The time this session was created.
      updated - The time of the last activity from this session.
      expires - The time this session expires.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • ActiveWebSession

      public ActiveWebSession(@Nonnull String sessionId, @Nonnull String userAgent, @Nonnull String os, @Nonnull String browser)
      Information on active web sessions.

      The default values for unset fields will be used.

      Parameters:
      sessionId - The session id. Must not be null.
      userAgent - Information on the hosting device. Must not be null.
      os - Information on the hosting operating system. Must not be null.
      browser - Information on the browser used for this web session. Must not be null.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
  • Method Details

    • getSessionId

      @Nonnull public String getSessionId()
      The session id.
      Overrides:
      getSessionId in class DeviceSession
      Returns:
      value for this field, never null.
    • getUserAgent

      @Nonnull public String getUserAgent()
      Information on the hosting device.
      Returns:
      value for this field, never null.
    • getOs

      @Nonnull public String getOs()
      Information on the hosting operating system.
      Returns:
      value for this field, never null.
    • getBrowser

      @Nonnull public String getBrowser()
      Information on the browser used for this web session.
      Returns:
      value for this field, never null.
    • getIpAddress

      @Nullable public String getIpAddress()
      The IP address of the last activity from this session.
      Overrides:
      getIpAddress in class DeviceSession
      Returns:
      value for this field, or null if not present.
    • getCountry

      @Nullable public String getCountry()
      The country from which the last activity from this session was made.
      Overrides:
      getCountry in class DeviceSession
      Returns:
      value for this field, or null if not present.
    • getCreated

      @Nullable public Date getCreated()
      The time this session was created.
      Overrides:
      getCreated in class DeviceSession
      Returns:
      value for this field, or null if not present.
    • getUpdated

      @Nullable public Date getUpdated()
      The time of the last activity from this session.
      Overrides:
      getUpdated in class DeviceSession
      Returns:
      value for this field, or null if not present.
    • getExpires

      @Nullable public Date getExpires()
      The time this session expires.
      Returns:
      value for this field, or null if not present.
    • newBuilder

      public static ActiveWebSession.Builder newBuilder(String sessionId, String userAgent, String os, String browser)
      Returns a new builder for creating an instance of this class.
      Parameters:
      sessionId - The session id. Must not be null.
      userAgent - Information on the hosting device. Must not be null.
      os - Information on the hosting operating system. Must not be null.
      browser - Information on the browser used for this web session. Must not be null.
      Returns:
      builder for this class.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class DeviceSession
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class DeviceSession
    • toString

      public String toString()
      Overrides:
      toString in class DeviceSession
    • toStringMultiline

      public String toStringMultiline()
      Returns a String representation of this object formatted for easier readability.

      The returned String may contain newlines.

      Overrides:
      toStringMultiline in class DeviceSession
      Returns:
      Formatted, multiline String representation of this object