|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CurrentUserService
Service methods for performing operations on the currently logged-in user.
Field Summary | |
---|---|
static String |
MODE_ADD_ACCOUNT
|
static String |
MODE_LOGIN
|
static String |
MODE_REGISTRATION
|
Method Summary | |
---|---|
int |
addStopBookmark(String name,
List<String> stopIds,
RouteFilter filter)
Add a stop bookmark with the specified name, stop ids, and route filter. |
void |
clearDefaultLocation()
Clear the default search location for the current user |
void |
clearPhoneNumberRegistration()
Clear any pending phone number registration for the current user. |
boolean |
completePhoneNumberRegistration(String registrationCode)
Registers the specified phone number with the user by attaching a new UserIndex to the user with the phone number, or merging an existing user account with an existing UserIndex. |
void |
deleteCurrentUser()
Delete the current user. |
void |
deleteStopBookmarks(int id)
Delete the stop bookmark with the specified id. |
void |
enableAdminRole()
Enable admin role for the current user if there are no other admins in the system already. |
UserBean |
getAnonymousUser()
|
UserBean |
getCurrentUser()
|
UserBean |
getCurrentUser(boolean createUserIfAppropriate)
|
UserIndex |
getCurrentUserAsUserIndex()
|
IndexedUserDetails |
getCurrentUserDetails()
|
IndexedUserDetails |
handleAddAccount(String type,
String id,
String credentials,
boolean isAnonymous)
Handle the addition of a user index with the specified index type+id+credentials to the currently logged in user. |
IndexedUserDetails |
handleLogin(String type,
String id,
String credentials,
boolean isAnonymous,
boolean registerIfNewUser)
Handle login action for a user with the specified user index type+id+credentials. |
IndexedUserDetails |
handleRegistration(String type,
String id,
String credentials,
boolean isAnonymous)
Handle registration/user-creation action for a user with the specified user index type+id+credentials. |
IndexedUserDetails |
handleUserAction(String type,
String id,
String credentials,
boolean isAnonymous,
String mode)
A generic method that dispatches based on the "mode" parameter. |
boolean |
hasPhoneNumberRegistration()
See UserService.hasPhoneNumberRegistration(UserIndexKey) |
boolean |
isCurrentUserAdmin()
See StandardAuthoritiesService for definition of admin |
boolean |
isCurrentUserAnonymous()
See StandardAuthoritiesService for definition of anonymous |
void |
markServiceAlertAsRead(String situationId,
long time,
boolean isRead)
Mark the specified service alert as read or unread at the specified time for the current user. |
String |
registerPhoneNumber(String phoneNumber)
See UserService.registerPhoneNumber(User, String) |
void |
removeUserIndex(UserIndexKey key)
Remove the UserIndex with the specified key from the user. |
void |
resetCurrentUser()
Reset the properties to default values for the current user. |
void |
setDefaultLocation(String locationName,
double lat,
double lon)
Set the default search location for the current user |
void |
setLastSelectedStopIds(List<String> stopIds)
Set the last selected stop ids for the specified user |
void |
setRememberUserPreferencesEnabled(boolean rememberUserPreferencesEnabled)
|
void |
updateStopBookmark(int id,
String name,
List<String> stopIds,
RouteFilter routeFilter)
Updated a stop bookmark with the specified id with the specified name, stop ids, and route filter. |
Field Detail |
---|
static final String MODE_LOGIN
static final String MODE_REGISTRATION
static final String MODE_ADD_ACCOUNT
Method Detail |
---|
IndexedUserDetails getCurrentUserDetails()
UserBean getCurrentUser()
UserBean getCurrentUser(boolean createUserIfAppropriate)
UserIndex getCurrentUserAsUserIndex()
UserBean getAnonymousUser()
boolean isCurrentUserAnonymous()
StandardAuthoritiesService
for definition of anonymous
boolean isCurrentUserAdmin()
StandardAuthoritiesService
for definition of admin
IndexedUserDetails handleUserAction(String type, String id, String credentials, boolean isAnonymous, String mode)
MODE_LOGIN
, then we pass off to
handleLogin(String, String, String, boolean, boolean)
with
registerIfNewUser set to true. If mode is MODE_REGISTRATION
, then
we pass off to handleRegistration(String, String, String, boolean)
. Finally, if mode is MODE_ADD_ACCOUNT
, we pass off to
handleAddAccount(String, String, String, boolean)
.
type
- the UserIndexKey
typeid
- the UserIndexKey
idcredentials
- UserIndex
credentialsisAnonymous
- see StandardAuthoritiesService
for definition of
anonymousmode
- one of MODE_LOGIN
, MODE_REGISTRATION
, or
MODE_ADD_ACCOUNT
IndexedUserDetails handleLogin(String type, String id, String credentials, boolean isAnonymous, boolean registerIfNewUser)
type
- the UserIndexKey
typeid
- the UserIndexKey
idcredentials
- UserIndex
credentialsisAnonymous
- see StandardAuthoritiesService
for definition of
anonymousregisterIfNewUser
- if true, automatically register a new user if one
does not exist already
IndexedUserDetails handleRegistration(String type, String id, String credentials, boolean isAnonymous)
type
- the UserIndexKey
typeid
- the UserIndexKey
idcredentials
- UserIndex
credentialsisAnonymous
- see StandardAuthoritiesService
for definition of
anonymous
IndexedUserDetails handleAddAccount(String type, String id, String credentials, boolean isAnonymous)
type
- the UserIndexKey
typeid
- the UserIndexKey
idcredentials
- UserIndex
credentialsisAnonymous
- see StandardAuthoritiesService
for definition of
anonymous
void setRememberUserPreferencesEnabled(boolean rememberUserPreferencesEnabled)
rememberUserPreferencesEnabled
- true if preferences should be
remembered for the current uservoid setDefaultLocation(String locationName, double lat, double lon)
locationName
- lat
- lon
- void clearDefaultLocation()
void setLastSelectedStopIds(List<String> stopIds)
stopIds
- int addStopBookmark(String name, List<String> stopIds, RouteFilter filter)
UserBean.getBookmarks()
.
name
- stopIds
- filter
-
void updateStopBookmark(int id, String name, List<String> stopIds, RouteFilter routeFilter)
UserBean.getBookmarks()
.
id
- name
- stopIds
- routeFilter
- void deleteStopBookmarks(int id)
UserBean.getBookmarks()
.
id
- String registerPhoneNumber(String phoneNumber)
UserService.registerPhoneNumber(User, String)
phoneNumber
- the phone number to register to the current user
completePhoneNumberRegistration(String)
.boolean hasPhoneNumberRegistration()
UserService.hasPhoneNumberRegistration(UserIndexKey)
boolean completePhoneNumberRegistration(String registrationCode)
UserService.completePhoneNumberRegistration(UserIndex, String)
registrationCode
-
void clearPhoneNumberRegistration()
UserService.clearPhoneNumberRegistration(UserIndexKey)
void markServiceAlertAsRead(String situationId, long time, boolean isRead)
situationId
- the service alert situation idtime
- the time the service alert was read or marked unreadisRead
- whether the service alert should be marked read or unreadvoid removeUserIndex(UserIndexKey key)
UserIndex
with the specified key from the user. See
UserService.removeUserIndexForUser(User, UserIndexKey)
key
- void deleteCurrentUser()
UserService.deleteUser(User)
void resetCurrentUser()
UserService.resetUser(User)
.
void enableAdminRole()
UserService.enableAdminRoleForUser(User, boolean)
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |