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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields inherited from class com.logicaldoc.core.PersistentObject
DELETED_CODE_DEFAULT, DELETED_CODE_STRONG, id -
Method Summary
Modifier and TypeMethodDescriptionintbooleanlongRetrieves the total duration of the sessiongetKey()getLogs()getNode()getSid()intlonggetUser()longinthashCode()booleanisEmpty()booleanisOpen()voidvoidvoidvoidvoidsetDecodedKey(String decodedKey) Sets the key and encode itvoidsetFinished(Date finished) voidvoidsetKeyLabel(String keyLabel) voidsetLastRenew(Date lastRenew) voidvoidsetTenantId(long tenantId) voidsetTenantName(String tenantName) voidsetUsername(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:
toStringin classPersistentObject
-
getUserId
public long getUserId() -
getTenantId
public long getTenantId()- Overrides:
getTenantIdin 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:
setTenantIdin classPersistentObject
-
setTenantName
-
getUnprotectedDocs
-
getNode
-
setNode
-
setLastRenew
-
getFinished
-
setFinished
-
getKeyLabel
-
setKeyLabel
-
compareTo
- Specified by:
compareToin interfaceComparable<Session>
-
hashCode
public int hashCode()- Overrides:
hashCodein classPersistentObject
-
equals
- Overrides:
equalsin classPersistentObject
-