Examples of RiakLink


Examples of com.basho.riak.client.RiakLink

     * @param link
     *            the {@link com.basho.riak.client.http.RiakLink} to convert
     * @return a {@link RiakLink} with the same bucket/key/tag values
     */
    static RiakLink convert(com.basho.riak.client.http.RiakLink link) {
        return new RiakLink(link.getBucket(), link.getKey(), link.getTag());
    }
View Full Code Here

Examples of com.basho.riak.client.RiakLink

     */
    public static List<RiakLink> parseLinkHeader(String header) {
        List<RiakLink> links = new ArrayList<RiakLink>();
        Map<String, Map<String, String>> parsedLinks = LinkHeader.parse(header);
        for (String url : parsedLinks.keySet()) {
            RiakLink link = parseOneLink(url, parsedLinks.get(url));
            if (link != null) {
                links.add(link);
            }
        }
        return links;
View Full Code Here

Examples of com.basho.riak.client.RiakLink

    private static RiakLink parseOneLink(String url, Map<String, String> params) {
        String tag = params.get(Constants.LINK_TAG);
        if (tag != null) {
            String[] parts = url.split("/");
            if (parts.length >= 2)
                return new RiakLink(parts[parts.length - 2], parts[parts.length - 1], tag);
        }
        return null;
    }
View Full Code Here

Examples of com.basho.riak.client.RiakLink

    /**
     * @param link
     * @return
     */
    private static RiakLink convert(com.basho.riak.pbc.RiakLink link) {
        return new RiakLink(nullSafeToStringUtf8(link.getBucket()), nullSafeToStringUtf8(link.getKey()),
                            nullSafeToStringUtf8(link.getTag()));
    }
View Full Code Here

Examples of com.basho.riak.client.RiakLink

     * @param link
     *            the {@link com.basho.riak.client.http.RiakLink} to convert
     * @return a {@link RiakLink} with the same bucket/key/tag values
     */
    static RiakLink convert(com.basho.riak.client.http.RiakLink link) {
        return new RiakLink(link.getBucket(), link.getKey(), link.getTag());
    }
View Full Code Here

Examples of com.basho.riak.client.RiakLink

     */
    public static List<RiakLink> parseLinkHeader(String header) {
        List<RiakLink> links = new ArrayList<RiakLink>();
        Map<String, Map<String, String>> parsedLinks = LinkHeader.parse(header);
        for (String url : parsedLinks.keySet()) {
            RiakLink link = parseOneLink(url, parsedLinks.get(url));
            if (link != null) {
                links.add(link);
            }
        }
        return links;
View Full Code Here

Examples of com.basho.riak.client.RiakLink

    private static RiakLink parseOneLink(String url, Map<String, String> params) {
        String tag = params.get(Constants.LINK_TAG);
        if (tag != null) {
            String[] parts = url.split("/");
            if (parts.length >= 2)
                return new RiakLink(parts[parts.length - 2], parts[parts.length - 1], tag);
        }
        return null;
    }
View Full Code Here

Examples of com.basho.riak.client.core.query.links.RiakLink

        pojo.bucketType = "some_type";
        pojo.value = "some_value";
        pojo.metadata =
            new HashMap<String,String>(){{ put("metaKey", "metaValue");}};
        pojo.index = new HashSet<String>(){{ add("bob@gmail.com");}};
        pojo.links = new LinkedList<RiakLink>(){{ add(new RiakLink("bucket","key","tag"));}};
        pojo.vclock = vclock;
        pojo.contentType = RiakObject.DEFAULT_CONTENT_TYPE;
           
        JSONConverter<EmptyPojoWithRiakFields> jc =
            new JSONConverter<EmptyPojoWithRiakFields>(new TypeReference<EmptyPojoWithRiakFields>(){});
View Full Code Here

Examples of com.basho.riak.client.core.query.links.RiakLink

        BinaryValue key = BinaryValue.create("key".getBytes());

        RiakObject ro = new RiakObject();

        List<RiakLink> links = new ArrayList<RiakLink>();
        links.add(new RiakLink("bucket", "key", "tag"));
        ro.getLinks().addLinks(links);

        RiakIndexes indexes = ro.getIndexes();
        LongIntIndex longIndex = indexes.getIndex(LongIntIndex.named("dave"));
        longIndex.add(42L);
View Full Code Here

Examples of com.basho.riak.client.core.query.links.RiakLink

   
    @Test
    public void getRiakLinksField()
    {
        Collection<RiakLink> links = new LinkedList<RiakLink>();
        RiakLink link = new RiakLink("bucket", "key", "tag");
        links.add(link);
        link = new RiakLink("bucket", "key2", "tag");
        links.add(link);
        PojoWithAnnotatedFields pojo = new PojoWithAnnotatedFields();
        pojo.links = links;
       
        com.basho.riak.client.core.query.links.RiakLinks riakLinks =
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.