Search in sources :

Example 1 with IFactoryCountryEnvDeployType

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

the class UpdateCountryEnvParam method getCountryEnvironmentDeployTypeFromParameter.

private List<CountryEnvDeployType> getCountryEnvironmentDeployTypeFromParameter(HttpServletRequest request, ApplicationContext appContext, String system, String country, String environment, JSONArray json) throws JSONException {
    List<CountryEnvDeployType> cedList = new ArrayList();
    IFactoryCountryEnvDeployType cedFactory = appContext.getBean(IFactoryCountryEnvDeployType.class);
    for (int i = 0; i < json.length(); i++) {
        JSONObject tcsaJson = json.getJSONObject(i);
        boolean delete = tcsaJson.getBoolean("toDelete");
        String deployType = tcsaJson.getString("deployType");
        String jenkinsAgent = tcsaJson.getString("jenkinsAgent");
        if (!delete) {
            CountryEnvDeployType ced = cedFactory.create(system, country, environment, deployType, jenkinsAgent);
            cedList.add(ced);
        }
    }
    return cedList;
}
Also used : CountryEnvDeployType(org.cerberus.crud.entity.CountryEnvDeployType) IFactoryCountryEnvDeployType(org.cerberus.crud.factory.IFactoryCountryEnvDeployType) JSONObject(org.json.JSONObject) ArrayList(java.util.ArrayList) IFactoryCountryEnvDeployType(org.cerberus.crud.factory.IFactoryCountryEnvDeployType)

Aggregations

ArrayList (java.util.ArrayList)1 CountryEnvDeployType (org.cerberus.crud.entity.CountryEnvDeployType)1 IFactoryCountryEnvDeployType (org.cerberus.crud.factory.IFactoryCountryEnvDeployType)1 JSONObject (org.json.JSONObject)1