IoT DAS Frameworks - IT Infra Monitoring and Analytics/IOT_Applications/Performance_Dashboard_Application(Reference App)/source/SA-DashBoard/src/java/com/merit/dashboard/service/DashBoardService.java
public void generateMetricTypeJson(String resourceType, String selection, String startDate, String endDate, String timestampselection, String customer) {
        try {
            queryExecuter = new QueryExecuter();
            bizlogic = new BizLogic();

            Date dateStart = formatter1.parse(startDate);
            Date dateEnd = formatter1.parse(endDate);
            String date = formatter1.format(dateStart);
            String date1 = formatter1.format(dateEnd);
            smilli = dateStart.getTime() / 1000;
            emilli = dateEnd.getTime() / 1000;

            String szMetricJson = "";
            if (selection.contains("Availability")) {
                //availability hence no change
                String szAvailJson = GetAvailability.getAvailabilityByPeriod(emilli, smilli, resourceType, customer, timestampselection);
                //System.out.println(">>>>>>>>>>>>>>><<<<<<<<<<<<<< szAvailJson = " + szAvailJson);
                szMetricJson = szAvailJson;
                //szMetricJson = bizlogic.generateJsonFromCombinedTable(new LinkedHashMap<String, String>(), new LinkedHashMap<String, String>(), szAvailJson);
            } else if (selection.contains("Alert")) {
                //alerts only and no change for selection
                LinkedHashMap<String, String> mapTicketInfo = queryExecuter.collectTicketdata(customer, resourceType, date, date1,selection);
                szMetricJson = ServletContextListener.modifyMapToJSONArray(mapTicketInfo);//bizlogic.generateJsonFromCombinedTable(new LinkedHashMap<String, String>(), mapTicketInfo, "[{}]");
               // System.out.println("*********** Alerts szMetricJson = " + szMetricJson);
            } else {
                //metrictype except avalability and alerts
                String metricTypeIn = ServletContextListener.getJSONMetricGroupSet(resourceType, selection);
                LinkedHashMap<String, String> mapMetricInfo = queryExecuter.collectMetricdata(customer, resourceType, metricTypeIn, smilli, emilli);
                szMetricJson = ServletContextListener.modifyMapToJSONArray(mapMetricInfo);//bizlogic.generateJsonFromCombinedTable(mapMetricInfo, new LinkedHashMap<String, String>(), "[{}]");
               // System.out.println("*********** other metricType szMetricJson = " + szMetricJson);
            }


            new SendFileToJson(customer, selection, timestampselection, resourceType, "MetricTypes", szMetricJson);
            QueryExecuter.pojoObject = null;
            //mapTicketInfo = null;
            queryExecuter = null;
            //mapMetricInfo = null;

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
/**
     * ************************************************************************************************
     * This method is calling queryExecuter.collectMetricdata() for getting all
     * Metric Info, queryExecuter.collectTicketdata() for getting all Tiket Info
     * and GetAvailability.getAvailabilityByPeriod() for getting Availability
     * Information and then returning all these JSON String are combined and
     * creating JSON Files name MetricTypes.json
     *
     * @param customer Selected customerID
     * @param resourceType Different category as
     * Desktop,Server,DataBase,Network,JVM
     * @param startDate from date as subtract(endDate-timestampselection) in
     * Date Format
     * @param endDate Current date in Date Format
     * @return timestampselection Selected Time Period means (hour, days, week,
     * month, year)
     *
     * *************************************************************************************************
     */
This method is calling queryExecuter.collectMetricdata() for getting all
Metric Info, queryExecuter.collectTicketdata() for getting all Tiket Info
and GetAvailability.getAvailabilityByPeriod() for getting Availability
Information and then returning all these JSON String are combined and
creating JSON Files name MetricTypes.json


This method is calling queryExecuter . collectMetricdata () for getting all Metric Info queryExecuter . collectTicketdata () for getting all Tiket Info and GetAvailability . getAvailabilityByPeriod () for getting Availability Information and then returning all these JSON String are combined and creating JSON Files name MetricTypes . json
public void generateMetricTypeJson(String resourceType, String selection, String startDate, String endDate, String timestampselection, String customer) {
        try {
            queryExecuter = new QueryExecuter();
            bizlogic = new BizLogic();
            Date dateStart = formatter1.parse(startDate);
            Date dateEnd = formatter1.parse(endDate);
            String date = formatter1.format(dateStart);
            String date1 = formatter1.format(dateEnd);
            smilli = dateStart.getTime() / 1000;
            emilli = dateEnd.getTime() / 1000;
            String szMetricJson = "";
            if (selection.contains("Availability")) {
                String szAvailJson = GetAvailability.getAvailabilityByPeriod(emilli, smilli, resourceType, customer, timestampselection);
                szMetricJson = szAvailJson;
            } else if (selection.contains("Alert")) {
                LinkedHashMap<String, String> mapTicketInfo = queryExecuter.collectTicketdata(customer, resourceType, date, date1,selection);
                szMetricJson = ServletContextListener.modifyMapToJSONArray(mapTicketInfo);
            } else {
                String metricTypeIn = ServletContextListener.getJSONMetricGroupSet(resourceType, selection);
                LinkedHashMap<String, String> mapMetricInfo = queryExecuter.collectMetricdata(customer, resourceType, metricTypeIn, smilli, emilli);
                szMetricJson = ServletContextListener.modifyMapToJSONArray(mapMetricInfo);
            }
            new SendFileToJson(customer, selection, timestampselection, resourceType, "MetricTypes", szMetricJson);
            QueryExecuter.pojoObject = null;
            queryExecuter = null;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
public void generateMetricTypeJson ( String resourceType , String selection , String startDate , String endDate , String timestampselection , String customer ) { try { queryExecuter = new QueryExecuter ( ) ; bizlogic = new BizLogic ( ) ; Date dateStart = formatter1 . parse ( startDate ) ; Date dateEnd = formatter1 . parse ( endDate ) ; String date = formatter1 . format ( dateStart ) ; String date1 = formatter1 . format ( dateEnd ) ; smilli = dateStart . getTime ( ) / 1000 ; emilli = dateEnd . getTime ( ) / 1000 ; String szMetricJson = "" ; if ( selection . contains ( "Availability" ) ) { String szAvailJson = GetAvailability . getAvailabilityByPeriod ( emilli , smilli , resourceType , customer , timestampselection ) ; szMetricJson = szAvailJson ; } else if ( selection . contains ( "Alert" ) ) { LinkedHashMap < String , String > mapTicketInfo = queryExecuter . collectTicketdata ( customer , resourceType , date , date1 , selection ) ; szMetricJson = ServletContextListener . modifyMapToJSONArray ( mapTicketInfo ) ; } else { String metricTypeIn = ServletContextListener . getJSONMetricGroupSet ( resourceType , selection ) ; LinkedHashMap < String , String > mapMetricInfo = queryExecuter . collectMetricdata ( customer , resourceType , metricTypeIn , smilli , emilli ) ; szMetricJson = ServletContextListener . modifyMapToJSONArray ( mapMetricInfo ) ; } new SendFileToJson ( customer , selection , timestampselection , resourceType , "MetricTypes" , szMetricJson ) ; QueryExecuter . pojoObject = null ; queryExecuter = null ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
This method is calling queryExecuter.collectMetricdata() for getting all
 Metric Info, queryExecuter.collectTicketdata() for getting all Tiket Info
 and GetAvailability.getAvailabilityByPeriod() for getting Availability
 Information and then returning all these JSON String are combined and
 creating JSON Files name MetricTypes.json
This method is calling queryExecuter . collectMetricdata () for getting all Metric Info queryExecuter . collectTicketdata () for getting all Tiket Info and GetAvailability . getAvailabilityByPeriod () for getting Availability Information and then returning all these JSON String are combined and creating JSON Files name MetricTypes . json
//availability hence no change //System.out.println(">>>>>>>>>>>>>>><<<<<<<<<<<<<< szAvailJson = " + szAvailJson); //szMetricJson = bizlogic.generateJsonFromCombinedTable(new LinkedHashMap<String, String>(), new LinkedHashMap<String, String>(), szAvailJson); //alerts only and no change for selection //bizlogic.generateJsonFromCombinedTable(new LinkedHashMap<String, String>(), mapTicketInfo, "[{}]"); // System.out.println("*********** Alerts szMetricJson = " + szMetricJson); //metrictype except avalability and alerts //bizlogic.generateJsonFromCombinedTable(mapMetricInfo, new LinkedHashMap<String, String>(), "[{}]"); // System.out.println("*********** other metricType szMetricJson = " + szMetricJson); //mapTicketInfo = null; //mapMetricInfo = null;