public class SSequenceConfig
extends java.lang.Object
For a user created instance, no attribute is set by default. In addition, calling the getter method of an unset attribute results in an IllegalStateException. To set an attribute, call the setter method of the attribute.
When used to create a sequence, system default values are used for unset attributes.
Constructor and Description |
---|
SSequenceConfig()
Create an empty SSequenceConfig with no attribute set.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getAllowCreate()
Return true if the
SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig) method is configured
to create the sequence if it does not already exist. |
boolean |
getAutoCommitNoSync()
Return true if the auto-commit operations on the sequence are configure
to not flush the transaction log.
|
int |
getCacheSize()
Return the number of elements cached by a sequence handle.
|
boolean |
getDecrement()
Return true if the sequence is configured to decrement.
|
boolean |
getExclusiveCreate()
Return true if the
SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig) method is configured
to
fail if the database already exists. |
protected java.lang.Object |
getField(F field)
Return the value set on a specified field.
|
long |
getInitialValue()
Return the initial value for a sequence.
|
long |
getRangeMax()
Return the maximum value for the sequence.
|
long |
getRangeMin()
Return the minimum value for the sequence.
|
protected T |
getThriftObj() |
boolean |
getWrap()
Return true if the sequence will wrap around when it is incremented
(decremented) past the specified maximum (minimum) value.
|
SSequenceConfig |
setAllowCreate(boolean allowCreate)
Configure the
SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig) method to
create the sequence if it does not already exist. |
SSequenceConfig |
setAutoCommitNoSync(boolean autoCommitNoSync)
Configure auto-commit operations on the sequence to not flush the
transaction log.
|
SSequenceConfig |
setCacheSize(int cacheSize)
Set the number of elements cached by a sequence handle.
|
SSequenceConfig |
setDecrement(boolean decrement)
Specify that the sequence should be decremented.
|
SSequenceConfig |
setExclusiveCreate(boolean exclusiveCreate)
Configure the
SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig) method to fail if the
database already exists. |
SSequenceConfig |
setInitialValue(long initialValue)
Set the initial value for a sequence.
|
SSequenceConfig |
setRange(long min,
long max)
Configure a sequence range.
|
SSequenceConfig |
setWrap(boolean wrap)
Specify that the sequence should wrap around when it is incremented
(decremented) past the specified maximum (minimum) value.
|
public SSequenceConfig()
public boolean getAllowCreate()
SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)
method is configured
to create the sequence if it does not already exist.SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)
method is configured
to create the sequence if it does not already exist.public SSequenceConfig setAllowCreate(boolean allowCreate)
SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)
method to
create the sequence if it does not already exist.allowCreate
- if true, configure the SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)
method to create the sequence if it does not already existpublic boolean getAutoCommitNoSync()
public SSequenceConfig setAutoCommitNoSync(boolean autoCommitNoSync)
autoCommitNoSync
- if true, configure auto-commit operations on the
sequence to not flush the transaction logpublic int getCacheSize()
public SSequenceConfig setCacheSize(int cacheSize)
cacheSize
- the number of elements cached by a sequence handlepublic boolean getDecrement()
public SSequenceConfig setDecrement(boolean decrement)
decrement
- if true, specify that the sequence should be
decrementedpublic boolean getExclusiveCreate()
SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)
method is configured
to
fail if the database already exists.SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)
method is configured
to fail if the database already existspublic SSequenceConfig setExclusiveCreate(boolean exclusiveCreate)
SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)
method to fail if the
database already exists.exclusiveCreate
- if true, configure the SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)
method to fail if the database already existspublic long getInitialValue()
public SSequenceConfig setInitialValue(long initialValue)
This call is only effective when the sequence is being created.
initialValue
- the initial value for a sequencepublic long getRangeMin()
public long getRangeMax()
public SSequenceConfig setRange(long min, long max)
This call is only effective when the sequence is being created.
min
- the minimum value for the sequencemax
- the maximum value for the sequencepublic boolean getWrap()
public SSequenceConfig setWrap(boolean wrap)
wrap
- if true, specify that the sequence should wrap around when it
is incremented (decremented) past the specified maximum (minimum) valueprotected T getThriftObj()
protected java.lang.Object getField(F field) throws java.lang.IllegalStateException
field
- the fieldjava.lang.IllegalStateException
- if the field is not setCopyright (c) 2016, 2019 Oracle and/or its affiliates. All rights reserved.