IoT CAS Frameworks/IOT_Server/Report_Generator_Framework/IT/source/DashBoard-JSONgenerator/src/com/merit/dashboard/bizlogic/BizLogic.java
public static JSONObject accumulateJson(JSONObject obj1, JSONObject obj2) {
        try {

            String keyarr[] = JSONObject.getNames(obj2);
            Object val = "";
            for (String key : keyarr) {
                if (!key.equals("ServerName") && !key.equals("ResourceType") && !key.equals("ServiceName") && !key.equals("ResourceID")) {
                    val = obj2.get(key);
                    obj1.accumulate(key, val);
                }
            }
            return obj1;
        } catch (Exception e) {
            e.printStackTrace();
            log.error("DashBoard accumulateJson two Json Object \n" + e.getMessage());
        }
        return null;
    }
/**
     * ************************************************************************************************
     * Here we are Concatenating two Json Object into one Json Object
     *
     * @param obj1 JSONObject First JsonArray to be Combined
     * @param obj2 JSONObject Second JsonArray to be Combined
     * @return obj1 JSONObject Combined json Array
     * ************************************************************************************************
     *
     */
Here we are Concatenating two Json Object into one Json Object

@param obj1 JSONObject First JsonArray to be Combined
@param obj2 JSONObject Second JsonArray to be Combined
@return obj1 JSONObject Combined json Array
Here we are Concatenating two Json Object into one Json Object @param obj1 JSONObject First JsonArray to be Combined @param obj2 JSONObject Second JsonArray to be Combined @return obj1 JSONObject Combined json Array
public static JSONObject accumulateJson(JSONObject obj1, JSONObject obj2) {
        try {
            String keyarr[] = JSONObject.getNames(obj2);
            Object val = "";
            for (String key : keyarr) {
                if (!key.equals("ServerName") && !key.equals("ResourceType") && !key.equals("ServiceName") && !key.equals("ResourceID")) {
                    val = obj2.get(key);
                    obj1.accumulate(key, val);
                }
            }
            return obj1;
        } catch (Exception e) {
            e.printStackTrace();
            log.error("DashBoard accumulateJson two Json Object \n" + e.getMessage());
        }
        return null;
    }
public static JSONObject accumulateJson ( JSONObject obj1 , JSONObject obj2 ) { try { String keyarr [ ] = JSONObject . getNames ( obj2 ) ; Object val = "" ; for ( String key : keyarr ) { if ( ! key . equals ( "ServerName" ) && ! key . equals ( "ResourceType" ) && ! key . equals ( "ServiceName" ) && ! key . equals ( "ResourceID" ) ) { val = obj2 . get ( key ) ; obj1 . accumulate ( key , val ) ; } } return obj1 ; } catch ( Exception e ) { e . printStackTrace ( ) ; log . error ( "DashBoard accumulateJson two Json Object \n" + e . getMessage ( ) ) ; } return null ; }
Here we are Concatenating two Json Object into one Json Object
Here we are Concatenating two Json Object into one Json Object