Examples of RequestMeta


Examples of com.basho.riak.client.request.RequestMeta

    /**
     * Same as {@link RiakClient}, except only returning the HTTP response
     */
    public boolean stream(String bucket, String key, StreamHandler handler, RequestMeta meta) throws IOException {
        if (meta == null) {
            meta = new RequestMeta();
        }
        if (meta.getQueryParam(Constants.QP_R) == null) {
            meta.setQueryParam(Constants.QP_R, Constants.DEFAULT_R.toString());
        }
        HttpGet get = new HttpGet(ClientUtils.makeURI(config, bucket, key));
View Full Code Here

Examples of com.basho.riak.client.request.RequestMeta

    /**
     * Same as {@link RiakClient}, except only returning the HTTP response
     */
    public HttpResponse delete(String bucket, String key, RequestMeta meta) {
        if (meta == null) {
            meta = new RequestMeta();
        }
        String url = ClientUtils.makeURI(config, bucket, key);
        HttpDelete delete = new HttpDelete(url);
        return executeMethod(bucket, key, delete, meta);
    }
View Full Code Here

Examples of com.basho.riak.client.request.RequestMeta

     * @throws RiakResponseRuntimeException
     *             If the Riak server returns a malformed response.
     */
    public StoreResponse store(RiakObject object, RequestMeta meta) {
        if (meta == null) {
            meta = new RequestMeta();
        }
        if (meta.getQueryParam(Constants.QP_RETURN_BODY) == null) {
            meta.setQueryParam(Constants.QP_RETURN_BODY, "true");
        }

View Full Code Here

Examples of com.basho.riak.client.request.RequestMeta

        return fetch(bucket, key, null, true);
    }

    FetchResponse fetch(String bucket, String key, RequestMeta meta, boolean streamResponse) {
        if (meta == null) {
            meta = new RequestMeta();
        }

        setAcceptHeader(meta);
        HttpResponse r = helper.fetch(bucket, key, meta, streamResponse);
View Full Code Here

Examples of com.basho.riak.pbc.RequestMeta

            throw new IllegalStateException("Cannot perform map reduce without a RiakClient");
        return riak.mapReduce(ByteString.copyFromUtf8( toJSON().toString() ), meta);
    }

    public MapReduceResponseSource submit() throws JSONException, IOException {
        return submit(new RequestMeta().contentType("application/json"));
    }
View Full Code Here

Examples of com.basho.riak.pbc.RequestMeta

     * @see
     * com.basho.riak.client.raw.RawClient#mapReduce(com.basho.riak.client.query
     * .MapReduceSpec)
     */
    public MapReduceResult mapReduce(MapReduceSpec spec) throws IOException, MapReduceTimeoutException {
        IRequestMeta meta = new RequestMeta();
        meta.contentType(Constants.CTYPE_JSON);
        MapReduceResponseSource resp = client.mapReduce(spec.getJSON(), meta);
        return convert(resp);
    }
View Full Code Here

Examples of com.basho.riak.pbc.RequestMeta

     * @param storeMeta
     *            a {@link StoreMeta} for the store operation.
     * @return a {@link RequestMeta} populated from the storeMeta's values.
     */
    static RequestMeta convert(StoreMeta storeMeta, IRiakObject riakObject) {
        RequestMeta requestMeta = new RequestMeta();
        if (storeMeta.hasW()) {
            requestMeta.w(storeMeta.getW());
        }
        if (storeMeta.hasDw()) {
            requestMeta.dw(storeMeta.getDw());
        }
        if (storeMeta.hasReturnBody()) {
            requestMeta.returnBody(storeMeta.getReturnBody());
        }

        String contentType = riakObject.getContentType();
        if (contentType != null) {
            requestMeta.contentType(contentType);
        }

        if (storeMeta.hasPw()) {
            requestMeta.pw(storeMeta.getPw());
        }

        if (storeMeta.hasIfNonMatch()) {
            requestMeta.ifNonMatch(storeMeta.getIfNonMatch());
        }

        if (storeMeta.hasIfNotModified()) {
            requestMeta.ifNotModified(storeMeta.getIfNotModified());
        }

        return requestMeta;
    }
View Full Code Here

Examples of com.basho.riak.pbc.RequestMeta

     * @param storeMeta
     *            a {@link StoreMeta} for the store operation.
     * @return a {@link RequestMeta} populated from the storeMeta's values.
     */
    static RequestMeta convert(StoreMeta storeMeta, IRiakObject riakObject) {
        RequestMeta requestMeta = new RequestMeta();
        if (storeMeta.hasW()) {
            requestMeta.w(storeMeta.getW().getIntValue());
        }

        if (storeMeta.hasDw()) {
            requestMeta.dw(storeMeta.getDw().getIntValue());
        }

        if (storeMeta.hasReturnBody()) {
            requestMeta.returnBody(storeMeta.getReturnBody());
        }

        if (storeMeta.hasReturnHead()) {
            requestMeta.returnHead(storeMeta.getReturnHead());
        }

        String contentType = riakObject.getContentType();
        if (contentType != null) {
            requestMeta.contentType(contentType);
        }

        if (storeMeta.hasPw()) {
            requestMeta.pw( storeMeta.getPw().getIntValue());
        }

        if (storeMeta.hasIfNoneMatch()) {
            requestMeta.ifNoneMatch(storeMeta.getIfNoneMatch());
        }

        if (storeMeta.hasIfNotModified()) {
            requestMeta.ifNotModified(storeMeta.getIfNotModified());
        }

        return requestMeta;
    }
View Full Code Here

Examples of com.basho.riak.pbc.RequestMeta

     * @param storeMeta
     *            a {@link StoreMeta} for the store operation.
     * @return a {@link RequestMeta} populated from the storeMeta's values.
     */
    static RequestMeta convert(StoreMeta storeMeta, IRiakObject riakObject) {
        RequestMeta requestMeta = new RequestMeta();
        if (storeMeta.hasW()) {
            requestMeta.w(storeMeta.getW());
        }

        if (storeMeta.hasDw()) {
            requestMeta.dw(storeMeta.getDw());
        }

        if (storeMeta.hasReturnBody()) {
            requestMeta.returnBody(storeMeta.getReturnBody());
        }

        if (storeMeta.hasReturnHead()) {
            requestMeta.returnHead(storeMeta.getReturnHead());
        }

        String contentType = riakObject.getContentType();
        if (contentType != null) {
            requestMeta.contentType(contentType);
        }

        if (storeMeta.hasPw()) {
            requestMeta.pw(storeMeta.getPw());
        }

        if (storeMeta.hasIfNoneMatch()) {
            requestMeta.ifNoneMatch(storeMeta.getIfNoneMatch());
        }

        if (storeMeta.hasIfNotModified()) {
            requestMeta.ifNotModified(storeMeta.getIfNotModified());
        }

        return requestMeta;
    }
View Full Code Here

Examples of com.basho.riak.pbc.RequestMeta

            throw new IllegalStateException("Cannot perform map reduce without a RiakClient");
        return riak.mapReduce(ByteString.copyFromUtf8( toJSON().toString() ), meta);
    }

    public MapReduceResponseSource submit() throws JSONException, IOException {
        return submit(new RequestMeta().contentType("application/json"));
    }
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.