Search in sources :

Example 1 with ConvertConfigurationJob

use of org.batfish.job.ConvertConfigurationJob in project batfish by batfish.

the class Batfish method convertConfigurations.

private Map<String, Configuration> convertConfigurations(Map<String, GenericConfigObject> vendorConfigurations, ConvertConfigurationAnswerElement answerElement) {
    _logger.info("\n*** CONVERTING VENDOR CONFIGURATIONS TO INDEPENDENT FORMAT ***\n");
    _logger.resetTimer();
    Map<String, Configuration> configurations = new TreeMap<>();
    List<ConvertConfigurationJob> jobs = new ArrayList<>();
    for (Entry<String, GenericConfigObject> config : vendorConfigurations.entrySet()) {
        GenericConfigObject vc = config.getValue();
        ConvertConfigurationJob job = new ConvertConfigurationJob(_settings, vc, config.getKey());
        jobs.add(job);
    }
    BatfishJobExecutor.runJobsInExecutor(_settings, _logger, jobs, configurations, answerElement, _settings.getHaltOnConvertError(), "Convert configurations to vendor-independent format");
    _logger.printElapsedTime();
    return configurations;
}
Also used : HostConfiguration(org.batfish.representation.host.HostConfiguration) Configuration(org.batfish.datamodel.Configuration) ImmutableConfiguration(org.apache.commons.configuration2.ImmutableConfiguration) AwsConfiguration(org.batfish.representation.aws.AwsConfiguration) IptablesVendorConfiguration(org.batfish.representation.iptables.IptablesVendorConfiguration) VendorConfiguration(org.batfish.vendor.VendorConfiguration) ConvertConfigurationJob(org.batfish.job.ConvertConfigurationJob) GenericConfigObject(org.batfish.datamodel.GenericConfigObject) ArrayList(java.util.ArrayList) TreeMap(java.util.TreeMap)

Aggregations

ArrayList (java.util.ArrayList)1 TreeMap (java.util.TreeMap)1 ImmutableConfiguration (org.apache.commons.configuration2.ImmutableConfiguration)1 Configuration (org.batfish.datamodel.Configuration)1 GenericConfigObject (org.batfish.datamodel.GenericConfigObject)1 ConvertConfigurationJob (org.batfish.job.ConvertConfigurationJob)1 AwsConfiguration (org.batfish.representation.aws.AwsConfiguration)1 HostConfiguration (org.batfish.representation.host.HostConfiguration)1 IptablesVendorConfiguration (org.batfish.representation.iptables.IptablesVendorConfiguration)1 VendorConfiguration (org.batfish.vendor.VendorConfiguration)1