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