public class CreatePolicy
extends java.lang.Object
implements java.io.Serializable
CreatePolicy
class provides extended parameter information to the NamedCache.insert(com.scaleoutsoftware.soss.client.CachedObjectId<T>, T, com.scaleoutsoftware.soss.client.CreatePolicy, boolean, boolean)
and
NamedCache.setDefaultCreatePolicy(com.scaleoutsoftware.soss.client.CreatePolicy)
. This class allows you to specify the StateServer object timeout, the type of
timeout, whether the object may be removed from memory if memory availability becomes constrained, and any
parents this object has on other StateServer objects.Modifier and Type | Field and Description |
---|---|
static int |
MaxDependencies |
Constructor and Description |
---|
CreatePolicy()
Creates a CreatePolicy object with an infinite timeout and a sliding expiration policy.
|
CreatePolicy(int timeoutMinutes)
Deprecated.
|
CreatePolicy(int timeoutMinutes,
boolean isAbsoluteTimeout)
Deprecated.
|
CreatePolicy(int timeoutMinutes,
boolean isAbsoluteTimeout,
ObjectPreemptionPriority preemptionPriority,
java.lang.Object[] parents,
boolean allowReplication)
|
CreatePolicy(TimeSpan timeout)
Creates a CreatePolicy object with a timeout of the specified duration and a sliding expiration policy.
|
CreatePolicy(TimeSpan timeout,
boolean isAbsoluteTimeout)
Creates a CreatePolicy object with a timeout of the specified duration that is either sliding or absolute.
|
CreatePolicy(TimeSpan timeout,
boolean isAbsoluteTimeout,
ObjectPreemptionPriority preemptionPriority,
java.util.Collection parents,
boolean allowReplication)
Creates a CreatePolicy object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getAbsoluteTimeout()
Gets whether the timeout is an absolute expiration value or is a sliding expiration value that
gets reset every time the object is accessed.
|
boolean |
getAbsoluteTimeoutOnRead()
Gets whether the timeout is an absolute expiration value or is a sliding expiration value that gets reset every
time the object updated (but not read).
|
boolean |
getAllowRemoteAccess()
Gets whether an object can be accessed by remote stores.
|
boolean |
getAllowReplication()
Gets whether the object to be added to the cache will be subject to GeoServer cross-store replication.
|
BackingStoreAsyncPolicy |
getBackingStoreAsyncPolicy()
Returns the type of backing store operations (none, refresh-ahead or write-behind) performed on the StateServer object
corresponding to this metadata instance.
|
TimeSpan |
getBackingStoreInterval()
Gets the interval between asynchronous backing
store events (refresh-ahead, write-behind).
|
com.scaleoutsoftware.soss.client.da.CreateInfo.BackingStoreMode |
getBackingStoreMode()
Deprecated.
|
CoherencyPolicy |
getDefaultCoherencyPolicy()
Gets the default coherency policy or
null if no coherency policy is set. |
java.lang.Object[] |
getDependencies()
Deprecated.
use
getParents() |
java.util.Set |
getParents()
Gets keys to objects on which the object being added depends.
|
ObjectPreemptionPriority |
getPreemptionPriority()
Gets the priority of keeping the object in the cache during low-memory situations.
|
TimeSpan |
getTimeout()
Gets the time before the object expires.
|
boolean |
isAbsoluteTimeout()
Deprecated.
|
boolean |
isAllowReplication()
Deprecated.
|
void |
setAbsoluteTimeout(boolean absoluteTimeout)
Sets whether the timeout is an absolute expiration value or is a sliding expiration value that
gets reset every time the object is accessed.
|
void |
setAbsoluteTimeoutOnRead(boolean absoluteTimeoutOnRead)
Sets whether the timeout is an absolute expiration value or is a sliding expiration value that gets reset every
time the object updated.
|
void |
setAllowRemoteAccess(boolean allowRemoteAccess)
Sets if object can be accessed by remote stores.
|
void |
setAllowReplication(boolean allowReplication)
Sets whether the object to be added to the cache will be subject to GeoServer cross-store replication.
|
void |
setBackingStoreAsyncPolicy(BackingStoreAsyncPolicy asyncPolicy)
Sets the type of backing store operations (none, refresh-ahead or write-behind) performed on the StateServer object
corresponding to this metadata instance.
|
void |
setBackingStoreInterval(TimeSpan backingStoreInterval)
Sets the interval between asynchronous backing store events
(refresh-ahead, write-behind).
|
void |
setBackingStoreMode(com.scaleoutsoftware.soss.client.da.CreateInfo.BackingStoreMode bsm)
Deprecated.
|
void |
setDefaultCoherencyPolicy(CoherencyPolicy defaultCoherencyPolicy)
Sets the default coherency policy.
|
void |
setDependencies(java.lang.Object[] keys)
Deprecated.
|
void |
setParents(java.util.Collection<?> parents)
Sets keys to objects on which the object being added depends.
|
void |
setPreemptionPriority(ObjectPreemptionPriority preemptionPriority)
Sets the priority of keeping the object in the cache during low-memory situations.
|
void |
setTimeout(TimeSpan timeout)
Sets the time before the object expires.
|
public static final int MaxDependencies
public CreatePolicy()
public CreatePolicy(TimeSpan timeout)
timeout
- Timeout before the object expires. TimeSpan.INFINITE_TIMEOUT
for an infinite timeout.public CreatePolicy(TimeSpan timeout, boolean isAbsoluteTimeout)
timeout
- Timeout before the object expires. TimeSpan.INFINITE_TIMEOUT
for an infinite timeout.isAbsoluteTimeout
- Indicates whether the timeout is an absolute expiration value or is a sliding expiration value that gets reset every time the object is accessed.public CreatePolicy(TimeSpan timeout, boolean isAbsoluteTimeout, ObjectPreemptionPriority preemptionPriority, java.util.Collection parents, boolean allowReplication)
timeout
- Timeout before the object expires. TimeSpan.INFINITE_TIMEOUT
for an infinite timeout.isAbsoluteTimeout
- Indicates whether the timeout is an absolute expiration value or is a sliding expiration value that gets reset every time the object is accessed.preemptionPriority
- Indicates the priority of keeping the object in the cache during low-memory situations. Removable objects are removed from memory when memory runs low based on a least recently used algorithm.parents
- Keys to objects on which the object being added depends. Items in the collection must be of type string, byte[], Guid, CachedObjectId, or StateServerKey. An object can be dependent upon up to 2 parent objects. Keys to parents that do not exist in the store will be ignored.allowReplication
- Indicates whether the object to be added to the cache will be subject to GeoServer cross-store replication.public CreatePolicy(int timeoutMinutes)
CreatePolicy(TimeSpan)
timeoutMinutes
- Number of minutes before the object expires. 0 for an infinite timeout.public CreatePolicy(int timeoutMinutes, boolean isAbsoluteTimeout)
CreatePolicy(TimeSpan, boolean)
timeoutMinutes
- Number of minutes before the object expires. 0 for an infinite timeout.isAbsoluteTimeout
- Indicates whether the timeout is an absolute expiration value or is a sliding expiration value that gets reset every time the object is accessed.public CreatePolicy(int timeoutMinutes, boolean isAbsoluteTimeout, ObjectPreemptionPriority preemptionPriority, java.lang.Object[] parents, boolean allowReplication)
CreatePolicy(TimeSpan, boolean, ObjectPreemptionPriority, java.util.Collection, boolean)
timeoutMinutes
- Number of minutes before the object expires. 0 for an infinite timeout.isAbsoluteTimeout
- Indicates whether the timeout is an absolute expiration value or is a sliding expiration value that gets reset every time the object is accessed.preemptionPriority
- Indicates the priority of keeping the object in the cache during low-memory situations. Removable objects are removed from memory when memory runs low based on a least recently used algorithm.parents
- Keys to objects on which the object being added depends. Items in the array must be of type string, byte[], Guid, CachedObjectId, or StateServerKey. An object can be dependent upon up to 2 parent objects. Keys to parents that do not exist in the store will be ignored.allowReplication
- Indicates whether the object to be added to the cache will be subject to GeoServer cross-store replication.public TimeSpan getTimeout()
public void setTimeout(TimeSpan timeout)
timeout
- Timeout before the object expires. TimeSpan.INFINITE_TIMEOUT
for an infinite timeout.public boolean getAbsoluteTimeoutOnRead()
true
if expiration value is absolute, false
otherwise.public void setAbsoluteTimeoutOnRead(boolean absoluteTimeoutOnRead)
setAbsoluteTimeout(boolean)
),
which resets the expiration if the object is updated or read.)absoluteTimeoutOnRead
- new value for "absolute timeout on read" propertypublic boolean getAbsoluteTimeout()
true
if expiration value is absolute, false
otherwise.public ObjectPreemptionPriority getPreemptionPriority()
public void setPreemptionPriority(ObjectPreemptionPriority preemptionPriority)
preemptionPriority
- ObjectPreemptionPriority objectpublic boolean getAllowReplication()
true
if replication is allowed, false
otherwise.public void setAllowReplication(boolean allowReplication)
allowReplication
- true
if replication is allowed, false
otherwise.public TimeSpan getBackingStoreInterval()
public void setBackingStoreInterval(TimeSpan backingStoreInterval)
backingStoreInterval
- new backing store intervalpublic BackingStoreAsyncPolicy getBackingStoreAsyncPolicy()
public void setBackingStoreAsyncPolicy(BackingStoreAsyncPolicy asyncPolicy)
asyncPolicy
- new backing store policy for asynchronous operationspublic void setParents(java.util.Collection<?> parents)
String
, byte[]
,
UUID
, or StateServerKey
. An object can be dependent upon up to 2 parent objects. Keys to parents that do not
exist in the store will be ignored.parents
- collection of keyspublic java.util.Set getParents()
Set
of object keyspublic com.scaleoutsoftware.soss.client.da.CreateInfo.BackingStoreMode getBackingStoreMode()
getBackingStoreAsyncPolicy()
public void setBackingStoreMode(com.scaleoutsoftware.soss.client.da.CreateInfo.BackingStoreMode bsm)
setBackingStoreAsyncPolicy(BackingStoreAsyncPolicy)
bsm
- new backing store mode for asynchronous operationspublic void setDependencies(java.lang.Object[] keys)
setParents(java.util.Collection<?>)
String
, byte[]
,
UUID
, or StateServerKey
. An object can be dependent upon up to 2 parent objects. Keys to parents that do not
exist in the store will be ignored.keys
- array of dependenciespublic java.lang.Object[] getDependencies()
getParents()
public boolean isAllowReplication()
getAllowReplication()
true
if replication is allowed, false
otherwise.public boolean isAbsoluteTimeout()
getAbsoluteTimeout()
true
if expiration value is absolute, false
otherwise.public void setAbsoluteTimeout(boolean absoluteTimeout)
absoluteTimeout
- true
if expiration value is absolute, false
otherwise.public CoherencyPolicy getDefaultCoherencyPolicy()
null
if no coherency policy is set.public void setDefaultCoherencyPolicy(CoherencyPolicy defaultCoherencyPolicy)
defaultCoherencyPolicy
- default coherency policy or null
for no coherency policy.public boolean getAllowRemoteAccess()
true
if the object can be accessed by the remote store, false
otherwisepublic void setAllowRemoteAccess(boolean allowRemoteAccess)
allowRemoteAccess
- true
if the object can be accessed by the remote store, false
otherwise