com.basho.riak.client.raw
Class StoreMeta

java.lang.Object
  extended by com.basho.riak.client.raw.StoreMeta

public class StoreMeta
extends Object

Encapsulates the optional parameters for a store operation on Riak

Author:
russell
See Also:
RawClient.store(com.basho.riak.client.IRiakObject, StoreMeta)

Nested Class Summary
static class StoreMeta.Builder
           
 
Constructor Summary
StoreMeta(Integer w, Integer dw, Integer pw, Boolean returnBody, Boolean ifNoneMatch, Boolean ifNotModified)
          Create a StoreMeta, accepts nulls for any parameter
StoreMeta(Integer w, Integer dw, Integer pw, Boolean returnBody, Boolean returnHead, Boolean ifNoneMatch, Boolean ifNotModified)
          Create a StoreMeta, accepts nulls for any parameter
StoreMeta(Quorum w, Quorum dw, Quorum pw, Boolean returnBody, Boolean returnHead, Boolean ifNoneMatch, Boolean ifNotModified)
          Create a StoreMeta, accepts nulls for any parameter
 
Method Summary
static StoreMeta empty()
           
 StoreMeta etags(String[] etags)
          Optional supporting data for ifNoneMatch for the HTTP API
 Quorum getDw()
          The durable write quorum
 String[] getEtags()
           
 Boolean getIfNoneMatch()
          Get the value of the ifNoneMatch parameter
 Boolean getIfNotModified()
          Get the value of the ifNoneMatch parameter
 Date getLastModified()
           
 Quorum getPw()
          Get the value for the pw parameter
 Boolean getReturnBody()
          Get the value for the return body parameter
 Boolean getReturnHead()
           
 Quorum getW()
          The write quorum
 boolean hasDw()
          Has the durable write quorum been set?
 boolean hasIfNoneMatch()
          Has the ifNoneMatch parameter been set?
 boolean hasIfNotModified()
          Has the ifNotModified parameter been set?
 boolean hasPw()
          Has the pw parameter been set?
 boolean hasReturnBody()
          Has the return body parameter been set?
 boolean hasReturnHead()
           
 boolean hasW()
          Is the write quorum set?
static StoreMeta headOnly()
           
 boolean isIfNoneMatch()
           
 boolean isIfNotModified()
           
 StoreMeta lastModified(Date lastModified)
          Optional supporting parameter for ifNotModified for the HTTP API
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoreMeta

public StoreMeta(Integer w,
                 Integer dw,
                 Integer pw,
                 Boolean returnBody,
                 Boolean ifNoneMatch,
                 Boolean ifNotModified)
Create a StoreMeta, accepts nulls for any parameter

Parameters:
w - the write quorum for a store operation
dw - the durable write quorum for a store operation
pw - the primary write quorum
returnBody - should the store operation return the new data item and its meta data
ifNoneMatch - only store if bucket/key does not exist
ifNotModified - only store is the vclock supplied on store matches the vclock in Riak

StoreMeta

public StoreMeta(Integer w,
                 Integer dw,
                 Integer pw,
                 Boolean returnBody,
                 Boolean returnHead,
                 Boolean ifNoneMatch,
                 Boolean ifNotModified)
Create a StoreMeta, accepts nulls for any parameter

Parameters:
w - the write quorum for a store operation
dw - the durable write quorum for a store operation
pw - the primary write quorum
returnBody - should the store operation return the new data item and its meta data
returnHead - should the store operation return only the meta data
ifNoneMatch - only store if bucket/key does not exist
ifNotModified - only store is the vclock supplied on store matches the vclock in Riak

StoreMeta

public StoreMeta(Quorum w,
                 Quorum dw,
                 Quorum pw,
                 Boolean returnBody,
                 Boolean returnHead,
                 Boolean ifNoneMatch,
                 Boolean ifNotModified)
Create a StoreMeta, accepts nulls for any parameter

Parameters:
w - the write quorum for a store operation
dw - the durable write quorum for a store operation
pw - the primary write quorum
returnBody - should the store operation return the new data item and its meta data
returnHead - should the store operation return only the meta data
ifNoneMatch - only store if bucket/key does not exist
ifNotModified - only store is the vclock supplied on store matches the vclock in Riak
Method Detail

getW

public Quorum getW()
The write quorum

Returns:
an Integer or null if no write quorum set

hasW

public boolean hasW()
Is the write quorum set?

Returns:
true if the write quorum is set, false otherwise

getDw

public Quorum getDw()
The durable write quorum

Returns:
an Integer or null if the durable write quorum is not set

hasDw

public boolean hasDw()
Has the durable write quorum been set?

Returns:
true if durable write quorum is set, false otherwise

hasReturnBody

public boolean hasReturnBody()
Has the return body parameter been set?

Returns:
true of return body parameter is set, false otherwise

getReturnBody

public Boolean getReturnBody()
Get the value for the return body parameter

Returns:
the returnBody parameter or null if it is not set

hasPw

public boolean hasPw()
Has the pw parameter been set?

Returns:
true if pw parameter is set, false otherwise

getPw

public Quorum getPw()
Get the value for the pw parameter

Returns:
the pw or null if it is not set.

hasIfNoneMatch

public boolean hasIfNoneMatch()
Has the ifNoneMatch parameter been set?

Returns:
true if ifNoneMatch parameter is set, false otherwise

getIfNoneMatch

public Boolean getIfNoneMatch()
Get the value of the ifNoneMatch parameter

Returns:
the ifNoneMatch or null if not set.

isIfNoneMatch

public boolean isIfNoneMatch()
Returns:
true if hasIfNoneMatch && getIfNoneMatch

hasIfNotModified

public boolean hasIfNotModified()
Has the ifNotModified parameter been set?

Returns:
true if ifNotModified parameter is set, false otherwise

getIfNotModified

public Boolean getIfNotModified()
Get the value of the ifNoneMatch parameter

Returns:
the ifNotModified or null if not set.

isIfNotModified

public boolean isIfNotModified()
Returns:
true if hasIfNotModified && getIfNotModified, false otherwise

empty

public static StoreMeta empty()
Returns:
an empty StoreMeta

hasReturnHead

public boolean hasReturnHead()
Returns:
true if returnHead is set, false otherwise

getReturnHead

public Boolean getReturnHead()
Returns:
the returnHead value or null (if not set)

etags

public StoreMeta etags(String[] etags)
Optional supporting data for ifNoneMatch for the HTTP API

Parameters:
etags - the array of etags to provide for ifNoneMatch
Returns:
this.

getEtags

public String[] getEtags()
Returns:
the etags

getLastModified

public Date getLastModified()
Returns:
the lastModified

lastModified

public StoreMeta lastModified(Date lastModified)
Optional supporting parameter for ifNotModified for the HTTP API

Parameters:
lastModified - a Date
Returns:
this

headOnly

public static StoreMeta headOnly()
Returns:
a StoreMeta with only the headOnly set to true


Copyright © 2012. All Rights Reserved.