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;
}
Aggregations