Package org.onebusaway.users.model

Examples of org.onebusaway.users.model.User


    int maxVersion = 0;
    if (args != null) {
      for (Object arg : args) {
        if (arg instanceof User) {
          User user = (User) arg;
          int version = getPropertiesVersion(user);
          maxVersion = Math.max(maxVersion, version);
        } else if (arg instanceof UserIndex) {
          UserIndex userIndex = (UserIndex) arg;
          int version = getPropertiesVersion(userIndex.getUser());
View Full Code Here


      try {
        List<Integer> userIds = _dao.getAllUserIdsInRange(_offset, FETCH_LIMIT);

        for (int userId : userIds) {
          User user = _dao.getUserForId(userId);
          _log.info("processing user: id=" + user.getId());
          if (_propertiesMigration.needsMigration(user.getProperties(), _target)) {
            _log.info("migrating user: id=" + user.getId());
            UserProperties properties = _propertiesMigration.migrate(
                user.getProperties(), _target);
            user.setProperties(properties);
            _dao.saveOrUpdateUser(user);
            usersConverted++;
          }
          usersProcessed++;
        }
View Full Code Here

   
    UserIndexKey key = details.getUserIndexKey();
    UserIndex userIndex = _userService.getUserIndexForId(key);
    if (userIndex == null)
      return null;
    User user = userIndex.getUser();
    for (UserIndex index : user.getUserIndices()) {
      UserIndexKey id = index.getId();
      if (id.getType().equals("tccStudyId")) {
        Map<String, Object> entry = new HashMap<String, Object>();
        entry.put("tccStudyId", id.getValue());
        entry.put("credentials", index.getCredentials());
View Full Code Here

      if (!registerIfNewUser)
        return null;

      index = _userService.getOrCreateUserForIndexKey(key, credentials, false);
      User newUser = index.getUser();

      User oldUser = _currentUserStrategy.getCurrentUser(false);
      if (oldUser != null && _userService.isAnonymous(oldUser))
        _userService.mergeUsers(oldUser, newUser);
    }

    return new IndexedUserDetailsImpl(_authoritiesService, index);
View Full Code Here

    UserIndexKey key = new UserIndexKey(type, id);
    UserIndex index = _userService.getOrCreateUserForIndexKey(key, credentials,
        isAnonymous);

    User oldUser = _currentUserStrategy.getCurrentUser(false);
    if (oldUser != null && _userService.isAnonymous(oldUser))
      _userService.mergeUsers(oldUser, index.getUser());

    return new IndexedUserDetailsImpl(_authoritiesService, index);
  }
View Full Code Here

  @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);
View Full Code Here

  }

  @Override
  public void setDefaultLocation(String locationName, double lat, double lon) {

    User user = _currentUserStrategy.getCurrentUser(true);
    if (user == null)
      return;
    _userPropertiesService.setDefaultLocation(user, locationName, lat, lon);
  }
View Full Code Here

    _userPropertiesService.setDefaultLocation(user, locationName, lat, lon);
  }

  @Override
  public void clearDefaultLocation() {
    User user = _currentUserStrategy.getCurrentUser(false);
    if (user == null)
      return;
    _userPropertiesService.clearDefaultLocation(user);
  }
View Full Code Here

  }

  @Override
  public int addStopBookmark(String name, List<String> stopIds,
      RouteFilter filter) {
    User user = _currentUserStrategy.getCurrentUser(true);
    if (user == null)
      return -1;
    return _userPropertiesService.addStopBookmark(user, name, stopIds, filter);
  }
View Full Code Here

  @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);
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.users.model.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.