Examples of StoreMeta


Examples of com.basho.riak.client.StoreMeta

  @Test
  public void testStoreFetchDelete() throws ExecutionException, InterruptedException
  {

    RiakObject o = RiakObject.create(bucket.unsafeGetValue()).setValue("test value");
    StoreMeta storeMeta = new StoreMeta.Builder().returnBody(true).build();

    StoreOperation<RiakObject> store =
      new StoreOperation<RiakObject>(bucket, o)
        .withConverter(domainObjectConverter)
        .withStoreMeta(storeMeta);
View Full Code Here

Examples of com.basho.riak.client.StoreMeta

  @Test
  public void testSiblings() throws ExecutionException, InterruptedException
  {

    RiakObject o = RiakObject.create(bucket.unsafeGetValue()).setValue("test value");
    StoreMeta storeMeta = new StoreMeta.Builder().returnBody(true).build();

    StoreOperation<RiakObject> store1 =
      new StoreOperation<RiakObject>(bucket, o)
        .withConverter(domainObjectConverter)
        .withStoreMeta(storeMeta);
View Full Code Here

Examples of com.basho.riak.client.raw.StoreMeta

     */
    public T execute() throws RiakRetryFailedException, UnresolvedConflictException, ConversionException {
        final T resolved = fetchObject.execute();
        final T mutated = mutation.apply(resolved);
        final IRiakObject o = converter.fromDomain(mutated, fetchObject.getVClock());
        final StoreMeta storeMeta = storeMetaBuilder.returnBody(returnBody).build();

        // if non match and if not modified require extra data for the HTTP API
        // pull that from the riak object if possible
        if(storeMeta.hasIfNoneMatch() && storeMeta.getIfNoneMatch() && o != null) {
            storeMeta.etags(new String[] {o.getVtag()});
        }

        if(storeMeta.hasIfNotModified() && storeMeta.getIfNotModified()  && o != null) {
            storeMeta.lastModified(o.getLastModified());
        }

        final RiakResponse stored = retrier.attempt(new Callable<RiakResponse>() {
            public RiakResponse call() throws Exception {
                return client.store(o, storeMeta);
View Full Code Here

Examples of com.basho.riak.client.raw.StoreMeta

     */
    public T execute() throws RiakRetryFailedException, UnresolvedConflictException, ConversionException {
        final T resolved = fetchObject.execute();
        final T mutated = mutation.apply(resolved);
        final IRiakObject o = converter.fromDomain(mutated, fetchObject.getVClock());
        final StoreMeta storeMeta = generateStoreMeta();

        // if non match and if not modified require extra data for the HTTP API
        // pull that from the riak object if possible
        if(storeMeta.hasIfNonMatch() && storeMeta.getIfNonMatch() && o != null) {
            storeMeta.etags(new String[] {o.getVtag()});
        }

        if(storeMeta.hasIfNotModified() && storeMeta.getIfNotModified()  && o != null) {
            storeMeta.lastModified(o.getLastModified());
        }

        final RiakResponse stored = retrier.attempt(new Callable<RiakResponse>() {
            public RiakResponse call() throws Exception {
                return client.store(o, storeMeta);
View Full Code Here

Examples of com.basho.riak.client.raw.StoreMeta

    /**
     * Create a {@link StoreMeta} instance from this operation's parameters.
     * @return a {@link StoreMeta} populated with the store parameters.
     */
    private StoreMeta generateStoreMeta() {
        return new StoreMeta(w, dw, pw, returnBody, ifNonMatch, ifNotModified);
    }
View Full Code Here

Examples of com.basho.riak.client.raw.StoreMeta

     */
    public T execute() throws RiakRetryFailedException, UnresolvedConflictException, ConversionException {
        final T resolved = fetchObject.execute();
        final T mutated = mutation.apply(resolved);
        final IRiakObject o = converter.fromDomain(mutated, fetchObject.getVClock());
        final StoreMeta storeMeta = storeMetaBuilder.returnBody(returnBody).build();

        // if non match and if not modified require extra data for the HTTP API
        // pull that from the riak object if possible
        if(storeMeta.hasIfNoneMatch() && storeMeta.getIfNoneMatch() && o != null) {
            storeMeta.etags(new String[] {o.getVtag()});
        }

        if(storeMeta.hasIfNotModified() && storeMeta.getIfNotModified()  && o != null) {
            storeMeta.lastModified(o.getLastModified());
        }

        final RiakResponse stored = retrier.attempt(new Callable<RiakResponse>() {
            public RiakResponse call() throws Exception {
                return client.store(o, storeMeta);
View Full Code Here

Examples of com.basho.riak.client.raw.StoreMeta

            vclock = VClockUtil.getVClock(mutated);
        }
       
       
        final IRiakObject o = converter.fromDomain(mutated, vclock);
        final StoreMeta storeMeta = storeMetaBuilder.returnBody(returnBody).build();

        // if non match and if not modified require extra data for the HTTP API
        // pull that from the riak object if possible
        if(storeMeta.hasIfNoneMatch() && storeMeta.getIfNoneMatch() && o != null) {
            storeMeta.etags(new String[] {o.getVtag()});
        }

        if(storeMeta.hasIfNotModified() && storeMeta.getIfNotModified()  && o != null) {
            storeMeta.lastModified(o.getLastModified());
        }

        final boolean hasMutated =
            mutation instanceof ConditionalStoreMutation<?>
            ? ((ConditionalStoreMutation<T>)mutation).hasMutated()
View Full Code Here

Examples of com.basho.riak.client.raw.StoreMeta

            vclock = VClockUtil.getVClock(mutated);
        }
       
       
        final IRiakObject o = converter.fromDomain(mutated, vclock);
        final StoreMeta storeMeta = storeMetaBuilder.returnBody(returnBody).build();

        // if non match and if not modified require extra data for the HTTP API
        // pull that from the riak object if possible
        if(storeMeta.hasIfNoneMatch() && storeMeta.getIfNoneMatch() && o != null) {
            storeMeta.etags(new String[] {o.getVtag()});
        }

        if(storeMeta.hasIfNotModified() && storeMeta.getIfNotModified()  && o != null) {
            storeMeta.lastModified(o.getLastModified());
        }

        final boolean hasMutated =
            mutation instanceof ConditionalStoreMutation<?>
            ? ((ConditionalStoreMutation<T>)mutation).hasMutated()
View Full Code Here

Examples of com.basho.riak.client.raw.StoreMeta

            vclock = VClockUtil.getVClock(mutated);
        }
       
       
        final IRiakObject o = converter.fromDomain(mutated, vclock);
        final StoreMeta storeMeta = storeMetaBuilder.returnBody(returnBody).build();

        // if non match and if not modified require extra data for the HTTP API
        // pull that from the riak object if possible
        if(storeMeta.hasIfNoneMatch() && storeMeta.getIfNoneMatch() && o != null) {
            storeMeta.etags(new String[] {o.getVtag()});
        }

        if(storeMeta.hasIfNotModified() && storeMeta.getIfNotModified()  && o != null) {
            storeMeta.lastModified(o.getLastModified());
        }

        final boolean hasMutated =
            mutation instanceof ConditionalStoreMutation<?>
            ? ((ConditionalStoreMutation<T>)mutation).hasMutated()
View Full Code Here

Examples of com.basho.riak.client.raw.StoreMeta

            vclock = VClockUtil.getVClock(mutated);
        }
       
       
        final IRiakObject o = converter.fromDomain(mutated, vclock);
        final StoreMeta storeMeta = storeMetaBuilder.returnBody(returnBody).build();

        // if non match and if not modified require extra data for the HTTP API
        // pull that from the riak object if possible
        if(storeMeta.hasIfNoneMatch() && storeMeta.getIfNoneMatch() && o != null) {
            storeMeta.etags(new String[] {o.getVtag()});
        }

        if(storeMeta.hasIfNotModified() && storeMeta.getIfNotModified()  && o != null) {
            storeMeta.lastModified(o.getLastModified());
        }

        final RiakResponse stored = retrier.attempt(new Callable<RiakResponse>() {
            public RiakResponse call() throws Exception {
                return client.store(o, storeMeta);
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.