Package org.wso2.carbon.bam.util

Examples of org.wso2.carbon.bam.util.BAMCalendar


        return latestSummaryTime;
    }


    protected Calendar getCalendarWithZeroTimeFields(Calendar cal) {
        BAMCalendar zeroCal;
        BAMCalendar tempCal = BAMCalendar.getInstance(cal);
        switch (getTimeInterval()) {
            case BAMCalendar.YEAR:
                zeroCal = BAMCalendar.getYear(tempCal);
                break;
            case BAMCalendar.QUATER:
View Full Code Here


            TimeRange retention = BAMPersistenceManager.getPersistenceManager(BAMUtil.getRegistry()).getDataRetentionPeriod();

            // do not delete anything if the retention period specified is 0.
            if (retention.getValue() != 0) {

                BAMCalendar delLoHour = BAMCalendar.getInstance(loHour);
                BAMCalendar delHiHour = BAMCalendar.getInstance(hiHour);

                delHiHour.add(retention.getType(), -1 * retention.getValue());
                delLoHour.add(retention.getType(), -1 * retention.getValue());


                spm.deleteServerProxyServiceUserData(getServer().getId(),
                        getProxyService().getName(), getProxyService().getDirection(), delLoHour, delHiHour);
View Full Code Here

            TimeRange retention = BAMPersistenceManager.getPersistenceManager(BAMUtil.getRegistry()).getDataRetentionPeriod();

            // do not delete anything if the retention period specified is 0.
            if (retention.getValue() != 0) {

                BAMCalendar delLoHour = BAMCalendar.getInstance(loHour);
                BAMCalendar delHiHour = BAMCalendar.getInstance(hiHour);

                delHiHour.add(retention.getType(), -1 * retention.getValue());
                delLoHour.add(retention.getType(), -1 * retention.getValue());

                spm.deleteServerEndpointUserData(getServer().getId(),
                        getEndpoint().getName(), getEndpoint().getDirection(), delLoHour, delHiHour);
            }
View Full Code Here

    public Archiver(int timeInterval) {
        this.timeInterval = timeInterval;
    }

    public void archive() throws BAMException {
        BAMCalendar nowTime = BAMCalendar.getInstance(Calendar.getInstance());

        if (log.isDebugEnabled()) {
            log.debug("[" + this.getClass().getSimpleName() + " | " + getTimeString() + "] " + "Time Now:"
                      + BAMCalendar.getInstance(nowTime).getBAMTimestamp());
        }

        BAMArchiverDSClient client = BAMUtil.getArchiverDSClient();

        Calendar lastTime = client.getLatestArchiveTimeStamp();
        if (lastTime == null) {
            lastTime = createEpochCalendar();
        }

        //Calendar zeroLastTime = getCalendarWithZeroTimeFields(lastTime);

        if (log.isDebugEnabled()) {
            log.debug("[" + this.getClass().getSimpleName() + " | " + getTimeString() + "] " + "Archive last ran at:"
                      + BAMCalendar.getInstance(lastTime).getBAMTimestamp());
        }

        TimeRange archival = BAMPersistenceManager.getPersistenceManager(BAMUtil.getRegistry()).getDataArchivalPeriod();

        // do not archive anything if the archival period specified is 0.
        if (archival.getValue() != 0) {

            nowTime.add(archival.getType(), -1 * archival.getValue());
            lastTime.add(archival.getType(), -1 * archival.getValue());

            MessageDataDO[] datas = client.getMessageArchiveData(lastTime, nowTime);

            for (MessageDataDO data : datas) {
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

            int width = 0;
            int height = 0;
            dimensions = new SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            ActivityInterface activity = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }
View Full Code Here

    protected Element getArrows(SVGDocument doc) {
        Element subGroup = null;
        subGroup = doc.createElementNS("http://www.w3.org/2000/svg", "g");

        if (subActivities != null) {
            ActivityInterface prevActivity = null;
            ActivityInterface activity = null;
            String id = null;
            org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates exitCoords = null;
            SVGCoordinates entryCoords = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = subActivities.iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                if (prevActivity != null) {
                    exitCoords = prevActivity.getExitArrowCoords();
                    entryCoords = activity.getEntryArrowCoords();
                    id = prevActivity.getId() + "-" + activity.getId();
                    subGroup.appendChild(getArrowDefinition(doc, exitCoords.getXLeft(),
                        exitCoords.getYTop(), entryCoords.getXLeft(),
                        entryCoords.getYTop(), id, prevActivity, activity));
                }
                prevActivity = activity;
View Full Code Here

    @Override
    public org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates getExitArrowCoords() {
        SVGCoordinates coords = getStartIconExitArrowCoords();

        if (subActivities != null && subActivities.size() > 0) {
            ActivityInterface activity = subActivities.get(subActivities.size() - 1);
            coords = activity.getExitArrowCoords();
        }
        return coords;
    }
View Full Code Here

    protected Element getArrows(SVGDocument doc) {
        Element subGroup = null;
        subGroup = doc.createElementNS("http://www.w3.org/2000/svg", "g");
        if (subActivities != null) {
            ActivityInterface prevActivity = null;
            ActivityInterface activity = null;
            String id = null;
            org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates myStartCoords = getStartIconExitArrowCoords();
            org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates exitCoords = null;
            SVGCoordinates entryCoords = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = subActivities.iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                if (prevActivity != null) {
                    exitCoords = prevActivity.getExitArrowCoords();
                    entryCoords = activity.getEntryArrowCoords();
                    id = prevActivity.getId() + "-" + activity.getId();
                    subGroup.appendChild(getArrowDefinition(doc, exitCoords.getXLeft(),
                        exitCoords.getYTop(), entryCoords.getXLeft(),
                        entryCoords.getYTop(), id, prevActivity, activity));
                } else {
                    entryCoords = activity.getEntryArrowCoords();
                    subGroup.appendChild(getArrowDefinition(doc, myStartCoords.getXLeft(),
                        myStartCoords.getYTop(), entryCoords.getXLeft(),
                        entryCoords.getYTop(), id, prevActivity, activity));
                }
                prevActivity = activity;
View Full Code Here

TOP

Related Classes of org.wso2.carbon.bam.util.BAMCalendar

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.