Package com.couchbase.client.java.error

Examples of com.couchbase.client.java.error.TranscodingException


                                .password(bucket.getString("saslPassword"))
                                .build());
                        }
                        return Observable.from(settings);
                    } catch (Exception e) {
                        throw new TranscodingException("Could not decode cluster info.", e);
                    }
                }
            });
    }
View Full Code Here


            decoded = val.equals("true");
        } else if (flags == 1 << 8) {
            char val = content.getChar(0);
            decoded = val == '1';
        } else {
            throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non " +
                "JsonBooleanDocument id " + id + ", could not decode.");
        }
        return newDocument(id, expiry, decoded, cas);
    }
View Full Code Here

    @Override
    protected SerializableDocument doDecode(String id, ByteBuf content, long cas, int expiry, int flags,
        ResponseStatus status) throws Exception {
        if (!TranscoderUtils.hasSerializableFlags(flags)) {
            throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non-serialized " +
                "document for id " + id + ", could not decode.");
        }

        Serializable deserialized = TranscoderUtils.deserialize(content);
        return newDocument(id, expiry, deserialized, cas);
View Full Code Here

    @Override
    protected JsonArrayDocument doDecode(String id, ByteBuf content, long cas, int expiry, int flags, ResponseStatus status)
        throws Exception {
        if (!TranscoderUtils.hasJsonFlags(flags)) {
            throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non-JSON array document for "
                + "id " + id + ", could not decode.");
        }

        JsonArray converted = stringToJsonArray(content.toString(CharsetUtil.UTF_8));
        content.release();
View Full Code Here

                byte b = content.readByte();
                rv = (rv << 8) | (b < 0 ? 256 + b : b);
            }
            decoded = rv;
        } else {
            throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non " +
                "JsonLongDocument id " + id + ", could not decode.");
        }

        return newDocument(id, expiry, decoded, cas);
    }
View Full Code Here

                decoded = Float.intBitsToFloat((int) rv);
            } else {
                decoded = Double.longBitsToDouble(rv);
            }
        } else {
            throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non " +
                "JsonDoubleDocument id " + id + ", could not decode.");
        }

        return newDocument(id, expiry, decoded, cas);
    }
View Full Code Here

    @Override
    protected BinaryDocument doDecode(String id, ByteBuf content, long cas, int expiry, int flags,
        ResponseStatus status) throws Exception {
        if (!TranscoderUtils.hasBinaryFlags(flags)) {
            throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non-binary " +
                "document for id " + id + ", could not decode.");
        }
        return BinaryDocument.create(id, expiry, content, cas);
    }
View Full Code Here

            }

            try {
                return TRANSCODER.byteBufToJsonObject(byteBuf);
            } catch (Exception e) {
                throw new TranscodingException("Could not decode View JSON.", e);
            }
        }
View Full Code Here

    @Override
    protected RawJsonDocument doDecode(String id, ByteBuf content, long cas, int expiry, int flags,
        ResponseStatus status) throws Exception {
        if (!TranscoderUtils.hasJsonFlags(flags)) {
            throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non-JSON document for "
                + "id " + id + ", could not decode.");
        }

        String converted = content.toString(CharsetUtil.UTF_8);
        return newDocument(id, expiry, converted, cas);
View Full Code Here

    @Override
    protected JsonArrayDocument doDecode(String id, ByteBuf content, long cas, int expiry, int flags, ResponseStatus status)
        throws Exception {
        if (!TranscoderUtils.hasJsonFlags(flags)) {
            throw new TranscodingException("Flags (0x" + Integer.toHexString(flags) + ") indicate non-JSON array document for "
                + "id " + id + ", could not decode.");
        }

        JsonArray converted = stringToJsonArray(content.toString(CharsetUtil.UTF_8));
        return newDocument(id, expiry, converted, cas);
View Full Code Here

TOP

Related Classes of com.couchbase.client.java.error.TranscodingException

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.