Package com.logicaldoc.core.security
Class Session
java.lang.Object
com.logicaldoc.core.PersistentObject
com.logicaldoc.core.security.Session
- All Implemented Interfaces:
Serializable
,Comparable<Session>
A single user session with it's unique identifier and the reference to the
user
- Since:
- 4.6.0
- Author:
- Marco Meschieri - LogicalDOC
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
Fields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
long
Retrieves the total duration of the sessiongetKey()
getLogs()
getNode()
getSid()
int
long
getUser()
long
int
hashCode()
boolean
isEmpty()
boolean
isOpen()
void
void
void
void
void
setDecodedKey
(String decodedKey) Sets the key and encode itvoid
setFinished
(Date finished) void
void
setKeyLabel
(String keyLabel) void
setLastRenew
(Date lastRenew) void
void
setTenantId
(long tenantId) void
setTenantName
(String tenantName) void
setUsername
(String username) toString()
Methods inherited from class com.logicaldoc.core.PersistentObject
getCreation, getDeleted, getId, getLastModified, getRecordVersion, setCreation, setDeleted, setId, setLastModified, setRecordVersion
-
Field Details
-
STATUS_OPEN
public static final int STATUS_OPEN- See Also:
-
STATUS_EXPIRED
public static final int STATUS_EXPIRED- See Also:
-
STATUS_CLOSED
public static final int STATUS_CLOSED- See Also:
-
-
Method Details
-
getDictionary
-
getSid
-
getLastRenew
-
isOpen
public boolean isOpen() -
getStatus
public int getStatus() -
setClosed
public void setClosed() -
getDecodedKey
-
setDecodedKey
Sets the key and encode it- Parameters:
decodedKey
- The key in readable format- Throws:
NoSuchAlgorithmException
- Cripting error
-
getUsername
-
toString
- Overrides:
toString
in classPersistentObject
-
getUserId
public long getUserId() -
getTenantId
public long getTenantId()- Overrides:
getTenantId
in classPersistentObject
-
getTenantName
-
logError
-
logWarn
-
logInfo
-
getLogs
-
getLastError
-
isEmpty
public boolean isEmpty() -
getDuration
public long getDuration()Retrieves the total duration of the session- Returns:
- the duration in milliseconds
-
getKey
-
setKey
-
getClient
-
getUser
-
setUsername
-
setTenantId
public void setTenantId(long tenantId) - Overrides:
setTenantId
in classPersistentObject
-
setTenantName
-
getUnprotectedDocs
-
getNode
-
setNode
-
setLastRenew
-
getFinished
-
setFinished
-
getKeyLabel
-
setKeyLabel
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Session>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classPersistentObject
-
equals
- Overrides:
equals
in classPersistentObject
-