class SyncSettingsServiceHelper {

    public int processIntent() throws JSONException {

        try {
            JSONObject response = pushSettingsToServer();
            if (response != null && response.has(AllConstants.INTENT_KEY.VALIDATED_RECORDS)) {
                JSONArray records = response.getJSONArray(AllConstants.INTENT_KEY.VALIDATED_RECORDS);
                Setting setting;
                for (int i = 0; i < records.length(); i++) {
                    setting = getInstance().context().allSettings().getSetting(records.getString(0));
                    setting.setSyncStatus(SyncStatus.SYNCED.name());
                    getInstance().context().allSettings().putSetting(setting);
                }
            }

        } catch (JSONException e) {
            Timber.e(e);
        }

        JSONArray settings = getSettings();
        if (settings != null && settings.length() > 0) {
            ServerSettingsHelper.saveSetting(settings);
        }

        return settings == null ? 0 : settings.length();
    }

    public  SyncSettingsServiceHelper(String baseUrl, HTTPAgent httpAgent);

}