Search in sources :

Example 1 with IFactoryCountryEnvironmentDatabase

use of org.cerberus.crud.factory.IFactoryCountryEnvironmentDatabase in project cerberus-source by cerberustesting.

the class UpdateCountryEnvParam method getCountryEnvironmentDatabaseFromParameter.

private List<CountryEnvironmentDatabase> getCountryEnvironmentDatabaseFromParameter(HttpServletRequest request, ApplicationContext appContext, String system, String country, String environment, JSONArray json) throws JSONException {
    List<CountryEnvironmentDatabase> cebList = new ArrayList();
    IFactoryCountryEnvironmentDatabase cebFactory = appContext.getBean(IFactoryCountryEnvironmentDatabase.class);
    for (int i = 0; i < json.length(); i++) {
        JSONObject tcsaJson = json.getJSONObject(i);
        boolean delete = tcsaJson.getBoolean("toDelete");
        String database = tcsaJson.getString("database");
        String connectionPool = tcsaJson.getString("connectionPoolName");
        String soapUrl = tcsaJson.getString("soapUrl");
        String csvUrl = tcsaJson.getString("csvUrl");
        if (!delete) {
            CountryEnvironmentDatabase ceb = cebFactory.create(system, country, environment, database, connectionPool, soapUrl, csvUrl);
            cebList.add(ceb);
        }
    }
    return cebList;
}
Also used : IFactoryCountryEnvironmentDatabase(org.cerberus.crud.factory.IFactoryCountryEnvironmentDatabase) JSONObject(org.json.JSONObject) ArrayList(java.util.ArrayList) CountryEnvironmentDatabase(org.cerberus.crud.entity.CountryEnvironmentDatabase) IFactoryCountryEnvironmentDatabase(org.cerberus.crud.factory.IFactoryCountryEnvironmentDatabase)

Aggregations

ArrayList (java.util.ArrayList)1 CountryEnvironmentDatabase (org.cerberus.crud.entity.CountryEnvironmentDatabase)1 IFactoryCountryEnvironmentDatabase (org.cerberus.crud.factory.IFactoryCountryEnvironmentDatabase)1 JSONObject (org.json.JSONObject)1