private ImportReport importExportFile(Subject subject, InputStream exportFile,
Map<String, Configuration> importerConfigs) throws ImportException, XMLStreamException {
XMLStreamReader rdr = XMLInputFactory.newInstance().createXMLStreamReader(exportFile);
ImportReport report = new ImportReport();
while (rdr.hasNext()) {
switch (rdr.next()) {
case XMLStreamReader.START_ELEMENT:
String tagName = rdr.getName().getLocalPart();
if (SynchronizationConstants.ENTITIES_EXPORT_ELEMENT.equals(tagName)) {
try {
String synchronizer = rdr.getAttributeValue(null, SynchronizationConstants.ID_ATTRIBUTE);
String notes = importSingle(subject, importerConfigs, rdr);
if (notes != null) {
report.getImporterNotes().put(synchronizer, notes);
}
} catch (Exception e) {
//fail fast on the import errors... This runs in a single transaction
//so all imports done so far will get rolled-back.
//(Even if we change our minds later and run a transaction per importer