public class UserSessions extends Object
Constructor and Description |
---|
UserSessions() |
Modifier and Type | Method and Description |
---|---|
static String |
createNewSessionForUser(String userId)
Creates a new session id for the specified user
stores and returns it
|
static String |
createSessionForUser(String userId,
String sessionId)
Uses the session id passed in the parameter and sets it as the session id for the
user as long as it meets a specified criteria (currently must be at least 5 xters long)
|
static AccountTransfer |
getUserAccount(String requestingUser,
String token)
Retrieves the account object associated with the session identifier.
|
static String |
getUserIdBySession(String sessionId) |
static void |
invalidateSession(String userId)
Invalidates the session id for the specified user
by removing the stored session id
|
protected static void |
putSession(String userId,
String sessionId) |
public static String createNewSessionForUser(String userId)
userId
- unique user identifierpublic static String createSessionForUser(String userId, String sessionId)
userId
- unique user identifiersessionId
- optional session id to set for that userpublic static void invalidateSession(String userId)
userId
- unique user idpublic static AccountTransfer getUserAccount(String requestingUser, String token)
requestingUser
- unique identifier for user making requesttoken
- unique session identifierPermissionException
- if the user Id associated with the session token is not the same as the requesting
user but the requesting user's account does not have administrative privilegesCopyright © 2017. All rights reserved.