Examples of RiakResponseRuntimeException


Examples of com.basho.riak.client.http.response.RiakResponseRuntimeException

        HttpResponse r = helper.getBucketSchema(bucket, meta);
        try {
            return getBucketResponse(r);
        } catch (JSONException e) {
            try {
                return new BucketResponse(helper.toss(new RiakResponseRuntimeException(r, e)));
            } catch (Exception e1) {
                throw new IllegalStateException(
                                                "helper.toss() returns a unsuccessful result, so BucketResponse shouldn't try to parse it or throw");
            }
        } catch (IOException e) {
View Full Code Here

Examples of com.basho.riak.client.http.response.RiakResponseRuntimeException

        HttpResponse r = helper.listBucket(bucket, meta, streamResponse);
        try {
            return getBucketResponse(r);
        } catch (JSONException e) {
            try {
                return new BucketResponse(helper.toss(new RiakResponseRuntimeException(r, e)));
            } catch (Exception e1) {
                throw new IllegalStateException(
                                                "helper.toss() returns a unsuccessful result, so BucketResponse shouldn't try to parse it or throw");
            }
        } catch (IOException e) {
View Full Code Here

Examples of com.basho.riak.client.http.response.RiakResponseRuntimeException

    public MapReduceResponse mapReduce(String job, RequestMeta meta) {
        HttpResponse r = helper.mapReduce(job, meta);
        try {
            return getMapReduceResponse(r);
        } catch (JSONException e) {
            helper.toss(new RiakResponseRuntimeException(r, e));
            return null;
        }
    }
View Full Code Here

Examples of com.basho.riak.client.http.response.RiakResponseRuntimeException

        HttpResponse r = helper.listBuckets();
        try {
            return new ListBucketsResponse(r);
        } catch (JSONException e) {
            try {
                return new ListBucketsResponse(helper.toss(new RiakResponseRuntimeException(r, e)));
            } catch (Exception e1) {
                throw new IllegalStateException(
                                                "helper.toss() returns a unsuccessful result, so BucketResponse shouldn't try to parse it or throw");
            }
        } catch (IOException e) {
View Full Code Here

Examples of com.basho.riak.client.http.response.RiakResponseRuntimeException

    private IndexResponse makeIndexResponse(HttpResponse r) {
        try {
            return new IndexResponse(r);
        } catch (JSONException e) {
            try {
                return new IndexResponse(helper.toss(new RiakResponseRuntimeException(r, e)));
            } catch (Exception e1) {
                throw new IllegalStateException(
                                                "helper.toss() returns a unsuccessful result, so BucketResponse shouldn't try to parse it or throw");
            }
        }
View Full Code Here

Examples of com.basho.riak.client.http.response.RiakResponseRuntimeException

    public void setBucketSchema(String bucket, RiakBucketInfo bucketInfo, RequestMeta meta) throws RiakIOException,
            RiakResponseException {
        HttpResponse r = impl.setBucketSchema(bucket, bucketInfo, meta);

        if (r.getStatusCode() != 204)
            throw new RiakResponseException(new RiakResponseRuntimeException(r, r.getBodyAsString()));
    }
View Full Code Here

Examples of com.basho.riak.client.http.response.RiakResponseRuntimeException

     */
    public RiakBucketInfo listBucket(String bucket, RequestMeta meta) throws RiakIOException, RiakResponseException {
        BucketResponse r = impl.listBucket(bucket, meta);

        if (r.getStatusCode() != 200)
            throw new RiakResponseException(new RiakResponseRuntimeException(r, r.getBodyAsString()));

        return r.getBucketInfo();
    }
View Full Code Here

Examples of com.basho.riak.client.http.response.RiakResponseRuntimeException

     */
    public void store(RiakObject object, RequestMeta meta) throws RiakIOException, RiakResponseException {
        StoreResponse r = impl.store(object, meta);

        if (r.getStatusCode() != 200 && r.getStatusCode() != 204)
            throw new RiakResponseException(new RiakResponseRuntimeException(r, r.getBodyAsString()));

        object.updateMeta(r);
    }
View Full Code Here

Examples of com.basho.riak.client.http.response.RiakResponseRuntimeException

        if (r.getStatusCode() == 404)
            return null;

        if (r.getStatusCode() != 200 && r.getStatusCode() != 304)
            throw new RiakResponseException(new RiakResponseRuntimeException(r, r.getBodyAsString()));

        if (r.getStatusCode() == 200 && !r.hasObject())
            throw new RiakResponseException(new RiakResponseRuntimeException(r, "Failed to parse metadata"));

        return r.getObject();
    }
View Full Code Here

Examples of com.basho.riak.client.http.response.RiakResponseRuntimeException

        if (r.getStatusCode() == 404)
            return null;

        if (r.getStatusCode() != 200 && r.getStatusCode() != 304)
            throw new RiakResponseException(new RiakResponseRuntimeException(r, r.getBodyAsString()));

        if (r.getStatusCode() == 200 && !r.hasObject())
            throw new RiakResponseException(new RiakResponseRuntimeException(r, "Failed to parse object"));

        return r.getObject();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.