Examples of UserIndex


Examples of org.onebusaway.users.model.UserIndex

    _userLastAccessTimeService.handleAccessForUser(user.getId(), System.currentTimeMillis());
  }

  @Override
  public void resetUserForIndexKey(UserIndexKey key) {
    UserIndex index = _userService.getUserIndexForId(key);
    if( index != null)
      _userService.resetUser(index.getUser());
  }
View Full Code Here

Examples of org.onebusaway.users.model.UserIndex

      return null;
    phoneNumber = PhoneNumberLibrary.normalizePhoneNumber(phoneNumber);

    UserIndexKey key = new UserIndexKey(UserIndexTypes.PHONE_NUMBER,
        phoneNumber);
    UserIndex existingUserIndex = _userService.getOrCreateUserForIndexKey(key,
        "", false);
    User existingUser = existingUserIndex.getUser();

    String id = key.getType() + "|" + key.getValue();
    UserIndexKey studyKey = new UserIndexKey("tccStudyId", id);

    return _userService.addUserIndexToUser(existingUser, studyKey,
View Full Code Here

Examples of org.onebusaway.users.model.UserIndex

  @Validations(requiredStrings = {@RequiredStringValidator(fieldName = "model.apiKey", message = "Hey!")})
  public String edit() {
    UserIndexKey key = new UserIndexKey(UserIndexTypes.API_KEY,
        _model.getApiKey());
    UserIndex userIndex = _userService.getUserIndexForId(key);
    if (userIndex == null)
      return INPUT;
    UserBean bean = _userService.getUserAsBean(userIndex.getUser());
    _model.setMinApiRequestInterval(bean.getMinApiRequestInterval());

    _apiKeys = _userService.getUserIndexKeyValuesForKeyType(UserIndexTypes.API_KEY);

    return SUCCESS;
View Full Code Here

Examples of org.onebusaway.users.model.UserIndex

  @Validations(requiredStrings = {@RequiredStringValidator(fieldName = "model.apiKey", message = "Hey!")})
  public String delete() {

    UserIndexKey key = new UserIndexKey(UserIndexTypes.API_KEY,
        _model.getApiKey());
    UserIndex userIndex = _userService.getUserIndexForId(key);
    if (userIndex == null)
      return INPUT;

    User user = userIndex.getUser();

    _userService.removeUserIndexForUser(user, key);

    if (user.getUserIndices().isEmpty())
      _userService.deleteUser(user);
View Full Code Here

Examples of org.onebusaway.users.model.UserIndex

   ****/

  private void saveOrUpdateKey(String apiKey, Long minApiRequestInterval) {

    UserIndexKey key = new UserIndexKey(UserIndexTypes.API_KEY, apiKey);
    UserIndex userIndex = _userService.getOrCreateUserForIndexKey(key, "", true);

    _userPropertiesService.authorizeApi(userIndex.getUser(),
        minApiRequestInterval);

    // Clear the cached value here
    _userService.getMinApiRequestIntervalForKey(apiKey, true);
  }
View Full Code Here

Examples of org.onebusaway.users.model.UserIndex

    }
    UserIndexKey key = new UserIndexKey(UserIndexTypes.API_KEY, _apiKey);
   
    _userService.getUserIndexForId(key);
   
    UserIndex userIndex = _userService.getOrCreateUserForIndexKey(key, _apiKey,
        false);
    _propertiesService.authorizeApi(userIndex.getUser(), _interval);


    return SUCCESS;
  }
View Full Code Here

Examples of org.onebusaway.users.model.UserIndex

    if (!_password.equals(_password2))
      return INPUT;

    String credentials = _passwordEncoder.encodePassword(_password, _userName);
    UserIndexKey key = new UserIndexKey(UserIndexTypes.USERNAME, _userName);
    UserIndex userIndex = _userService.getOrCreateUserForIndexKey(key,
        credentials, false);

    if (userIndex == null)
      return null;

    _userId = userIndex.getUser().getId();

    return "userCreated";
  }
View Full Code Here

Examples of org.onebusaway.users.model.UserIndex

  @Override
  public String execute() {

    UserIndexKey key = new UserIndexKey(_type, _id);
    UserIndex userIndex = _userService.getUserIndexForId(key);
    if (userIndex == null)
      return INPUT;

    _user = _userService.getUserAsBean(userIndex.getUser());

    return SUCCESS;
  }
View Full Code Here

Examples of org.onebusaway.users.model.UserIndex

  }

  public String changePasswordSubmit() {

    UserIndexKey key = new UserIndexKey(_type, _id);
    UserIndex userIndex = _userService.getUserIndexForId(key);
    if (userIndex == null)
      return INPUT;

    if (!ObjectUtils.equals(_password, _password2))
      return INPUT;
View Full Code Here

Examples of org.onebusaway.users.model.UserIndex

    User user = _userService.getUserForId(_userId);

    if (user == null)
      return INPUT;

    UserIndex currentUserIndex = _currentUserService.getCurrentUserAsUserIndex();
    if( currentUserIndex != null) {
      User currentUser = currentUserIndex.getUser();
      if( currentUser.equals(user))
        return ERROR;
    }
    _userService.deleteUser(user);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.