|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<SessionData> net.sf.basedb.core.Session
public class Session
A session represents the time between login and logout for a single user. Hence, a session item is automatically created when a user logs in, and is automatically updated when the user logs out.
A session said to be active when the user is logged in.
Field Summary | |
---|---|
static Item |
TYPE
The type of item represented by this class. |
Constructor Summary | |
---|---|
Session(SessionData sessionData)
|
Method Summary | |
---|---|
static Session |
getById(DbControl dc,
int id)
Get a Session item when you know the ID. |
Client |
getClient()
Get the client application the user was using in this session. |
boolean |
getImpersonated()
Check if another user was acting as the user of this session. |
String |
getLoginComment()
Get the login comment. |
Date |
getLoginTime()
Get the date and time the user logged in. |
Date |
getLogoutTime()
Get the date and time the user logged out. |
static ItemQuery<Session> |
getQuery(User user)
Get a query configured to retrieve sessions for the specified user. |
String |
getRemoteId()
Get the remote ID of the host the user used for this session. |
Item |
getType()
Get the type of item represented by the object. |
User |
getUser()
Get the user that logged in with this session. |
(package private) void |
initPermissions(int granted,
int denied)
READ permission is granted if the logged in user is the owner of this session. |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Item TYPE
Item.SESSION
,
getType()
Constructor Detail |
---|
Session(SessionData sessionData)
Method Detail |
---|
public static Session getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Session
item when you know the ID.
dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to load
Session
item
ItemNotFoundException
- If an item with the specified
ID is not found
PermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the item
BaseException
- If there is another errorpublic static ItemQuery<Session> getQuery(User user)
user
- The user to retreive sessions for, null is allowed if
the logged in user has generic READ permission for sessions in which case
all sessions will be returned
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.
void initPermissions(int granted, int denied) throws BaseException
initPermissions
in class BasicItem<SessionData>
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass
BaseException
- If the permissions couldn't be initialisedpublic User getUser() throws PermissionDeniedException, BaseException
User
item
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission
BaseException
- If there is another errorpublic Client getClient() throws PermissionDeniedException, BaseException
Client
item, or null if not known
PermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission
BaseException
- If there is another errorpublic Date getLoginTime()
Date
object with the login timepublic Date getLogoutTime()
Date
object with the logout timepublic String getLoginComment()
String
object with the login commentpublic boolean getImpersonated()
public String getRemoteId()
String
object with remote ID
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |