Search in sources :

Example 16 with User

use of org.onebusaway.users.model.User in project onebusaway-application-modules by camsys.

the class CurrentUserServiceImpl method updateStopBookmark.

@Override
public void updateStopBookmark(int id, String name, List<String> stopIds, RouteFilter routeFilter) {
    User user = _currentUserStrategy.getCurrentUser(false);
    if (user == null)
        return;
    _userPropertiesService.updateStopBookmark(user, id, name, stopIds, routeFilter);
}
Also used : User(org.onebusaway.users.model.User)

Example 17 with User

use of org.onebusaway.users.model.User in project onebusaway-application-modules by camsys.

the class CurrentUserServiceImpl method resetCurrentUser.

public void resetCurrentUser() {
    User user = _currentUserStrategy.getCurrentUser(false);
    if (user == null)
        return;
    _userService.resetUser(user);
    _currentUserStrategy.clearCurrentUser();
}
Also used : User(org.onebusaway.users.model.User)

Example 18 with User

use of org.onebusaway.users.model.User in project onebusaway-application-modules by camsys.

the class CurrentUserServiceImpl method handleAddAccount.

@Override
public IndexedUserDetails handleAddAccount(String type, String id, String credentials, boolean isAnonymous) {
    User currentUser = _currentUserStrategy.getCurrentUser(false);
    UserIndexKey key = new UserIndexKey(type, id);
    UserIndex index = _userService.getUserIndexForId(key);
    boolean exists = index != null;
    // New user?
    if (exists) {
        if (currentUser != null) {
            User existingUser = index.getUser();
            _userService.mergeUsers(existingUser, currentUser);
        }
    } else {
        if (currentUser != null)
            index = _userService.addUserIndexToUser(currentUser, key, credentials);
        else
            index = _userService.getOrCreateUserForIndexKey(key, credentials, isAnonymous);
    }
    return new IndexedUserDetailsImpl(_authoritiesService, index);
}
Also used : UserIndex(org.onebusaway.users.model.UserIndex) UserIndexKey(org.onebusaway.users.model.UserIndexKey) User(org.onebusaway.users.model.User)

Example 19 with User

use of org.onebusaway.users.model.User in project onebusaway-application-modules by camsys.

the class CurrentUserServiceImpl method clearDefaultLocation.

@Override
public void clearDefaultLocation() {
    User user = _currentUserStrategy.getCurrentUser(false);
    if (user == null)
        return;
    _userPropertiesService.clearDefaultLocation(user);
}
Also used : User(org.onebusaway.users.model.User)

Example 20 with User

use of org.onebusaway.users.model.User in project onebusaway-application-modules by camsys.

the class CurrentUserServiceImpl method setRememberUserPreferencesEnabled.

@Override
public void setRememberUserPreferencesEnabled(boolean rememberPreferencesEnabled) {
    User user = _currentUserStrategy.getCurrentUser(true);
    if (user == null)
        return;
    _userPropertiesService.setRememberUserPreferencesEnabled(user, rememberPreferencesEnabled);
}
Also used : User(org.onebusaway.users.model.User)

Aggregations

User (org.onebusaway.users.model.User)56 UserIndex (org.onebusaway.users.model.UserIndex)23 UserIndexKey (org.onebusaway.users.model.UserIndexKey)16 Test (org.junit.Test)13 Date (java.util.Date)9 UserBean (org.onebusaway.users.client.model.UserBean)8 UserPropertiesV1 (org.onebusaway.users.model.UserPropertiesV1)7 ArrayList (java.util.ArrayList)5 IOException (java.io.IOException)4 SQLException (java.sql.SQLException)4 List (java.util.List)4 WebApplicationException (javax.ws.rs.WebApplicationException)4 JsonGenerationException (org.codehaus.jackson.JsonGenerationException)4 JsonMappingException (org.codehaus.jackson.map.JsonMappingException)4 Criteria (org.hibernate.Criteria)4 HibernateException (org.hibernate.HibernateException)4 Session (org.hibernate.Session)4 UserDetail (org.onebusaway.admin.model.ui.UserDetail)4 RouteFilter (org.onebusaway.users.model.properties.RouteFilter)4 UserRole (org.onebusaway.users.model.UserRole)3