Package org.wso2.carbon.bam.common.clients

Examples of org.wso2.carbon.bam.common.clients.SummaryDimensionDSClient


      }
    }
  }

  public MonthDimension getMonthDimension(Calendar month) throws BAMException {
        SummaryDimensionDSClient summaryDimension = null;
    try {
      summaryDimension = BAMUtil.getSummaryDimensionDSClient();
      QuarterDimension qd = getQuarterDimension(month);
      if (qd == null)
        return null;
      return summaryDimension.getMonthDimension(month.get(Calendar.MONTH), qd.getId());
    } catch (Exception e) {
      throw new BAMException("Retrieving month dimension failed for timestamp "
          + BAMCalendar.getInstance(month).getBAMTimestamp(), e);
    } finally {
      if (summaryDimension != null) {
          summaryDimension.cleanup();
      }
    }
  }
View Full Code Here


      }
    }
  }

  public DayDimension getDayDimension(Calendar day) throws BAMException {
        SummaryDimensionDSClient summaryDimension = null;
    try {
      summaryDimension = BAMUtil.getSummaryDimensionDSClient();
      MonthDimension md = getMonthDimension(day);
      if (md == null)
        return null;
      return summaryDimension.getDayDimension(day.get(Calendar.DAY_OF_MONTH), md.getId());
    } catch (Exception e) {
      throw new BAMException("Retrieving day dimension failed for timestamp "
          + BAMCalendar.getInstance(day).getBAMTimestamp(), e);
    } finally {
      if (summaryDimension != null) {
          summaryDimension.cleanup();
      }
    }
  }
View Full Code Here

      }
    }
  }

  public HourDimension getHourDimension(Calendar hour) throws BAMException {
        SummaryDimensionDSClient summaryDimension =  null;
    try {
      summaryDimension = BAMUtil.getSummaryDimensionDSClient();
      DayDimension dd = getDayDimension(hour);
      if (dd == null)
        return null;
      return summaryDimension.getHourDimension(hour.get(Calendar.HOUR_OF_DAY), dd.getId());
    } catch (Exception e) {
      throw new BAMException("Retrieving hour dimension failed for timestamp "
          + BAMCalendar.getInstance(hour).getBAMTimestamp(), e);
    } finally {
      if (summaryDimension != null) {
          summaryDimension.cleanup();
      }
    }
  }
View Full Code Here

      }
    }
  }

  public void addYearDimension(BAMCalendar startTime) throws BAMException {
        SummaryDimensionDSClient summaryDimension = null;
    try {
      summaryDimension = BAMUtil.getSummaryDimensionDSClient();
      BAMCalendar yearStartTime = BAMCalendar.getYear(startTime);
      summaryDimension.addYearDimension(yearStartTime);
    } catch (Exception e) {
      throw new BAMException("Adding year dimension failed: " + startTime.getBAMTimestamp(), e);
    } finally {
      if (summaryDimension != null) {
          summaryDimension.cleanup();
      }
    }
  }
View Full Code Here

      }
    }
  }

  public void addQuarterDimension(BAMCalendar startTime) throws BAMException {
        SummaryDimensionDSClient summaryDimension = null;
    try {
      summaryDimension = BAMUtil.getSummaryDimensionDSClient();
      YearDimension yd = this.getYearDimension(startTime);
      if (yd == null) {
        addYearDimension(startTime);
        yd = this.getYearDimension(startTime);
      }
      if (yd == null) {
        throw new BAMException("Adding year dimension failed: " + startTime.getBAMTimestamp());
      }
      summaryDimension.addQuarterDimension(BAMCalendar.getQuarter(startTime), null, yd.getId());
    } catch (Exception e) {
      throw new BAMException("Adding quarter dimension failed: " + startTime.getBAMTimestamp(), e);
    } finally {
      if (summaryDimension != null) {
          summaryDimension.cleanup();
      }
    }
  }
View Full Code Here

      }
    }
  }

  public void addMonthDimension(BAMCalendar startTime) throws BAMException {
        SummaryDimensionDSClient summaryDimension = null;
    try {
      summaryDimension = BAMUtil.getSummaryDimensionDSClient();
      QuarterDimension qd = this.getQuarterDimension(startTime);
      if (qd == null) {
        addQuarterDimension(startTime);
        qd = this.getQuarterDimension(startTime);
      }
      if (qd == null) {
        throw new BAMException("Adding quarter dimension failed: " + startTime.getBAMTimestamp());
      }
      summaryDimension.addMonthDimension(BAMCalendar.getMonth(startTime), null, qd.getId());
    } catch (Exception e) {
      throw new BAMException("Adding month dimension failed: " + startTime.getBAMTimestamp(), e);
    } finally {
      if (summaryDimension != null) {
          summaryDimension.cleanup();
      }
    }
  }
View Full Code Here

      }
    }
  }

  public void addDayDimension(BAMCalendar startTime) throws BAMException {
        SummaryDimensionDSClient summaryDimension = null;
    try {
      summaryDimension = BAMUtil.getSummaryDimensionDSClient();

      MonthDimension md = this.getMonthDimension(startTime);
      if (md == null) {
        addMonthDimension(startTime);
        md = this.getMonthDimension(startTime);
      }
      if (md == null) {
        throw new BAMException("Adding month dimension failed: " + startTime.getBAMTimestamp());
      }
      summaryDimension.addDayDimension(BAMCalendar.getDay(startTime), null, md.getId());
    } catch (Exception e) {
      throw new BAMException("Adding day dimension failed: " + startTime.getBAMTimestamp(), e);
    } finally {
      if (summaryDimension != null) {
          summaryDimension.cleanup();
      }
    }
  }
View Full Code Here

      }
    }
  }

  public void addHourDimension(BAMCalendar startTime) throws BAMException {
        SummaryDimensionDSClient summaryDimension = null;
    try {
      summaryDimension = BAMUtil.getSummaryDimensionDSClient();
      DayDimension dd = this.getDayDimension(startTime);
      if (dd == null) {
        addDayDimension(startTime);
        dd = this.getDayDimension(startTime);
      }
      if (dd == null) {
        throw new BAMException("Adding hour dimension failed: " + startTime.getBAMTimestamp());
      }
      summaryDimension.addHourDimension(BAMCalendar.getHour(startTime), dd.getId());
    } catch (Exception e) {
      throw new BAMException("Adding hour dimension failed: " + startTime.getBAMTimestamp(), e);
    } finally {
      if (summaryDimension != null) {
          summaryDimension.cleanup();
      }
    }
  }
View Full Code Here

     * @return The end line number, or -1 if could not be determined
     */
    public int getEndLineNumber() {
      int ret=-1;
     
      ActivityInterface parent=getParent();
     
      if (parent != null) {
        int index=parent.getSubActivities().indexOf(this);
       
        if (index != -1) {
          if (index < (parent.getSubActivities().size()-1)) {
            ActivityInterface other=parent.getSubActivities().get(index+1);
           
            ret = other.getStartLineNumber()-1;
          } else {
            ret = parent.getEndLineNumber();
          }
        }
      }
View Full Code Here

     *
     * @param lineNumber The line number
     * @return The activity, or null if not found
     */
    public ActivityInterface getActivityAtLineNumber(int lineNumber) {
      ActivityInterface ret=null;
     
      int endline=getEndLineNumber();
     
      if (getStartLineNumber() <= lineNumber && (endline == -1 || endline >= lineNumber)) {
       
View Full Code Here

TOP

Related Classes of org.wso2.carbon.bam.common.clients.SummaryDimensionDSClient

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.