net.citrusleaf
Class CitrusleafClient.ClWriteOptions

java.lang.Object
  extended by net.citrusleaf.CitrusleafClient.ClWriteOptions
Enclosing class:
CitrusleafClient

public static class CitrusleafClient.ClWriteOptions
extends java.lang.Object

Container object for policy attributes used in write operations.

This object is passed in set(), append(), prepend(), add(), and delete() calls to specify write options. null may be passed to use defaults for all options.

Set expiration and unique directly, and call set_generation...() methods to override defaults.

Generation is the number of times a record has been modified (including creation) on the server. Therefore if a write operation is creating a record, the expected generation would be 0.


Field Summary
 int expiration
          Record is automatically removed from server this many seconds after write operation.
 boolean unique
          Write operation is create-only, will fail if record already exists.
 
Constructor Summary
CitrusleafClient.ClWriteOptions()
          Constructor, sets default write options.
 
Method Summary
 void set_generation_dup(int generation)
          Specify expected generation, and flag to duplicate if generation is not equal to that on server.
 void set_generation_gt(int generation)
          Specify highest expected generation.
 void set_generation(int generation)
          Specify expected generation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expiration

public int expiration
Record is automatically removed from server this many seconds after write operation.


unique

public boolean unique
Write operation is create-only, will fail if record already exists.

Constructor Detail

CitrusleafClient.ClWriteOptions

public CitrusleafClient.ClWriteOptions()
Constructor, sets default write options.

The object is constructed with expiration of 0, unique set false, and no expected generation.

Method Detail

set_generation

public void set_generation(int generation)
Specify expected generation.

Write operation will fail if generation is set and it's not equal to the generation on the server.

Parameters:
generation - expected generation

set_generation_gt

public void set_generation_gt(int generation)
Specify highest expected generation.

Write operation will fail if generation is set and it's less than the generation on the server. (Useful for restore after backup.)

Parameters:
generation - highest expected generation

set_generation_dup

public void set_generation_dup(int generation)
Specify expected generation, and flag to duplicate if generation is not equal to that on server.

Write operation will generate duplicate record if expected generation is set and it's not the generation on the server.

Parameters:
generation - expected generation