use of org.apache.nifi.registry.flow.FlowRegistry in project nifi by apache.
the class FlowRegistryDAO method getFlowsForUser.
@Override
public Set<VersionedFlow> getFlowsForUser(String registryId, String bucketId, 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<VersionedFlow> flows = flowRegistry.getFlows(bucketId, user);
final Set<VersionedFlow> sortedFlows = new TreeSet<>((f1, f2) -> f1.getName().compareTo(f2.getName()));
sortedFlows.addAll(flows);
return sortedFlows;
} catch (final IOException | NiFiRegistryException ioe) {
throw new NiFiCoreException("Unable to obtain listing of flows for bucket with ID " + bucketId + ": " + ioe, ioe);
}
}
Aggregations