Package com.basho.riak.client.response

Examples of com.basho.riak.client.response.HttpResponse


        if (meta.getQueryParam(Constants.QP_RETURN_BODY) == null) {
            meta.setQueryParam(Constants.QP_RETURN_BODY, "true");
        }

        setAcceptHeader(meta);
        HttpResponse r = helper.store(object, meta);
        return new StoreResponse(new FetchResponse(r, this));
    }
View Full Code Here


        if (meta == null) {
            meta = new RequestMeta();
        }

        setAcceptHeader(meta);
        HttpResponse r = helper.fetch(bucket, key, meta, streamResponse);

        try {
            return getFetchResponse(r);
        } catch (RiakResponseRuntimeException e) {
            return new FetchResponse(helper.toss(e), this);
View Full Code Here

     *             If the Riak server returns a malformed response.
     *
     * @see RiakWalkSpec
     */
    public WalkResponse walk(String bucket, String key, String walkSpec, RequestMeta meta) {
        HttpResponse r = helper.walk(bucket, key, walkSpec, meta);

        try {
            return getWalkResponse(r);
        } catch (RiakResponseRuntimeException e) {
            return new WalkResponse(helper.toss(e), this);
View Full Code Here

     *             If an error occurs during communication with the Riak server.
     * @throws RiakResponseRuntimeException
     *             If the Riak server does not return a valid JSON array.
     */
    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

      public Boolean call ()
      {
        final String key = (String) parameters[0];
        final RequestMeta meta = new RequestMeta ();
        meta.setClientId (RiakRestOperationFactory.this.clientId);
        final HttpResponse res = RiakRestOperationFactory.this.riakcl.delete (RiakRestOperationFactory.this.bucket, key, meta);
        if (res.getStatusCode () == 404) {
          return false;
        }
        return true;
      }
    });
View Full Code Here

     * @throws RiakResponseException
     *             if the server does not successfully update the bucket schema.
     */
    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.getBody()));
    }
View Full Code Here

     *             If an error occurs during communication with the Riak server.
     * @throws RiakResponseException
     *             If the object was not deleted.
     */
    public void delete(String bucket, String key, RequestMeta meta) throws RiakIOException, RiakResponseException {
        HttpResponse r = impl.delete(bucket, key, meta);

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

     * @throws RiakResponseException
     *             if the server does not successfully update the bucket schema.
     */
    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

     *             If an error occurs during communication with the Riak server.
     * @throws RiakResponseException
     *             If the object was not deleted.
     */
    public void delete(String bucket, String key, RequestMeta meta) throws RiakIOException, RiakResponseException {
        HttpResponse r = impl.delete(bucket, key, meta);

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

     *             If an error occurs during communication with the Riak server.
     * @throws RiakResponseRuntimeException
     *             If the Riak server returns a malformed response.
     */
    public BucketResponse getBucketSchema(String bucket, RequestMeta meta) {
        HttpResponse r = helper.getBucketSchema(bucket, meta);
        try {
            return getBucketResponse(r);
        } catch (JSONException e) {
            try {
                return new BucketResponse(helper.toss(new RiakResponseRuntimeException(r, e)));
View Full Code Here

TOP

Related Classes of com.basho.riak.client.response.HttpResponse

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.