public class UserDeviceData extends BasicData implements RegisteredData, NameableData
getToken()
is randomly generated token that
each device is supposed to keep track of and submit together
with the login info.Modifier and Type | Field and Description |
---|---|
private ClientData |
client |
private java.lang.String |
description |
private java.util.Date |
entryDate |
private java.util.Date |
lastUsed |
private java.lang.String |
location |
private java.lang.Float |
locationLat |
private java.lang.Float |
locationLong |
static int |
MAX_LOCATION_LENGTH
The maximum length of the location that can be stored in the database.
|
static int |
MAX_REMOTE_ID_LENGTH
The maximum length of the remote ID that can be stored in the database.
|
static int |
MAX_TOKEN_LENGTH
The maximum length of the device token that can be stored in the database.
|
static int |
MAX_USER_AGENT_LENGTH
The maximum length of the user agent that can be stored in the database.
|
private java.lang.String |
name |
private java.lang.String |
remoteId |
private java.util.Set<SessionData> |
sessions |
private java.lang.String |
token |
private UserData |
user |
private java.lang.String |
userAgent |
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
UserDeviceData() |
Modifier and Type | Method and Description |
---|---|
ClientData |
getClient()
Get the client application this device is associated with.
|
java.lang.String |
getDescription()
Get the description for the item.
|
java.util.Date |
getEntryDate()
Get the date this item was added to the database.
|
java.lang.String |
getLastRemoteId()
Get the remote id (=ip address) of the last login from this device.
|
java.util.Date |
getLastUsed()
Get the date and time the user last logged in from this device.
|
java.lang.String |
getLocation()
Get the location of the user (if known).
|
java.lang.Float |
getLocationLatitude()
Get the location latitude of the user (if known).
|
java.lang.Float |
getLocationLongitude()
Get the location longitude of the user (if known).
|
java.lang.String |
getName()
Get the name of the item.
|
(package private) java.util.Set<SessionData> |
getSessions()
This is the inverse end but we do not map with inverse="true" cascade="delete"
since we want Hibernate to set SessionData.device_id = null instead of deleting
sessions.
|
java.lang.String |
getToken()
Get the device token.
|
UserData |
getUser()
The user that this device is associated with.
|
java.lang.String |
getUserAgent()
Get a string with more information about the device (eg.
|
void |
setClient(ClientData client) |
void |
setDescription(java.lang.String description)
Set the description for the item.
|
void |
setEntryDate(java.util.Date entryDate) |
void |
setLastRemoteId(java.lang.String remoteId) |
void |
setLastUsed(java.util.Date lastUsed) |
void |
setLocation(java.lang.String location) |
void |
setLocationLatitude(java.lang.Float locationLat) |
void |
setLocationLongitude(java.lang.Float locationLong) |
void |
setName(java.lang.String name)
Set the name of the item.
|
(package private) void |
setSessions(java.util.Set<SessionData> sessions) |
void |
setToken(java.lang.String token) |
void |
setUser(UserData user) |
void |
setUserAgent(java.lang.String userAgent) |
equals, getId, getVersion, hashCode, setId, setVersion, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
private UserData user
private ClientData client
private java.util.Date entryDate
private java.lang.String name
private java.lang.String description
public static final int MAX_TOKEN_LENGTH
setToken(String)
,
Constant Field Valuesprivate java.lang.String token
public static final int MAX_USER_AGENT_LENGTH
setUserAgent(String)
,
Constant Field Valuesprivate java.lang.String userAgent
private java.util.Date lastUsed
public static final int MAX_REMOTE_ID_LENGTH
setLastRemoteId(String)
,
Constant Field Valuesprivate java.lang.String remoteId
public static final int MAX_LOCATION_LENGTH
setLocation(String)
,
Constant Field Valuesprivate java.lang.String location
private java.lang.Float locationLat
private java.lang.Float locationLong
private java.util.Set<SessionData> sessions
public UserData getUser()
public void setUser(UserData user)
public ClientData getClient()
public void setClient(ClientData client)
public java.util.Date getEntryDate()
RegisteredData
getEntryDate
in interface RegisteredData
public void setEntryDate(java.util.Date entryDate)
public java.lang.String getName()
NameableData
getName
in interface NameableData
String
with the name of the itempublic void setName(java.lang.String name)
NameableData
MAX_NAME_LENGTH
constant.setName
in interface NameableData
name
- The new name for the itempublic java.lang.String getDescription()
NameableData
getDescription
in interface NameableData
String
with a description of the itempublic void setDescription(java.lang.String description)
NameableData
MAX_DESCRIPTION_LENGTH
constant.setDescription
in interface NameableData
description
- The new description for the itempublic java.lang.String getToken()
public void setToken(java.lang.String token)
public java.lang.String getUserAgent()
public void setUserAgent(java.lang.String userAgent)
public java.util.Date getLastUsed()
public void setLastUsed(java.util.Date lastUsed)
public java.lang.String getLastRemoteId()
public void setLastRemoteId(java.lang.String remoteId)
public java.lang.String getLocation()
public void setLocation(java.lang.String location)
public java.lang.Float getLocationLatitude()
public void setLocationLatitude(java.lang.Float locationLat)
public java.lang.Float getLocationLongitude()
public void setLocationLongitude(java.lang.Float locationLong)
java.util.Set<SessionData> getSessions()
SessionData.getDevice()
void setSessions(java.util.Set<SessionData> sessions)