Package com.couchbase.client.core.message.config

Examples of com.couchbase.client.core.message.config.BucketConfigRequest


    private long counter = 0;

    @Override
    public Node[] locate(final CouchbaseRequest request, final Set<Node> nodes, final ClusterConfig config) {
        if (request instanceof BucketConfigRequest) {
            BucketConfigRequest req = (BucketConfigRequest) request;
            InetAddress hostname = req.hostname();
            for (Node node : nodes) {
                if (hostname == null || node.hostname().equals(hostname)) {
                    return new Node[]{node};
                }
            }
View Full Code Here


            LOGGER.info("HTTP Bootstrap manually disabled.");
            return Observable.error(new ConfigurationException("HTTP Bootstrap disabled through configuration."));
        }

        return cluster()
            .<BucketConfigResponse>send(new BucketConfigRequest(TERSE_PATH, hostname, bucket, password))
            .flatMap(new Func1<BucketConfigResponse, Observable<BucketConfigResponse>>() {
                @Override
                public Observable<BucketConfigResponse> call(BucketConfigResponse response) {
                    if (response.status().isSuccess()) {
                        LOGGER.debug("Successfully got config from terse bucket remote.");
                        return Observable.just(response);
                    }

                    LOGGER.debug("Terse bucket config failed, falling back to verbose.");
                    return cluster().send(new BucketConfigRequest(VERBOSE_PATH, hostname, bucket, password));
                }
            }).map(new Func1<BucketConfigResponse, String>() {
                @Override
                public String call(BucketConfigResponse response) {
                    if (!response.status().isSuccess()) {
View Full Code Here

TOP

Related Classes of com.couchbase.client.core.message.config.BucketConfigRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.