|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.onebusaway.users.impl.CurrentUserServiceImpl
@Component public class CurrentUserServiceImpl
Field Summary |
---|
Fields inherited from interface org.onebusaway.users.services.CurrentUserService |
---|
MODE_ADD_ACCOUNT, MODE_LOGIN, MODE_REGISTRATION |
Constructor Summary | |
---|---|
CurrentUserServiceImpl()
|
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 index)
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()
CurrentUserService Interface |
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 |
setAuthoritiesService(StandardAuthoritiesService authoritiesService)
|
void |
setCurrentUserStrategy(CurrentUserStrategy currentUserStrategy)
|
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 rememberPreferencesEnabled)
|
void |
setUserPropertiesService(UserPropertiesService userPropertiesService)
|
void |
setUserService(UserService service)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CurrentUserServiceImpl()
Method Detail |
---|
public void setUserService(UserService service)
public void setUserPropertiesService(UserPropertiesService userPropertiesService)
public void setAuthoritiesService(StandardAuthoritiesService authoritiesService)
public void setCurrentUserStrategy(CurrentUserStrategy currentUserStrategy)
public boolean isCurrentUserAnonymous()
CurrentUserService
Interface
isCurrentUserAnonymous
in interface CurrentUserService
public boolean isCurrentUserAdmin()
CurrentUserService
StandardAuthoritiesService
for definition of admin
isCurrentUserAdmin
in interface CurrentUserService
public IndexedUserDetails getCurrentUserDetails()
getCurrentUserDetails
in interface CurrentUserService
public UserBean getCurrentUser()
getCurrentUser
in interface CurrentUserService
public UserBean getCurrentUser(boolean createUserIfAppropriate)
getCurrentUser
in interface CurrentUserService
public UserIndex getCurrentUserAsUserIndex()
getCurrentUserAsUserIndex
in interface CurrentUserService
public UserBean getAnonymousUser()
getAnonymousUser
in interface CurrentUserService
public IndexedUserDetails handleUserAction(String type, String id, String credentials, boolean isAnonymous, String mode)
CurrentUserService
CurrentUserService.MODE_LOGIN
, then we pass off to
CurrentUserService.handleLogin(String, String, String, boolean, boolean)
with
registerIfNewUser set to true. If mode is CurrentUserService.MODE_REGISTRATION
, then
we pass off to CurrentUserService.handleRegistration(String, String, String, boolean)
. Finally, if mode is CurrentUserService.MODE_ADD_ACCOUNT
, we pass off to
CurrentUserService.handleAddAccount(String, String, String, boolean)
.
handleUserAction
in interface CurrentUserService
type
- the UserIndexKey
typeid
- the UserIndexKey
idcredentials
- UserIndex
credentialsisAnonymous
- see StandardAuthoritiesService
for definition of
anonymousmode
- one of CurrentUserService.MODE_LOGIN
, CurrentUserService.MODE_REGISTRATION
, or
CurrentUserService.MODE_ADD_ACCOUNT
public IndexedUserDetails handleLogin(String type, String id, String credentials, boolean isAnonymous, boolean registerIfNewUser)
CurrentUserService
handleLogin
in interface CurrentUserService
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
public IndexedUserDetails handleRegistration(String type, String id, String credentials, boolean isAnonymous)
CurrentUserService
handleRegistration
in interface CurrentUserService
type
- the UserIndexKey
typeid
- the UserIndexKey
idcredentials
- UserIndex
credentialsisAnonymous
- see StandardAuthoritiesService
for definition of
anonymous
public IndexedUserDetails handleAddAccount(String type, String id, String credentials, boolean isAnonymous)
CurrentUserService
handleAddAccount
in interface CurrentUserService
type
- the UserIndexKey
typeid
- the UserIndexKey
idcredentials
- UserIndex
credentialsisAnonymous
- see StandardAuthoritiesService
for definition of
anonymous
public void setDefaultLocation(String locationName, double lat, double lon)
CurrentUserService
setDefaultLocation
in interface CurrentUserService
public void clearDefaultLocation()
CurrentUserService
clearDefaultLocation
in interface CurrentUserService
public int addStopBookmark(String name, List<String> stopIds, RouteFilter filter)
CurrentUserService
UserBean.getBookmarks()
.
addStopBookmark
in interface CurrentUserService
public void updateStopBookmark(int id, String name, List<String> stopIds, RouteFilter routeFilter)
CurrentUserService
UserBean.getBookmarks()
.
updateStopBookmark
in interface CurrentUserService
public void deleteStopBookmarks(int index)
CurrentUserService
UserBean.getBookmarks()
.
deleteStopBookmarks
in interface CurrentUserService
public void setLastSelectedStopIds(List<String> stopIds)
CurrentUserService
setLastSelectedStopIds
in interface CurrentUserService
public void setRememberUserPreferencesEnabled(boolean rememberPreferencesEnabled)
setRememberUserPreferencesEnabled
in interface CurrentUserService
rememberPreferencesEnabled
- true if preferences should be
remembered for the current userpublic String registerPhoneNumber(String phoneNumber)
CurrentUserService
UserService.registerPhoneNumber(User, String)
registerPhoneNumber
in interface CurrentUserService
phoneNumber
- the phone number to register to the current user
CurrentUserService.completePhoneNumberRegistration(String)
.public boolean hasPhoneNumberRegistration()
CurrentUserService
UserService.hasPhoneNumberRegistration(UserIndexKey)
hasPhoneNumberRegistration
in interface CurrentUserService
public boolean completePhoneNumberRegistration(String registrationCode)
CurrentUserService
UserService.completePhoneNumberRegistration(UserIndex, String)
completePhoneNumberRegistration
in interface CurrentUserService
public void clearPhoneNumberRegistration()
CurrentUserService
UserService.clearPhoneNumberRegistration(UserIndexKey)
clearPhoneNumberRegistration
in interface CurrentUserService
public void markServiceAlertAsRead(String situationId, long time, boolean isRead)
CurrentUserService
markServiceAlertAsRead
in interface CurrentUserService
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 unreadpublic void enableAdminRole()
CurrentUserService
UserService.enableAdminRoleForUser(User, boolean)
.
enableAdminRole
in interface CurrentUserService
public void removeUserIndex(UserIndexKey key)
CurrentUserService
UserIndex
with the specified key from the user. See
UserService.removeUserIndexForUser(User, UserIndexKey)
removeUserIndex
in interface CurrentUserService
public void deleteCurrentUser()
CurrentUserService
UserService.deleteUser(User)
deleteCurrentUser
in interface CurrentUserService
public void resetCurrentUser()
CurrentUserService
UserService.resetUser(User)
.
resetCurrentUser
in interface CurrentUserService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |