@Override public Set<Bucket> getBucketsForUser(final String registryId, final NiFiUser user) { try { final FlowRegistry flowRegistry = flowRegistryClient.getFlowRegistry(registryId); if (flowRegistry == null) { throw new IllegalArgumentException("The specified registry id is unknown to this NiFi."); } final Set<Bucket> buckets = flowRegistry.getBuckets(user); final Set<Bucket> sortedBuckets = new TreeSet<>((b1, b2) -> b1.getName().compareTo(b2.getName())); sortedBuckets.addAll(buckets); return sortedBuckets; } catch (final IOException | NiFiRegistryException ioe) { throw new NiFiCoreException("Unable to obtain listing of buckets: " + ioe, ioe); } }