Package com.basho.riak.client.http.response

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


     */
    public StoreResponse store(RiakClient riak, RequestMeta meta) {
        if (riak == null)
            throw new IllegalStateException("Cannot store an object without a RiakClient");

        StoreResponse r = riak.store(this, meta);
        if (r.isSuccess()) {
            this.updateMeta(r);
        }
        return r;
    }
View Full Code Here


        }
        RiakResponse response = RiakResponse.empty();

        com.basho.riak.client.http.RiakObject riakObject = convert(object, client);
        RequestMeta requestMeta = convert(storeMeta);
        StoreResponse resp = client.store(riakObject, requestMeta);

        if (!resp.isSuccess()) {
            if (resp.getStatusCode() == HttpStatus.SC_PRECONDITION_FAILED) {
                if (storeMeta.hasIfNoneMatch() && storeMeta.getIfNoneMatch()) {
                    throw new MatchFoundException();
                } else if (storeMeta.hasIfNotModified() && storeMeta.getIfNotModified()) {
                    throw new ModifiedException();
                }
            }
            throw new IOException(resp.getStatusCode() + " " + resp.getBodyAsString());
        }

        if (storeMeta.hasReturnBody() && storeMeta.getReturnBody()) {
            response = handleBodyResponse(resp);
        } else if(storeMeta.hasReturnHead() && storeMeta.getReturnHead()) {
View Full Code Here

TOP

Related Classes of com.basho.riak.client.http.response.StoreResponse

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.