Package com.ikanow.infinit.e.data_model.store.social.cookies

Examples of com.ikanow.infinit.e.data_model.store.social.cookies.CookiePojo.toDb()


        cp.set_id(profileId);
        cp.setCookieId(cp.get_id());
        cp.setApiKey(wpa.getApiKey());
        cp.setStartDate(ap.getCreated());
        cp.setProfileId(profileId);
        DbManager.getSocial().getCookies().save(cp.toDb());
      }//TOTEST
    }
    catch (Exception ex )
    {
      logger.error("Exception Message: " + ex.getMessage(), ex);
View Full Code Here


        // Delete existing API key
        // (We'll allow a user to update their own API key - just not create it, see below)
        CookiePojo removeMe = new CookiePojo();
        removeMe.setApiKey(ap.getApiKey());
        ap.setApiKey(null);       
        DbManager.getSocial().getCookies().remove(removeMe.toDb());
      }
      else if (null != wpa.getApiKey()) {
        // Change or create API key
        // Only admins can do this:
        if (null != personIdStr) { // (this is != null iff user isn't admin)
View Full Code Here

        cp.set_id(ap.getProfileId());
        cp.setCookieId(cp.get_id());
        cp.setApiKey(wpa.getApiKey());
        cp.setStartDate(ap.getCreated());
        cp.setProfileId(ap.getProfileId());
        DbManager.getSocial().getCookies().save(cp.toDb());               
      }//TESTED
      //else if api key is null then leave alone, assume hasn't changed
     
      //update old entries
      DbManager.getSocial().getPerson().update(new BasicDBObject("_id", pp.get_id()), pp.toDb());
View Full Code Here

   
    // Delete any cookies the user might have
    CookiePojo cookieQuery = new CookiePojo();
    if (null != pp.get_id()) {
      cookieQuery.setProfileId(pp.get_id());
      DbManager.getSocial().getCookies().remove(cookieQuery.toDb());
    }
    //TOTEST
   
    rp.setResponse(new ResponseObject("WP Delete User",true,"User Deleted Successfully"));
    return rp;
View Full Code Here

      cp.set_id(new ObjectId());
      cp.setCookieId(cp.get_id());
      cp.setLastActivity(new Date());
      cp.setProfileId(userid);
      cp.setStartDate(new Date());
      cookieColl.insert(cp.toDb());
      //return cookieid
      return cp.getCookieId();
    }
    catch (Exception e )
    {
View Full Code Here

        cookieQuery.setApiKey(cookieIdStr.substring(4));
      }
      else {
        cookieQuery.set_id(new ObjectId(cookieIdStr));
      }
      BasicDBObject cookieQueryDbo = (BasicDBObject) cookieQuery.toDb();
      DBObject dbo = DbManager.getSocial().getCookies().findOne(cookieQueryDbo);
      ObjectId userid = null;
      if ( dbo != null )
      {
        CookiePojo cp = CookiePojo.fromDb(dbo, CookiePojo.class);
View Full Code Here

          long nTimeout_ms = (null == timeout_s)? COOKIE_TIMEOUT : 1000L*timeout_s;
          if ( (new Date().getTime() - cp.getLastActivity().getTime()) < nTimeout_ms)
          {
            //less than 15min, update activity time
            cp.setLastActivity(new Date());
            DbManager.getSocial().getCookies().update(cookieQueryDbo, cp.toDb());
            userid = cp.getProfileId();
          }
          else
          {
            //to late, drop cookie
View Full Code Here

            cp.set_id(authuser.getProfileId());
            cp.setCookieId(cp.get_id());
            cp.setApiKey(authuser.getApiKey());
            cp.setStartDate(authuser.getCreated());
            cp.setProfileId(authuser.getProfileId());
            DbManager.getSocial().getCookies().save(cp.toDb());            
          }//TESTED

          if ((authuser.getAccountType() == null) ||
              !(authuser.getAccountType().equalsIgnoreCase("admin") || authuser.getAccountType().equalsIgnoreCase("admin-enabled")))
          {
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.