use of org.apache.camel.component.bonita.api.filter.JsonClientFilter in project camel by apache.
the class BonitaAPIUtil method getInstance.
public static BonitaAPIUtil getInstance(BonitaAPIConfig bonitaAPIConfig) {
if (instance == null) {
instance = new BonitaAPIUtil();
ClientConfig clientConfig = new ClientConfig();
clientConfig.register(MultiPartFeature.class);
clientConfig.register(JacksonJsonProvider.class);
Logger logger = Logger.getLogger("org.bonitasoft.camel.bonita.api.util.BonitaAPIUtil");
Feature feature = new LoggingFeature(logger, Level.INFO, null, null);
clientConfig.register(feature);
ClientBuilder clientBuilder = ClientBuilder.newBuilder().withConfig(clientConfig);
Client client = clientBuilder.build();
client.register(new JsonClientFilter());
client.register(new BonitaAuthFilter(bonitaAPIConfig));
instance.setWebTarget(client.target(bonitaAPIConfig.getBaseBonitaURI()));
}
return instance;
}
Aggregations