Search in sources :

Example 1 with GenericHttpGetGatewayConfig

use of org.hisp.dhis.sms.config.GenericHttpGetGatewayConfig in project dhis2-core by dhis2.

the class V2_34_6__Convert_systemsetting_value_column_from_bytea_to_string method updateSmsConfiguration.

private void updateSmsConfiguration(SmsConfiguration smsConfiguration) {
    if (smsConfiguration == null) {
        return;
    }
    List<SmsGatewayConfig> existingGatewayConfigs = smsConfiguration.getGateways();
    List<SmsGatewayConfig> updatedGatewayConfigs = new ArrayList<>();
    for (SmsGatewayConfig gatewayConfig : existingGatewayConfigs) {
        if (gatewayConfig instanceof GenericHttpGetGatewayConfig) {
            GenericHttpGatewayConfig newGatewayConfig = convertToNewSmsGenericConfig((GenericHttpGetGatewayConfig) gatewayConfig);
            updatedGatewayConfigs.add(newGatewayConfig);
        } else {
            updatedGatewayConfigs.add(gatewayConfig);
        }
    }
    smsConfiguration.setGateways(updatedGatewayConfigs);
}
Also used : ArrayList(java.util.ArrayList) SmsGatewayConfig(org.hisp.dhis.sms.config.SmsGatewayConfig) GenericHttpGatewayConfig(org.hisp.dhis.sms.config.GenericHttpGatewayConfig) GenericHttpGetGatewayConfig(org.hisp.dhis.sms.config.GenericHttpGetGatewayConfig)

Aggregations

ArrayList (java.util.ArrayList)1 GenericHttpGatewayConfig (org.hisp.dhis.sms.config.GenericHttpGatewayConfig)1 GenericHttpGetGatewayConfig (org.hisp.dhis.sms.config.GenericHttpGetGatewayConfig)1 SmsGatewayConfig (org.hisp.dhis.sms.config.SmsGatewayConfig)1