public class ActiveWebSession extends DeviceSession
Modifier and Type | Class and Description |
---|---|
static class |
ActiveWebSession.Builder
Builder for
ActiveWebSession . |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
browser |
protected java.util.Date |
expires |
protected java.lang.String |
os |
protected java.lang.String |
userAgent |
Constructor and Description |
---|
ActiveWebSession(java.lang.String sessionId,
java.lang.String userAgent,
java.lang.String os,
java.lang.String browser)
Information on active web sessions.
|
ActiveWebSession(java.lang.String sessionId,
java.lang.String userAgent,
java.lang.String os,
java.lang.String browser,
java.lang.String ipAddress,
java.lang.String country,
java.util.Date created,
java.util.Date updated,
java.util.Date expires)
Information on active web sessions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getBrowser()
Information on the browser used for this web session.
|
java.lang.String |
getCountry()
The country from which the last activity from this session was made.
|
java.util.Date |
getCreated()
The time this session was created.
|
java.util.Date |
getExpires()
The time this session expires.
|
java.lang.String |
getIpAddress()
The IP address of the last activity from this session.
|
java.lang.String |
getOs()
Information on the hosting operating system.
|
java.lang.String |
getSessionId()
The session id.
|
java.util.Date |
getUpdated()
The time of the last activity from this session.
|
java.lang.String |
getUserAgent()
Information on the hosting device.
|
int |
hashCode() |
static ActiveWebSession.Builder |
newBuilder(java.lang.String sessionId,
java.lang.String userAgent,
java.lang.String os,
java.lang.String browser)
Returns a new builder for creating an instance of this class.
|
java.lang.String |
toString() |
java.lang.String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
newBuilder
protected final java.lang.String userAgent
protected final java.lang.String os
protected final java.lang.String browser
protected final java.util.Date expires
public ActiveWebSession(java.lang.String sessionId, java.lang.String userAgent, java.lang.String os, java.lang.String browser, java.lang.String ipAddress, java.lang.String country, java.util.Date created, java.util.Date updated, java.util.Date expires)
Use newBuilder
to create instances of this class without
specifying values for all optional fields.
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.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public ActiveWebSession(java.lang.String sessionId, java.lang.String userAgent, java.lang.String os, java.lang.String browser)
The default values for unset fields will be used.
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
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public java.lang.String getSessionId()
getSessionId
in class DeviceSession
null
.public java.lang.String getUserAgent()
null
.public java.lang.String getOs()
null
.public java.lang.String getBrowser()
null
.public java.lang.String getIpAddress()
getIpAddress
in class DeviceSession
null
if not present.public java.lang.String getCountry()
getCountry
in class DeviceSession
null
if not present.public java.util.Date getCreated()
getCreated
in class DeviceSession
null
if not present.public java.util.Date getUpdated()
getUpdated
in class DeviceSession
null
if not present.public java.util.Date getExpires()
null
if not present.public static ActiveWebSession.Builder newBuilder(java.lang.String sessionId, java.lang.String userAgent, java.lang.String os, java.lang.String browser)
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
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public int hashCode()
hashCode
in class DeviceSession
public boolean equals(java.lang.Object obj)
equals
in class DeviceSession
public java.lang.String toString()
toString
in class DeviceSession
public java.lang.String toStringMultiline()
The returned String may contain newlines.
toStringMultiline
in class DeviceSession