})
.map(new Func1<ClusterConfig, OpenBucketResponse>() {
@Override
public OpenBucketResponse call(final ClusterConfig clusterConfig) {
if (clusterConfig.hasBucket(request.bucket())) {
return new OpenBucketResponse(ResponseStatus.SUCCESS);
}
throw new CouchbaseException("Could not open bucket.");
}
})
.subscribe(request.observable());