@Override protected Set<Application> loadAll() throws ProviderException { try { Map<String, Application> appByName = front50Service .getAllApplicationPermissions() .stream() .collect(Collectors.toMap(Application::getName, Function.identity())); clouddriverService .getApplications() .stream() .filter(app -> !appByName.containsKey(app.getName())) .forEach(app -> appByName.put(app.getName(), app)); if (allowAccessToUnknownApplications) { // no need to include applications w/o explicit permissions if we're allowing access to unknown applications by default return appByName .values() .stream() .filter(a -> !a.getPermissions().isEmpty()) .collect(Collectors.toSet()); } return new HashSet<>(appByName.values()); } catch (Exception e) { throw new ProviderException(this.getClass(), e.getCause()); } }
@Override protected Set<Application> loadAll() throws ProviderException { try { Map<String, Application> appByName = front50Service .getAllApplicationPermissions() .stream() .collect(Collectors.toMap(Application::getName, Function.identity())); clouddriverService .getApplications() .stream() .filter(app -> !appByName.containsKey(app.getName())) .forEach(app -> appByName.put(app.getName(), app)); if (allowAccessToUnknownApplications) { // no need to include applications w/o explicit permissions if we're allowing access to unknown applications by default return appByName .values() .stream() .filter(a -> !a.getPermissions().isEmpty()) .collect(Collectors.toSet()); } return new HashSet<>(appByName.values()); } catch (Exception e) { throw new ProviderException(this.getClass(), e.getCause()); } }