Package com.metrictracker.model

Examples of com.metrictracker.model.MetricDao


    br.close();
    return parameters;
  }

  protected Metric getMetric () {
    MetricDao metricDao = new MetricDao();
    String metricName = null;
    try {
      metricName = URLDecoder.decode((String) getRequestAttributes().get("metricName"), "UTF-8");
    } catch (UnsupportedEncodingException e) {
      ExceptionManager.logException(log, e);
      return null;
    }
    return metricDao.getMetric(metricName);
  }
View Full Code Here


    Objectify ofy = ObjectifyService.begin();
    try {
      HashMap<String, String> parameters = getParameters(entity);
      Metric metric = new Metric (parameters.get("metricName"));
      MetricDao metricDao = new MetricDao();
      metricDao.put(metric);
      ofy.put(metric);
      getResponse().setStatus(Status.SUCCESS_CREATED)
    } catch (UnsupportedEncodingException e) {
      ExceptionManager.logException(log, e);
      getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);
View Full Code Here

    }
  }

  @Delete
  public Representation delete() {
    MetricDao dao = new MetricDao();
    Metric metric = getMetric();

    MetricValueDao valueDao = new MetricValueDao();
    List<MetricValue> metricValues = valueDao.listByProperty("metricKey", metric.getKey());
    valueDao.deleteAll(metricValues);

    MetricGoalDao goalDao = new MetricGoalDao();
    List<MetricGoal> metricGoals = goalDao.listByProperty("metricKey", metric.getKey());
    goalDao.deleteAll(metricGoals);

    dao.delete(metric);
    return null;
  }
View Full Code Here

    cd.add(new ColumnDescription("isGoalMet", ValueType.TEXT, "Goal Met?"));
    cd.add(new ColumnDescription("percentToGoal", ValueType.TEXT, "Percent to Goal"));

    data.addColumns(cd);

    MetricDao metricDao = new MetricDao();
    String metricName = null;
    metricName = (String) request.getParameter("metricName");
    metricName = "foo";
    Metric metric = metricDao.getMetric(metricName);
   
    MetricValueDao valueDao = new MetricValueDao();
    MetricGoalDao goalDao = new MetricGoalDao();
    List<MetricGoal> metricGoals = goalDao.listByProperty("metricKey", metric.getKey());
    Iterator<MetricValue> values =  valueDao.listByProperty("metricKey", metric.getKey()).iterator();
View Full Code Here

TOP

Related Classes of com.metrictracker.model.MetricDao

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.