IoT CAS Frameworks/IOT_Server/Report_Generator_Framework/source/DashBoard-JSONgenerator-ArbitraryDate/src/com/merit/dashboard/service/DashBoardService.java
public void generateDefaultServiceAndResourceTypeJson(String resourceType, String cCustomer, String service, String startDate,
            String endDate, String timestampselection, String customer) {
        SendFileToJson sfj;//modified
        try {
            queryExecuter = new QueryExecuter();
            resourceType = "";
            /*String szCustomerJson = queryExecuter.generateCustomersLeftGridJson(resourceType, startDate, endDate,
             timestampselection, customer);
             //new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, null, "Defaultservice", szServiceJson);
             new SendFileToJson(customer, "", timestampselection, resourceType, null, null, "CustomersStatus", szCustomerJson);
             String szServiceJson = queryExecuter.generateServicesLeftGridJson(resourceType, cCustomer, startDate, endDate,
             timestampselection, customer);
             //new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, null, "Defaultservice", szServiceJson);
             new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, null, "ServicesStatus", szServiceJson);
             String szResourceTypeJson = queryExecuter.generateDefaultResourceTypeJson(resourceType, cCustomer, service, startDate, endDate,
             timestampselection, customer);
             new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, service, "DefaultResourcetype", szResourceTypeJson);*/
            String watchDogAlertJson = queryExecuter.getWatchDogAlertJson(customer, cCustomer);
            System.out.println("watchDogAlertJson="+watchDogAlertJson);
            //sfj = new SendFileToJson(customer, "", "Hour" + File.separator + "..", resourceType, cCustomer, service, "WatchDogAlert", watchDogAlertJson);
            sfj = new SendFileToJson(customer, "", "Hour" + File.separator, resourceType, null, null, "WatchDogAlert", watchDogAlertJson);
            String szResourceTypeJson = queryExecuter.generateDefaultResourceTypeJson(resourceType, cCustomer, service, startDate, endDate,
                    timestampselection, customer);
            sfj = new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, service, "DefaultResourcetype", szResourceTypeJson);//modified
            //code to generate weather jsons at service level
            String szWeatherJson = queryExecuter.generateWeatherJson(resourceType, cCustomer, service, startDate, endDate,
                    timestampselection, customer);
            sfj = new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, service, "Weather", szWeatherJson);//modified
            //code to generate irradiation jsons at service level
            String szIrradiationJson = queryExecuter.generateIrradiationJson(resourceType, cCustomer, service, startDate, endDate,
                    timestampselection, customer);
            sfj = new SendFileToJson(customer, "", timestampselection, "Inverter", cCustomer, service, "Irradiation", szIrradiationJson);
            //code to generate current snapshot jsons at customer level
            String szSnapShotJson = queryExecuter.generateCurrentSnapShotJson(resourceType, cCustomer, "", startDate, endDate,
                    timestampselection, customer);
            sfj = new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, "", "Summary", szSnapShotJson);//modified
            //code to generate current snapshot jsons at service level
            szSnapShotJson = queryExecuter.generateCurrentSnapShotJson(resourceType, cCustomer, service, startDate, endDate,
                    timestampselection, customer);
            sfj = new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, service, "Summary", szSnapShotJson);//modified
            if (metricflag) {
                String metricResourceJson = queryExecuter.getMetricResourceTypeMapping(customer, cCustomer, service);
                sfj = new SendFileToJson(customer, "", "Hour", "", cCustomer, service, "MetricResourceMappingJson", metricResourceJson);//modified
                metricflag = false;
            }

            log.debug("Done generating default service resourcetype jsons");
            queryExecuter = null;
            sfj = null;
        } catch (Exception e) {
            e.printStackTrace();
            log.error("Error in generateDefaultServiceAndResourceTypeJson" + e.toString());

        }
        //new SendFileToJson(customer, timestampselection, resourceType, szJsonName, szMetricTypeValueJson);
    }
/**
     * ************************************************************************************************
     * This method is calling queryExecuter.generateServicesLeftGridJson() for
     * generating default service and
     * queryExecuter.generateDefaultResourceTypeJson() for generating default
     * ResourceType JSON for Chart and then returning JSON String for creating
     * JSON Files
     *
     * @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.generateServicesLeftGridJson() for
generating default service and
queryExecuter.generateDefaultResourceTypeJson() for generating default
ResourceType JSON for Chart and then returning JSON String for creating
JSON Files


This method is calling queryExecuter . generateServicesLeftGridJson () for generating default service and queryExecuter . generateDefaultResourceTypeJson () for generating default ResourceType JSON for Chart and then returning JSON String for creating JSON Files
public void generateDefaultServiceAndResourceTypeJson(String resourceType, String cCustomer, String service, String startDate,
            String endDate, String timestampselection, String customer) {
        SendFileToJson sfj;
        try {
            queryExecuter = new QueryExecuter();
            resourceType = "";
            /*String szCustomerJson = queryExecuter.generateCustomersLeftGridJson(resourceType, startDate, endDate,
             timestampselection, customer);
             //new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, null, "Defaultservice", szServiceJson);
             new SendFileToJson(customer, "", timestampselection, resourceType, null, null, "CustomersStatus", szCustomerJson);
             String szServiceJson = queryExecuter.generateServicesLeftGridJson(resourceType, cCustomer, startDate, endDate,
             timestampselection, customer);
             //new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, null, "Defaultservice", szServiceJson);
             new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, null, "ServicesStatus", szServiceJson);
             String szResourceTypeJson = queryExecuter.generateDefaultResourceTypeJson(resourceType, cCustomer, service, startDate, endDate,
             timestampselection, customer);
             new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, service, "DefaultResourcetype", szResourceTypeJson);*/
            String watchDogAlertJson = queryExecuter.getWatchDogAlertJson(customer, cCustomer);
            System.out.println("watchDogAlertJson="+watchDogAlertJson);
            sfj = new SendFileToJson(customer, "", "Hour" + File.separator, resourceType, null, null, "WatchDogAlert", watchDogAlertJson);
            String szResourceTypeJson = queryExecuter.generateDefaultResourceTypeJson(resourceType, cCustomer, service, startDate, endDate,
                    timestampselection, customer);
            sfj = new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, service, "DefaultResourcetype", szResourceTypeJson);
            String szWeatherJson = queryExecuter.generateWeatherJson(resourceType, cCustomer, service, startDate, endDate,
                    timestampselection, customer);
            sfj = new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, service, "Weather", szWeatherJson);
            String szIrradiationJson = queryExecuter.generateIrradiationJson(resourceType, cCustomer, service, startDate, endDate,
                    timestampselection, customer);
            sfj = new SendFileToJson(customer, "", timestampselection, "Inverter", cCustomer, service, "Irradiation", szIrradiationJson);
            String szSnapShotJson = queryExecuter.generateCurrentSnapShotJson(resourceType, cCustomer, "", startDate, endDate,
                    timestampselection, customer);
            sfj = new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, "", "Summary", szSnapShotJson);
            szSnapShotJson = queryExecuter.generateCurrentSnapShotJson(resourceType, cCustomer, service, startDate, endDate,
                    timestampselection, customer);
            sfj = new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, service, "Summary", szSnapShotJson);
            if (metricflag) {
                String metricResourceJson = queryExecuter.getMetricResourceTypeMapping(customer, cCustomer, service);
                sfj = new SendFileToJson(customer, "", "Hour", "", cCustomer, service, "MetricResourceMappingJson", metricResourceJson);
                metricflag = false;
            }
            log.debug("Done generating default service resourcetype jsons");
            queryExecuter = null;
            sfj = null;
        } catch (Exception e) {
            e.printStackTrace();
            log.error("Error in generateDefaultServiceAndResourceTypeJson" + e.toString());
        }
    }
public void generateDefaultServiceAndResourceTypeJson ( String resourceType , String cCustomer , String service , String startDate , String endDate , String timestampselection , String customer ) { SendFileToJson sfj ; try { queryExecuter = new QueryExecuter ( ) ; resourceType = "" ; /*String szCustomerJson = queryExecuter.generateCustomersLeftGridJson(resourceType, startDate, endDate,
             timestampselection, customer);
             //new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, null, "Defaultservice", szServiceJson);
             new SendFileToJson(customer, "", timestampselection, resourceType, null, null, "CustomersStatus", szCustomerJson);
             String szServiceJson = queryExecuter.generateServicesLeftGridJson(resourceType, cCustomer, startDate, endDate,
             timestampselection, customer);
             //new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, null, "Defaultservice", szServiceJson);
             new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, null, "ServicesStatus", szServiceJson);
             String szResourceTypeJson = queryExecuter.generateDefaultResourceTypeJson(resourceType, cCustomer, service, startDate, endDate,
             timestampselection, customer);
             new SendFileToJson(customer, "", timestampselection, resourceType, cCustomer, service, "DefaultResourcetype", szResourceTypeJson);*/ String watchDogAlertJson = queryExecuter . getWatchDogAlertJson ( customer , cCustomer ) ; System . out . println ( "watchDogAlertJson=" + watchDogAlertJson ) ; sfj = new SendFileToJson ( customer , "" , "Hour" + File . separator , resourceType , null , null , "WatchDogAlert" , watchDogAlertJson ) ; String szResourceTypeJson = queryExecuter . generateDefaultResourceTypeJson ( resourceType , cCustomer , service , startDate , endDate , timestampselection , customer ) ; sfj = new SendFileToJson ( customer , "" , timestampselection , resourceType , cCustomer , service , "DefaultResourcetype" , szResourceTypeJson ) ; String szWeatherJson = queryExecuter . generateWeatherJson ( resourceType , cCustomer , service , startDate , endDate , timestampselection , customer ) ; sfj = new SendFileToJson ( customer , "" , timestampselection , resourceType , cCustomer , service , "Weather" , szWeatherJson ) ; String szIrradiationJson = queryExecuter . generateIrradiationJson ( resourceType , cCustomer , service , startDate , endDate , timestampselection , customer ) ; sfj = new SendFileToJson ( customer , "" , timestampselection , "Inverter" , cCustomer , service , "Irradiation" , szIrradiationJson ) ; String szSnapShotJson = queryExecuter . generateCurrentSnapShotJson ( resourceType , cCustomer , "" , startDate , endDate , timestampselection , customer ) ; sfj = new SendFileToJson ( customer , "" , timestampselection , resourceType , cCustomer , "" , "Summary" , szSnapShotJson ) ; szSnapShotJson = queryExecuter . generateCurrentSnapShotJson ( resourceType , cCustomer , service , startDate , endDate , timestampselection , customer ) ; sfj = new SendFileToJson ( customer , "" , timestampselection , resourceType , cCustomer , service , "Summary" , szSnapShotJson ) ; if ( metricflag ) { String metricResourceJson = queryExecuter . getMetricResourceTypeMapping ( customer , cCustomer , service ) ; sfj = new SendFileToJson ( customer , "" , "Hour" , "" , cCustomer , service , "MetricResourceMappingJson" , metricResourceJson ) ; metricflag = false ; } log . debug ( "Done generating default service resourcetype jsons" ) ; queryExecuter = null ; sfj = null ; } catch ( Exception e ) { e . printStackTrace ( ) ; log . error ( "Error in generateDefaultServiceAndResourceTypeJson" + e . toString ( ) ) ; } }
This method is calling queryExecuter.generateServicesLeftGridJson() for
 generating default service and
 queryExecuter.generateDefaultResourceTypeJson() for generating default
 ResourceType JSON for Chart and then returning JSON String for creating
 JSON Files
This method is calling queryExecuter . generateServicesLeftGridJson () for generating default service and queryExecuter . generateDefaultResourceTypeJson () for generating default ResourceType JSON for Chart and then returning JSON String for creating JSON Files
//modified //sfj = new SendFileToJson(customer, "", "Hour" + File.separator + "..", resourceType, cCustomer, service, "WatchDogAlert", watchDogAlertJson); //modified //code to generate weather jsons at service level //modified //code to generate irradiation jsons at service level //code to generate current snapshot jsons at customer level //modified //code to generate current snapshot jsons at service level //modified //modified //new SendFileToJson(customer, timestampselection, resourceType, szJsonName, szMetricTypeValueJson);