@Override
public void init(CouchSetup couchSetup) {
try {
// Build the client
ClientBuilder clientBuilder = ClientBuilder.newBuilder();
if (couchSetup.getSslSetup() != null) {
// Using SSL set assign context.
clientBuilder.sslContext(couchSetup.getSslSetup().getSSLContext());
}
client = clientBuilder.build();
// If we have authentication set the auth filter.
if (couchSetup.getUserName() != null) {
HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic(couchSetup.getUserName(), couchSetup.getPassword());
client.register(feature);