Package com.basho.riak.client.api.cap

Examples of com.basho.riak.client.api.cap.VClock


            @RiakVClock
            void setVClock(Date key) {}
           
        };
        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final VClock expected = new BasicVClock(clockBytes);
        AnnotationUtil.setVClock(o, expected);
    }
View Full Code Here


    public void noVClockFieldOrMethod()
    {
        final Object o = new Object();

        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        final VClock expected = new BasicVClock(clockBytes);
        assertNull(AnnotationUtil.getVClock(o));
        assertNotNull(AnnotationUtil.getVClock(o, expected));
        AnnotationUtil.setVClock(o, expected); // should do nothing
    }
View Full Code Here

    }

    @Test
    public void nullVClockField()
    {
        final VClock expected = null;
        final PojoWithAnnotatedFields pojo = new PojoWithAnnotatedFields();
        pojo.vclock = expected;

        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
        assertNull(AnnotationUtil.getVClock(pojo));
View Full Code Here

    }
   
    @Test
    public void nullVClockMethod()
    {
        final VClock expected = null;
        final PojoWithAnnotatedMethods pojo = new PojoWithAnnotatedMethods();
        pojo.setVClock(expected);

        assertNull(AnnotationUtil.getVClock(pojo));
        final byte[] clockBytes = "a85hYGBgzGDKBVIcypz/fvo/2e2UwZTImMfKwHIy/SRfFgA=".getBytes();
View Full Code Here

        if (bucketName == null)
        {
            throw new ConversionException("Bucket name not provided via namespace or domain object");
        }
       
        VClock vclock = AnnotationUtil.getVClock(domainObject);
        String contentType =
            AnnotationUtil.getContentType(domainObject, RiakObject.DEFAULT_CONTENT_TYPE);
       
        RiakObject riakObject = new RiakObject();
       
View Full Code Here

    }
   
    public <T> VClock getRiakVClock(T obj)
    {

        VClock vclock = null;

        // We allow the annotated field to be either an actual VClock, or
        // a byte array.
        if (riakVClockField != null)
        {
View Full Code Here

        return obj;
    }

    public static <T> VClock getVClock(T domainObject, VClock defaultVClock)
    {
        VClock vclock = getVClock(domainObject);
        return vclock != null ? vclock : defaultVClock;
    }
View Full Code Here

                        FetchValue.Response fetchResponse;
                        try
                        {
                            fetchResponse = f.get();
                            Object resolved = null;
                            VClock vclock = null;
                           
                            if (!fetchResponse.isNotFound())
                            {
                                if (typeReference == null)
                                {
View Full Code Here

        T resolved = resolver.resolve(convertedValues);
       
        if (hasValues() && resolved != null)
        {
            VClock vclock = values.get(0).getVClock();
            AnnotationUtil.setVClock(resolved, vclock);
        }
       
        return resolved;
    }
View Full Code Here

            ConflictResolverFactory.getInstance().getConflictResolver(typeReference);

        T resolved = resolver.resolve(convertedValues);
        if (hasValues() && resolved != null)
        {
            VClock vclock = values.get(0).getVClock();
            AnnotationUtil.setVClock(resolved, vclock);
        }
       
        return resolved;
    }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.api.cap.VClock

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.