use of org.apache.nifi.registry.client.NiFiRegistryClientConfig in project nifi-registry by apache.
the class IntegrationTestBase method createClientFromConfig.
private static Client createClientFromConfig(NiFiRegistryClientConfig registryClientConfig) {
final ClientConfig clientConfig = new ClientConfig();
clientConfig.register(jacksonJaxbJsonProvider());
final ClientBuilder clientBuilder = ClientBuilder.newBuilder().withConfig(clientConfig);
final SSLContext sslContext = registryClientConfig.getSslContext();
if (sslContext != null) {
clientBuilder.sslContext(sslContext);
}
final HostnameVerifier hostnameVerifier = registryClientConfig.getHostnameVerifier();
if (hostnameVerifier != null) {
clientBuilder.hostnameVerifier(hostnameVerifier);
}
return clientBuilder.build();
}
use of org.apache.nifi.registry.client.NiFiRegistryClientConfig 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.NiFiRegistryClientConfig in project nifi by apache.
the class RestBasedFlowRegistry method getRegistryClient.
private synchronized NiFiRegistryClient getRegistryClient() {
if (registryClient != null) {
return registryClient;
}
final NiFiRegistryClientConfig config = new NiFiRegistryClientConfig.Builder().connectTimeout(30000).readTimeout(30000).sslContext(sslContext).baseUrl(url).build();
registryClient = new JerseyNiFiRegistryClient.Builder().config(config).build();
return registryClient;
}
use of org.apache.nifi.registry.client.NiFiRegistryClientConfig in project nifi-registry by apache.
the class SecureNiFiRegistryClientIT method setup.
@Before
public void setup() {
final String baseUrl = createBaseURL();
LOGGER.info("Using base url = " + baseUrl);
final NiFiRegistryClientConfig clientConfig = createClientConfig(baseUrl);
Assert.assertNotNull(clientConfig);
final NiFiRegistryClient client = new JerseyNiFiRegistryClient.Builder().config(clientConfig).build();
Assert.assertNotNull(client);
this.client = client;
}
Aggregations