use of org.apache.nifi.registry.client.NiFiRegistryClient in project nifi by apache.
the class NiFiCLIMainRunner method main.
public static void main(String[] args) {
final String[] cmdArgs = ("registry list-buckets help " + "").split("[ ]");
final Session session = new InMemorySession();
final ClientFactory<NiFiClient> niFiClientFactory = new NiFiClientFactory();
final ClientFactory<NiFiRegistryClient> nifiRegClientFactory = new NiFiRegistryClientFactory();
final Context context = new StandardContext.Builder().output(System.out).session(session).nifiClientFactory(niFiClientFactory).nifiRegistryClientFactory(nifiRegClientFactory).build();
final Map<String, Command> commands = CommandFactory.createTopLevelCommands(context);
final Map<String, CommandGroup> commandGroups = CommandFactory.createCommandGroups(context);
final CommandProcessor processor = new CommandProcessor(commands, commandGroups, context);
processor.process(cmdArgs);
}
use of org.apache.nifi.registry.client.NiFiRegistryClient in project nifi by apache.
the class RestBasedFlowRegistry method getBucketClient.
private BucketClient getBucketClient(final NiFiUser user) {
final String identity = getIdentity(user);
final NiFiRegistryClient registryClient = getRegistryClient();
final BucketClient bucketClient = identity == null ? registryClient.getBucketClient() : registryClient.getBucketClient(identity);
return bucketClient;
}
use of org.apache.nifi.registry.client.NiFiRegistryClient in project nifi-registry by apache.
the class UnsecuredNiFiRegistryClientIT method setup.
@Before
public void setup() {
final String baseUrl = createBaseURL();
LOGGER.info("Using base url = " + baseUrl);
final NiFiRegistryClientConfig clientConfig = new NiFiRegistryClientConfig.Builder().baseUrl(baseUrl).build();
Assert.assertNotNull(clientConfig);
final NiFiRegistryClient client = new JerseyNiFiRegistryClient.Builder().config(clientConfig).build();
Assert.assertNotNull(client);
this.client = client;
}
use of org.apache.nifi.registry.client.NiFiRegistryClient in project nifi by apache.
the class RestBasedFlowRegistry method getFlowSnapshotClient.
private FlowSnapshotClient getFlowSnapshotClient(final NiFiUser user) {
final String identity = getIdentity(user);
final NiFiRegistryClient registryClient = getRegistryClient();
final FlowSnapshotClient snapshotClient = identity == null ? registryClient.getFlowSnapshotClient() : registryClient.getFlowSnapshotClient(identity);
return snapshotClient;
}
use of org.apache.nifi.registry.client.NiFiRegistryClient in project nifi by apache.
the class RestBasedFlowRegistry method getFlowClient.
private FlowClient getFlowClient(final NiFiUser user) {
final String identity = getIdentity(user);
final NiFiRegistryClient registryClient = getRegistryClient();
final FlowClient flowClient = identity == null ? registryClient.getFlowClient() : registryClient.getFlowClient(identity);
return flowClient;
}
Aggregations