public AppRegistry(UriRegistry uriRegistry, ResourceLoader resourceLoader, EavRegistryRepository eavRegistryRepository) { this.uriRegistry = uriRegistry; this.uriRegistryPopulator = new UriRegistryPopulator(); this.uriRegistryPopulator.setResourceLoader(resourceLoader); this.resourceLoader = resourceLoader; this.eavRegistryRepository = eavRegistryRepository; }
public List<AppRegistration> importAll(boolean overwrite, String... resourceUris) { List<AppRegistration> apps = new ArrayList<>(); for (String uri : resourceUris) { try { Map<String, URI> registered = this.uriRegistryPopulator.populateRegistry( overwrite, this.uriRegistry, uri); for (Map.Entry<String, URI> entry : registered.entrySet()) { apps.add(createAppRegistration(entry.getKey(), entry.getValue())); } } catch (Exception e) { throw new IllegalStateException("Error when registering applications from " + uri + ": " + e.getMessage(), e); } } return apps; }