Search in sources :

Example 1 with ParseVendorConfigurationJob

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

the class Batfish method parseVendorConfigurations.

private SortedMap<String, VendorConfiguration> parseVendorConfigurations(Map<Path, String> configurationData, ParseVendorConfigurationAnswerElement answerElement, ConfigurationFormat configurationFormat) {
    _logger.info("\n*** PARSING VENDOR CONFIGURATION FILES ***\n");
    _logger.resetTimer();
    SortedMap<String, VendorConfiguration> vendorConfigurations = new TreeMap<>();
    List<ParseVendorConfigurationJob> jobs = new ArrayList<>();
    for (Entry<Path, String> vendorFile : configurationData.entrySet()) {
        Path currentFile = vendorFile.getKey();
        String fileText = vendorFile.getValue();
        Warnings warnings = buildWarnings(_settings);
        ParseVendorConfigurationJob job = new ParseVendorConfigurationJob(_settings, fileText, currentFile, warnings, configurationFormat);
        jobs.add(job);
    }
    BatfishJobExecutor.runJobsInExecutor(_settings, _logger, jobs, vendorConfigurations, answerElement, _settings.getHaltOnParseError(), "Parse configurations");
    _logger.printElapsedTime();
    return vendorConfigurations;
}
Also used : Path(java.nio.file.Path) IptablesVendorConfiguration(org.batfish.representation.iptables.IptablesVendorConfiguration) VendorConfiguration(org.batfish.vendor.VendorConfiguration) ParseVendorConfigurationJob(org.batfish.job.ParseVendorConfigurationJob) ArrayList(java.util.ArrayList) TreeMap(java.util.TreeMap) Warnings(org.batfish.common.Warnings)

Aggregations

Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 TreeMap (java.util.TreeMap)1 Warnings (org.batfish.common.Warnings)1 ParseVendorConfigurationJob (org.batfish.job.ParseVendorConfigurationJob)1 IptablesVendorConfiguration (org.batfish.representation.iptables.IptablesVendorConfiguration)1 VendorConfiguration (org.batfish.vendor.VendorConfiguration)1