Package com.basho.riak.client.response

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


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


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

                body = httpMethod.getResponseBody();
            }

            return new DefaultHttpResponse(bucket, key, status, headers, body, stream, httpMethod);
        } catch (IOException e) {
            return toss(new RiakIORuntimeException(e));
        } finally {
            if (!streamResponse) {
                httpMethod.releaseConnection();
            }
        }
View Full Code Here

                                                           originalURI.getHost(),
                                                           originalURI.getPort(),
                                                           originalURI.getPath(),
                                                           URLEncodedUtils.format(newQuery, "UTF-8"), null);
                } catch (URISyntaxException e) {
                    throw new RiakIORuntimeException(e);
                }
                httpMethod.setURI(newURI);
            }
        }
        HttpEntity entity;
        try {
            org.apache.http.HttpResponse response =  httpClient.execute(httpMethod);

            int status = 0;
            if (response.getStatusLine() != null) {
                status = response.getStatusLine().getStatusCode();
            }

            Map<String, String> headers = ClientUtils.asHeaderMap(response.getAllHeaders());
            byte[] body = null;
            InputStream stream = null;
            entity = response.getEntity();

            if (streamResponse) {
                stream = entity.getContent();
            } else {
                if(null != entity) {
                    body = EntityUtils.toByteArray(entity);
                }
            }

            if (!streamResponse) {
                EntityUtils.consume(entity);
            }

            return new DefaultHttpResponse(bucket, key, status, headers, body, stream, response, httpMethod);
        } catch (IOException e) {
            httpMethod.abort();
            return toss(new RiakIORuntimeException(e));
        }
    }
View Full Code Here

            while ((l = valueStream.read(data)) >= 0) {
                tmp.write(data, 0, l);
            }
            return tmp.toByteArray();
        } catch (IOException e) {
            throw new RiakIORuntimeException(e);
        }
    }
View Full Code Here

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

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

    public void close() {
        if (httpResponse != null) {
            try {
                EntityUtils.consume(httpResponse.getEntity());
            } catch (IOException e) {
                throw new RiakIORuntimeException(e);
            }
        }
    }
View Full Code Here

                body = httpMethod.getResponseBodyAsString();
            }

            return new DefaultHttpResponse(bucket, key, status, headers, body, stream, httpMethod);
        } catch (IOException e) {
            return toss(new RiakIORuntimeException(e));
        } finally {
            if (!streamResponse) {
                httpMethod.releaseConnection();
            }
        }
View Full Code Here

                body = httpMethod.getResponseBody();
            }

            return new DefaultHttpResponse(bucket, key, status, headers, body, stream, httpMethod);
        } catch (IOException e) {
            return toss(new RiakIORuntimeException(e));
        } finally {
            if (!streamResponse) {
                httpMethod.releaseConnection();
            }
        }
View Full Code Here

TOP

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

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.