/** * This is the constructor to use if you wish to import all messages transactionally. * <br> * Pass in a session which doesn't use auto-commit for sends, and one that does (for management * operations necessary during import). * * @param inputStream the stream from which to read the XML for import * @param session used for sending messages, doesn't need to auto-commit sends * @param managementSession used for management queries, must use auto-commit for sends */ public void process(InputStream inputStream, ClientSession session, ClientSession managementSession) throws Exception { reader = XMLInputFactory.newInstance().createXMLStreamReader(inputStream); messageReader = new XMLMessageImporter(reader, session); messageReader.setOldPrefixTranslation(oldPrefixTranslation); this.session = session; if (managementSession != null) { this.managementSession = managementSession; } else { this.managementSession = session; } processXml(); }
/** * This is the constructor to use if you wish to import all messages transactionally. * <br> * Pass in a session which doesn't use auto-commit for sends, and one that does (for management * operations necessary during import). * * @param inputStream the stream from which to read the XML for import * @param session used for sending messages, doesn't need to auto-commit sends * @param managementSession used for management queries, must use auto-commit for sends */ public void process(InputStream inputStream, ClientSession session, ClientSession managementSession) throws Exception { reader = XMLInputFactory.newInstance().createXMLStreamReader(inputStream); messageReader = new XMLMessageImporter(reader, session); messageReader.setOldPrefixTranslation(oldPrefixTranslation); this.session = session; if (managementSession != null) { this.managementSession = managementSession; } else { this.managementSession = session; } processXml(); }