Package com.baasbox.dao

Examples of com.baasbox.dao.UserDao


  public static long getCountFriendsOf(String username, QueryParams criteria) throws InvalidCriteriaException, SqlInjectionException {
    String friendShipRole=RoleDao.getFriendRoleName(username);
    criteria.where(getWhereFromCriteria(criteria));
    criteria.params(addFriendShipRoleToCriteria(criteria, friendShipRole));
    UserDao udao= UserDao.getInstance();
    return udao.getCount(criteria);
  }
View Full Code Here


    if (Logger.isDebugEnabled()) Logger.debug("UserInfo received: " + result.toString());
    result.setFrom(socialNetwork);
    result.setToken(t.getToken());
    //Setting token as secret for one-token only social networks
    result.setSecret(t.getSecret()!=null && StringUtils.isNotEmpty(t.getSecret())?t.getSecret():t.getToken());
    UserDao userDao = UserDao.getInstance();
    ODocument existingUser =  null;
    try{
      existingUser = userDao.getBySocialUserId(result);
    }catch(SqlInjectionException sie){
      return internalServerError(sie.getMessage());
    }

    if(existingUser!=null){
View Full Code Here

    Logger.info ("DB now is on " + version + " level");
  }
 
  private void changePushTokenFieldName(ODatabaseRecordTx db)  {
    Logger.info("..changing 'deviceId' to 'pushToken' field name..:");
    UserDao dao = UserDao.getInstance();
    QueryParams criteria = QueryParams.getInstance();
    try {
      List<ODocument> users = UserService.getUsers(criteria);
      for (ODocument user:users){
        ODocument userSystemProperties = user.field(UserDao.ATTRIBUTES_SYSTEM);
View Full Code Here

    Logger.info("...done...");
  }
   
  private void addProfileSections(ODatabaseRecordTx db) {
    Logger.info("...adding missing profile section..:");
    UserDao dao = UserDao.getInstance();
    QueryParams criteria = QueryParams.getInstance();
    try {
      List<ODocument> users = UserService.getUsers(criteria);
      Logger.info(" found " + users.size() + " users");
      for (ODocument user:users){
View Full Code Here

    List<String> iosToken = new ArrayList<String>();
    List<String> androidToken = new ArrayList<String>();
    com.baasbox.db.DbHelper.reconnectAsAdmin();
    for(String username : usernames) {
      if (Logger.isDebugEnabled()) Logger.debug("Try to send a message (" + message + ") to " + username);
      UserDao udao = UserDao.getInstance();
      ODocument user = udao.getByUserName(username);
      if (user==null) {
        if (Logger.isDebugEnabled()) Logger.debug("User " + username + " does not exist");
        throw new UserNotFoundException("User " + username + " does not exist");
      }
      ODocument userSystemProperties=user.field(UserDao.ATTRIBUTES_SYSTEM);
View Full Code Here

*/
public class StatisticsService {

    public static ImmutableMap data() throws SqlInjectionException, InvalidCollectionException{
      if (Logger.isTraceEnabled()) Logger.trace("Method Start");
      UserDao userDao = UserDao.getInstance();
      CollectionDao collDao = CollectionDao.getInstance();
      AssetDao assetDao = AssetDao.getInstance();
      FileDao fileDao = FileDao.getInstance();
      ODatabaseRecordTx db = DbHelper.getConnection();
     
      long usersCount =userDao.getCount();
      long assetsCount = assetDao.getCount();
      long collectionsCount = collDao.getCount();
      long filesCount = fileDao.getCount();
     
      List<ODocument> collections = collDao.get(QueryParams.getInstance());
View Full Code Here

TOP

Related Classes of com.baasbox.dao.UserDao

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.