Examples of RiakIORuntimeException


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

            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

Examples of com.basho.riak.client.http.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

Examples of com.basho.riak.client.http.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

Examples of com.basho.riak.client.http.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 ListBucketsResponse(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

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

                                                           originalURI.getPort(),
                                                           originalURI.getRawPath(),
                                                           URLEncodedUtils.format(newQuery, "UTF-8"), null);
                } catch (URISyntaxException e) {
                    e.printStackTrace();
                    throw new RiakIORuntimeException(e);
                }
                httpMethod.setURI(newURI);
            }
        }
        HttpEntity entity = null;
        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);
                }
            }

            return new DefaultHttpResponse(bucket, key, status, headers, body, stream, response, httpMethod);
        } catch (IOException e) {
            httpMethod.abort();
            return toss(new RiakIORuntimeException(e));
        } finally {
            if(!streamResponse && entity != null) {
                try {
                    EntityUtils.consume(entity);
                } catch (IOException e) {
View Full Code Here

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

            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

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

                    newURI = new URIBuilder(originalURI)
                                 .setQuery(URLEncodedUtils.format(newQuery, "UTF-8"))
                                 .build();
                } catch (URISyntaxException e) {
                    e.printStackTrace();
                    throw new RiakIORuntimeException(e);
                }
                httpMethod.setURI(newURI);
            }
        }
        HttpEntity entity = null;
        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);
                }
            }

            key = extractKeyFromResponseIfItWasNotAlreadyProvided(key, response);

            return new DefaultHttpResponse(bucket, key, status, headers, body, stream, response, httpMethod);
        } catch (IOException e) {
            httpMethod.abort();
            return toss(new RiakIORuntimeException(e));
        } finally {
            if(!streamResponse && entity != null) {
                try {
                    EntityUtils.consume(entity);
                } catch (IOException e) {
View Full Code Here

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

            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

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

                                                           originalURI.getPort(),
                                                           originalURI.getRawPath(),
                                                           URLEncodedUtils.format(newQuery, "UTF-8"), null);
                } catch (URISyntaxException e) {
                    e.printStackTrace();
                    throw new RiakIORuntimeException(e);
                }
                httpMethod.setURI(newURI);
            }
        }
        HttpEntity entity = null;
        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);
                }
            }

            key = extractKeyFromResponseIfItWasNotAlreadyProvided(key, response);

            return new DefaultHttpResponse(bucket, key, status, headers, body, stream, response, httpMethod);
        } catch (IOException e) {
            httpMethod.abort();
            return toss(new RiakIORuntimeException(e));
        } finally {
            if(!streamResponse && entity != null) {
                try {
                    EntityUtils.consume(entity);
                } catch (IOException e) {
View Full Code Here

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

            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
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.