Examples of DailyCounts


Examples of nz.org.winters.appspot.acrareporter.store.DailyCounts

        mTotalsMonthGraphData.removeRows(0, mTotalsMonthGraphData.getNumberOfRows());

        mTotalsMonthGraphData.addRows(result.size());
        for (int i = 0; i < result.size(); i++)
        {
          DailyCounts data = result.get(i);
          mTotalsMonthGraphData.setValue(i, 0, data.date);
          mTotalsMonthGraphData.setValue(i, 1, data.Reports);
          mTotalsMonthGraphData.setValue(i, 2, data.Fixed);
          mTotalsMonthGraphData.setValue(i, 3, data.NewReports());
        }
        mShortDateFormat.format(mTotalsMonthGraphData, 0);

        mTotalsMonthGraph.draw(mTotalsMonthGraphData, createTotalsMonthOptions());
View Full Code Here

Examples of nz.org.winters.appspot.acrareporter.store.DailyCounts

        if (result.size() > 0)
        {
          mPackageMonthGraphData.addRows(result.size());
          for (int i = 0; i < result.size(); i++)
          {
            DailyCounts data = result.get(i);
            mPackageMonthGraphData.setValue(i, 0, data.date);
            mPackageMonthGraphData.setValue(i, 1, data.Reports);
            mPackageMonthGraphData.setValue(i, 2, data.LookedAt);
            mPackageMonthGraphData.setValue(i, 3, data.NotFixedReports());
            mPackageMonthGraphData.setValue(i, 4, data.Fixed);
            mPackageMonthGraphData.setValue(i, 5, data.NewReports());
          }
          mShortDateFormat.format(mPackageMonthGraphData, 0);

        }
        mPackageMonthGraph.draw(mPackageMonthGraphData, createPackageMonthOptions(getAppName(packageName)));
View Full Code Here

Examples of nz.org.winters.appspot.acrareporter.store.DailyCounts

  public static DailyCounts getDate(Long owner, Date datein)
  {
    datein = removeTimeFromDate(datein);

    DailyCounts counts = ObjectifyService.ofy().load().type(DailyCounts.class).filter("Owner", owner).filter("date", datein).first().now();
    if (counts == null)
    {
      counts = new DailyCounts();
      counts.Owner = owner;
      counts.date = datein;
    }
    return counts;
  }
View Full Code Here

Examples of nz.org.winters.appspot.acrareporter.store.DailyCounts

  public static DailyCounts getDate(String package_name, Date datein)
  {

    datein = removeTimeFromDate(datein);

    DailyCounts counts = ObjectifyService.ofy().load().type(DailyCounts.class).filter("PACKAGE_NAME", package_name).filter("date", datein).first().now();
    if (counts == null)
    {
      counts = new DailyCounts();
      counts.PACKAGE_NAME = package_name;
      counts.date = datein;
    }
    return counts;
  }
View Full Code Here

Examples of nz.org.winters.appspot.acrareporter.store.DailyCounts

    ObjectifyService.ofy().delete().entity(bei);

    AppUser user = getAppUser(bei.Owner);
    AppPackage ap = getAppPackage(bei.PACKAGE_NAME);

    DailyCounts counts = DailyCountsGetters.getDate(getOwnerId(user), bei.Timestamp);

    counts.incDeleted();
    ap.Totals.incDeleted();
    user.Totals.incDeleted();

    if(bei.lookedAt)
    {
View Full Code Here

Examples of nz.org.winters.appspot.acrareporter.store.DailyCounts

      {
        bei.lookedAt = state;

        AppUser user = getAppUser(bei.Owner);
        AppPackage ap = getAppPackage(bei.PACKAGE_NAME);
        DailyCounts userCounts = DailyCountsGetters.getDate(getOwnerId(user), bei.Timestamp);
        DailyCounts packageCounts = DailyCountsGetters.getDate(bei.PACKAGE_NAME, bei.Timestamp);
        if (state)
        {
          ap.Totals.incLookedAt();
          user.Totals.incLookedAt();
          userCounts.incLookedAt();
          packageCounts.incLookedAt();
        } else
        {
          ap.Totals.decLookedAt();
          user.Totals.decLookedAt();
          userCounts.decLookedAt();
          packageCounts.decLookedAt();
        }
        ObjectifyService.ofy().save().entity(bei);
        ObjectifyService.ofy().save().entity(ap);
        ObjectifyService.ofy().save().entity(user);
        ObjectifyService.ofy().save().entity(userCounts);
View Full Code Here

Examples of nz.org.winters.appspot.acrareporter.store.DailyCounts

      if (bei.fixed != state)
      {
        bei.fixed = state;
        AppUser user = getAppUser(bei.Owner);
        AppPackage ap = getAppPackage(bei.PACKAGE_NAME);
        DailyCounts userCounts = DailyCountsGetters.getDate(getOwnerId(user), bei.Timestamp);
        DailyCounts packageCounts = DailyCountsGetters.getDate(bei.PACKAGE_NAME, bei.Timestamp);
        if (state)
        {
          ap.Totals.incFixed();
          user.Totals.incFixed();
          userCounts.incFixed();
          packageCounts.incFixed();
        } else
        {
          ap.Totals.decFixed();
          user.Totals.decFixed();
          userCounts.decFixed();
          packageCounts.decFixed();

        }

        if (state && !bei.lookedAt)
        {
          bei.lookedAt = true;
          ap.Totals.incLookedAt();
          user.Totals.incLookedAt();
          userCounts.incLookedAt();
          packageCounts.incLookedAt();
        }

        ObjectifyService.ofy().save().entity(bei);
        ObjectifyService.ofy().save().entity(ap);
        ObjectifyService.ofy().save().entity(user);
View Full Code Here

Examples of nz.org.winters.appspot.acrareporter.store.DailyCounts

      BasicErrorInfo beo = ObjectifyService.ofy().load().type(BasicErrorInfo.class).filter("REPORT_ID", report_id).first().now();
      ACRALog acra = ObjectifyService.ofy().load().type(ACRALog.class).filter("REPORT_ID", report_id).first().now();
      owner = beo.Owner;
      packageName = beo.PACKAGE_NAME;

      DailyCounts userCounts = DailyCountsGetters.getDate(owner, beo.Timestamp);
      DailyCounts packageCounts = DailyCountsGetters.getDate(beo.PACKAGE_NAME, beo.Timestamp);

      userCounts.incDeleted();
      packageCounts.incDeleted();

      if(beo.lookedAt)
      {
        lookedAt++;
      }
View Full Code Here

Examples of nz.org.winters.appspot.acrareporter.store.DailyCounts

     
      ACRALog acra = ObjectifyService.ofy().load().type(ACRALog.class).filter("REPORT_ID", beo.REPORT_ID).first().now();
     
      owner = beo.Owner;

      DailyCounts userCounts = DailyCountsGetters.getDate(owner, beo.Timestamp);
      DailyCounts packageCounts = DailyCountsGetters.getDate(beo.PACKAGE_NAME, beo.Timestamp);

      userCounts.incDeleted();
      packageCounts.incDeleted();

      if(beo.lookedAt)
      {
        lookedAt++;
      }
View Full Code Here

Examples of nz.org.winters.appspot.acrareporter.store.DailyCounts

        //    log.warning("Discarded Old version " + PACKAGE_NAME + " NO MAPPING");
            return;
          }
        }

        DailyCounts today = DailyCountsGetters.getToday(acraLog.PACKAGE_NAME);
        if(today.Reports > 200)
        {
         // System.out.println("200 Reports in day " + PACKAGE_NAME + " DISCARDING NEW");
          log.severe("200 Reports in day " + PACKAGE_NAME + " DISCARDING NEW");
          appPackage.enabled = false;
          ofy.save().entity(appPackage).now();
         
          // email app owner.
          SendAppTooManyEMail(appUser,appPackage,today);
         
         
          response.sendError(HttpServletResponse.SC_FORBIDDEN);
          return;
        }
       
        ofy.save().entity(basicInfo).now();
        ofy.save().entity(acraLog).now();

        // Increment counters.
        appUser.Totals.incReports();
        ofy.save().entity(appUser).now();

        appPackage.Totals.incReports();
        ofy.save().entity(appPackage).now();

        DailyCounts counts = DailyCountsGetters.getToday(appUser.id);
        counts.incReports();
        ofy.save().entity(counts).now();

        today.incReports();
        ofy.save().entity(today).now();
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.