public void store(String path, ErrorHandler filter) throws XMLStreamException, ParserConfigurationException { LOG.debug("store {}", path); InputStream is = IntegrationTest.class.getResourceAsStream(path); StorageHandler handler = persistenceHandlerFactory.create(STORE, store, notifier); Storage.openStage(nodeRepository, nodeService, config, handler, filter, logger); try { marshaller.unmarshal(new StreamSource(is)); } finally { Storage.closeStage(); } }
public void remove(String path, ErrorHandler filter) throws XMLStreamException, ParserConfigurationException { LOG.debug("remove {}", path); InputStream is = IntegrationTest.class.getResourceAsStream(path); StorageHandler handler = persistenceHandlerFactory.create(REMOVE, remove, notifier); Storage.openStage( nodeRepository, nodeService, config, handler, filter == null ? ErrorHandler.FILTER_MISSING : filter, logger ); try { nodeRepository.setFlushMode(FlushModeType.COMMIT); marshaller.unmarshal(new StreamSource(is)); } finally { Storage.closeStage(); } }