Package com.basho.riak.client.query.indexes

Examples of com.basho.riak.client.query.indexes.RiakIndexes


        rob.vclock = o.getVClock();
        rob.contentType = o.getContentType();
        rob.lastModified = o.getLastModified();
        rob.value = o.getValue();
        rob.links = o.getLinks();
        rob.indexes = new RiakIndexes(o.allBinIndexes(), o.allIntIndexes());
        rob.userMeta = o.getMeta();
        return rob;
    }
View Full Code Here


                throw new NoKeySpecifedException(domainObject);
            }
           
            final byte[] value = objectMapper.writeValueAsBytes(domainObject);
            Map<String, String> usermetaData = usermetaConverter.getUsermetaData(domainObject);
            RiakIndexes indexes = riakIndexConverter.getIndexes(domainObject);
            Collection<RiakLink> links = riakLinksConverter.getLinks(domainObject);
            return RiakObjectBuilder.newBuilder(bucket, key)
                .withValue(value)
                .withVClock(vclock)
                .withUsermeta(usermetaData)
View Full Code Here

            try {
                T domainObject = objectMapper.readValue(json, clazz);
                KeyUtil.setKey(domainObject, riakObject.getKey());
                VClockUtil.setVClock(domainObject, riakObject.getVClock());
                usermetaConverter.populateUsermeta(riakObject.getMeta(), domainObject);
                riakIndexConverter.populateIndexes(new RiakIndexes(riakObject.allBinIndexes(), riakObject.allIntIndexesV2()),
                                                   domainObject);
                riakLinksConverter.populateLinks(riakObject.getLinks(), domainObject);
                return domainObject;
            } catch (JsonProcessingException e) {
                throw new ConversionException(e);
View Full Code Here

        rob.vclock = o.getVClock();
        rob.contentType = o.getContentType();
        rob.lastModified = o.getLastModified();
        rob.value = o.getValue();
        rob.links = o.getLinks();
        rob.indexes = new RiakIndexes(o.allBinIndexes(), o.allIntIndexes());
        rob.userMeta = o.getMeta();
        return rob;
    }
View Full Code Here

                throw new NoKeySpecifedException(domainObject);
            }

            final byte[] value = objectMapper.writeValueAsBytes(domainObject);
            Map<String, String> usermetaData = usermetaConverter.getUsermetaData(domainObject);
            RiakIndexes indexes = riakIndexConverter.getIndexes(domainObject);
            Collection<RiakLink> links = riakLinksConverter.getLinks(domainObject);
            return RiakObjectBuilder.newBuilder(bucket, key)
                .withValue(value)
                .withVClock(vclock)
                .withUsermeta(usermetaData)
View Full Code Here

        try {
            T domainObject = objectMapper.readValue(json, clazz);
            KeyUtil.setKey(domainObject, riakObject.getKey());
            usermetaConverter.populateUsermeta(riakObject.getMeta(), domainObject);
            riakIndexConverter.populateIndexes(new RiakIndexes(riakObject.allBinIndexes(), riakObject.allIntIndexes()),
                                               domainObject);
            riakLinksConverter.populateLinks(riakObject.getLinks(), domainObject);
            return domainObject;
        } catch (JsonProcessingException e) {
            throw new ConversionException(e);
View Full Code Here

    /**
     * @return a {@link RiakIndexes} made of the values of the RiakIndex
     *         annotated fields
     */
    public <T> RiakIndexes getIndexes(T obj) {
        final RiakIndexes riakIndexes = new RiakIndexes();

        for (RiakIndexField f : indexFields) {
            Object val = getFieldValue(f.getField(), obj);
            // null is not an index value
            if (val != null) {
                if (val instanceof String) {
                    riakIndexes.add(f.getIndexName(), (String) val);
                } else {
                    riakIndexes.add(f.getIndexName(), (Integer) val);
                }
            }
        }

        return riakIndexes;
View Full Code Here

        try {
            String key = getKey(domainObject, this.defaultKey);
           
            final byte[] value = OBJECT_MAPPER.writeValueAsBytes(domainObject);
            Map<String, String> usermetaData = usermetaConverter.getUsermetaData(domainObject);
            RiakIndexes indexes = riakIndexConverter.getIndexes(domainObject);
            Collection<RiakLink> links = riakLinksConverter.getLinks(domainObject);
            return RiakObjectBuilder.newBuilder(bucket, key)
                .withValue(value)
                .withVClock(vclock)
                .withUsermeta(usermetaData)
View Full Code Here

            try {
                final T domainObject = OBJECT_MAPPER.readValue(riakObject.getValue(), clazz);
                KeyUtil.setKey(domainObject, riakObject.getKey());
                VClockUtil.setVClock(domainObject, riakObject.getVClock());
                usermetaConverter.populateUsermeta(riakObject.getMeta(), domainObject);
                riakIndexConverter.populateIndexes(new RiakIndexes(riakObject.allBinIndexes(), riakObject.allIntIndexesV2()), domainObject);
                riakLinksConverter.populateLinks(riakObject.getLinks(), domainObject);
                return domainObject;
            } catch (JsonProcessingException e) {
                throw new ConversionException(e);
            } catch (IOException e) {
View Full Code Here

        rob.vclock = o.getVClock();
        rob.contentType = o.getContentType();
        rob.lastModified = o.getLastModified();
        rob.value = o.getValue();
        rob.links = o.getLinks();
        rob.indexes = new RiakIndexes(o.allBinIndexes(), o.allIntIndexesV2());
        rob.userMeta = o.getMeta();
        rob.isDeleted = o.isDeleted();
        return rob;
    }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.query.indexes.RiakIndexes

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.