class ClientProcessor {

    public synchronized void processClient() throws Exception {

        AllSharedPreferences allSharedPreferences = new AllSharedPreferences(preferences);
        long lastSyncTimeStamp = allSharedPreferences.fetchLastSyncDate(0);
        Date lastSyncDate = new Date(lastSyncTimeStamp);
        String clientClassificationStr = getFileContents("ec_client_classification.json");
        String clientAlertsStr = getFileContents("ec_client_alerts.json");

        //this seems to be easy for now cloudant json to events model is crazy
        List<JSONObject> eventsAndAlerts = mCloudantDataHandler.getUpdatedEventsAndAlerts(lastSyncDate);
        if (!eventsAndAlerts.isEmpty()) {
            for (JSONObject eventOrAlert : eventsAndAlerts) {
                String type = eventOrAlert.has("type") ? eventOrAlert.getString("type") : null;

                if (type.equals("Event")) {

                    JSONObject clientClassificationJson = new JSONObject(clientClassificationStr);

                    if (isNullOrEmptyJSONObject(clientClassificationJson)) {
                        continue;
                    }

                    // Iterate through the events
                    processEvent(eventOrAlert, clientClassificationJson);
                } else if (type.equals("Action")) {
                    JSONObject clientAlertClassificationJson = new JSONObject(clientAlertsStr);

                    if (isNullOrEmptyJSONObject(clientAlertClassificationJson)) {
                        continue;
                    }

                    processAlert(eventOrAlert, clientAlertClassificationJson);
                }
            }
        }

        allSharedPreferences.saveLastSyncDate(lastSyncDate.getTime());
    }

    public  ClientProcessor(Context context);

}