com.scaleoutsoftware.soss.client
Class CreatePolicy

java.lang.Object
  extended by com.scaleoutsoftware.soss.client.CreatePolicy
All Implemented Interfaces:
Serializable

public class CreatePolicy
extends Object
implements Serializable

The CreatePolicy class provides extended parameter information to the NamedCache.insert(com.scaleoutsoftware.soss.client.CachedObjectId, 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.

See Also:
Serialized Form

Field Summary
static int MaxDependencies
           
 
Constructor Summary
CreatePolicy()
          Creates a CreatePolicy object with an infinite timeout and a sliding expiration policy.
CreatePolicy(int timeoutMinutes)
          Deprecated. use CreatePolicy(TimeSpan)
CreatePolicy(int timeoutMinutes, boolean isAbsoluteTimeout)
          Deprecated. use CreatePolicy(TimeSpan, boolean)
CreatePolicy(int timeoutMinutes, boolean isAbsoluteTimeout, ObjectPreemptionPriority preemptionPriority, Object[] parents, boolean allowReplication)
          Deprecated. use CreatePolicy(TimeSpan, boolean, ObjectPreemptionPriority, java.util.Collection, boolean)
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, Collection parents, boolean allowReplication)
          Creates a CreatePolicy object.
 
Method Summary
 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 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. use getBackingStoreAsyncPolicy()
 CoherencyPolicy getDefaultCoherencyPolicy()
          Gets the default coherency policy or null if no coherency policy is set.
 Object[] getDependencies()
          Deprecated. use getParents()
 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. use getAbsoluteTimeout()
 boolean isAllowReplication()
          Deprecated. use getAllowReplication()
 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 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. use setBackingStoreAsyncPolicy(BackingStoreAsyncPolicy)
 void setDefaultCoherencyPolicy(CoherencyPolicy defaultCoherencyPolicy)
          Sets the default coherency policy.
 void setDependencies(Object[] keys)
          Deprecated. use setParents(java.util.Collection)
 void setParents(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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MaxDependencies

public static final int MaxDependencies
See Also:
Constant Field Values
Constructor Detail

CreatePolicy

public CreatePolicy()
Creates a CreatePolicy object with an infinite timeout and a sliding expiration policy. Also, objects will be subject to reclamation under low-memory circumstances, and they will eligible for GeoServer replication to a remote store.


CreatePolicy

public CreatePolicy(TimeSpan timeout)
Creates a CreatePolicy object with a timeout of the specified duration and a sliding expiration policy. Also, objects will be subject to reclamation under low-memory circumstances, and they will eligible for GeoServer replication to a remote store.

Parameters:
timeout - Timeout before the object expires. TimeSpan.INFINITE_TIMEOUT for an infinite timeout.

CreatePolicy

public CreatePolicy(TimeSpan timeout,
                    boolean isAbsoluteTimeout)
Creates a CreatePolicy object with a timeout of the specified duration that is either sliding or absolute. Also, objects will be subject to reclamation under low-memory circumstances, and they will eligible for GeoServer replication to a remote store.

Parameters:
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.

CreatePolicy

public CreatePolicy(TimeSpan timeout,
                    boolean isAbsoluteTimeout,
                    ObjectPreemptionPriority preemptionPriority,
                    Collection parents,
                    boolean allowReplication)
Creates a CreatePolicy object.

Parameters:
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.

CreatePolicy

public CreatePolicy(int timeoutMinutes)
Deprecated. use CreatePolicy(TimeSpan)

Creates a CreatePolicy object with an infinite timeout and a sliding expiration policy. Also, objects will be subject to reclamation under low-memory circumstances, and they will eligible for GeoServer replication to a remote store.

Parameters:
timeoutMinutes - Number of minutes before the object expires. 0 for an infinite timeout.

CreatePolicy

public CreatePolicy(int timeoutMinutes,
                    boolean isAbsoluteTimeout)
Deprecated. use CreatePolicy(TimeSpan, boolean)

Creates a CreatePolicy object with a timeout of the specified duration that is either sliding or absolute. Also, objects will be subject to reclamation under low-memory circumstances, and they will eligible for GeoServer replication to a remote store.

Parameters:
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.

CreatePolicy

public CreatePolicy(int timeoutMinutes,
                    boolean isAbsoluteTimeout,
                    ObjectPreemptionPriority preemptionPriority,
                    Object[] parents,
                    boolean allowReplication)
Deprecated. use CreatePolicy(TimeSpan, boolean, ObjectPreemptionPriority, java.util.Collection, boolean)

Creates a CreatePolicy object.

Parameters:
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.
Method Detail

getTimeout

public TimeSpan getTimeout()
Gets the time before the object expires.

Returns:
timeout in minutes

setTimeout

public void setTimeout(TimeSpan timeout)
Sets the time before the object expires.

Parameters:
timeout - Timeout before the object expires. TimeSpan.INFINITE_TIMEOUT for an infinite timeout.

getAbsoluteTimeout

public 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.

Returns:
true if expiration value is absolute, false otherwise.

getPreemptionPriority

public ObjectPreemptionPriority getPreemptionPriority()
Gets 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.

Returns:
ObjectPreemptionPriority object

setPreemptionPriority

public void setPreemptionPriority(ObjectPreemptionPriority preemptionPriority)
Sets 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.

Parameters:
preemptionPriority - ObjectPreemptionPriority object

getAllowReplication

public boolean getAllowReplication()
Gets whether the object to be added to the cache will be subject to GeoServer cross-store replication.

Returns:
true if replication is allowed, false otherwise.

setAllowReplication

public void setAllowReplication(boolean allowReplication)
Sets whether the object to be added to the cache will be subject to GeoServer cross-store replication.

Parameters:
allowReplication - true if replication is allowed, false otherwise.

getBackingStoreInterval

public TimeSpan getBackingStoreInterval()
Gets the interval between asynchronous backing store events (refresh-ahead, write-behind).

Returns:
the backing store interval

setBackingStoreInterval

public void setBackingStoreInterval(TimeSpan backingStoreInterval)
Sets the interval between asynchronous backing store events (refresh-ahead, write-behind).

Parameters:
backingStoreInterval - new backing store interval

getBackingStoreAsyncPolicy

public 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.

Returns:
current backing store mode for asynchronous operations

setBackingStoreAsyncPolicy

public 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.

Parameters:
asyncPolicy - new backing store policy for asynchronous operations

setParents

public void setParents(Collection<?> parents)
Sets keys to objects on which the object being added depends. Items in the array must be of type 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.

Parameters:
parents - collection of keys

getParents

public Set getParents()
Gets keys to objects on which the object being added depends.

Returns:
Set of object keys

getBackingStoreMode

public com.scaleoutsoftware.soss.client.da.CreateInfo.BackingStoreMode getBackingStoreMode()
Deprecated. use getBackingStoreAsyncPolicy()

Returns the type of backing store operations (none, refresh-ahead or write-behind) performed on the StateServer object corresponding to this metadata instance.

Returns:
current backing store mode for asynchronous operations

setBackingStoreMode

public void setBackingStoreMode(com.scaleoutsoftware.soss.client.da.CreateInfo.BackingStoreMode bsm)
Deprecated. use setBackingStoreAsyncPolicy(BackingStoreAsyncPolicy)

Sets the type of backing store operations (none, refresh-ahead or write-behind) performed on the StateServer object corresponding to this metadata instance.

Parameters:
bsm - new backing store mode for asynchronous operations

setDependencies

public void setDependencies(Object[] keys)
Deprecated. use setParents(java.util.Collection)

Sets keys to objects on which the object being added depends. Items in the array must be of type 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.

Parameters:
keys - array of dependencies

getDependencies

public Object[] getDependencies()
Deprecated. use getParents()

Gets keys to objects on which the object being added depends.

Returns:
array of object keys

isAllowReplication

public boolean isAllowReplication()
Deprecated. use getAllowReplication()

Gets whether the object to be added to the cache will be subject to GeoServer cross-store replication.

Returns:
true if replication is allowed, false otherwise.

isAbsoluteTimeout

public boolean isAbsoluteTimeout()
Deprecated. use 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.

Returns:
true if expiration value is absolute, false otherwise.

setAbsoluteTimeout

public 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.

Parameters:
absoluteTimeout - true if expiration value is absolute, false otherwise.

getDefaultCoherencyPolicy

public CoherencyPolicy getDefaultCoherencyPolicy()
Gets the default coherency policy or null if no coherency policy is set.

Returns:
default coherency policy

setDefaultCoherencyPolicy

public void setDefaultCoherencyPolicy(CoherencyPolicy defaultCoherencyPolicy)
Sets the default coherency policy.

Parameters:
defaultCoherencyPolicy - default coherency policy or null for no coherency policy.

getAllowRemoteAccess

public boolean getAllowRemoteAccess()
Gets whether an object can be accessed by remote stores.

Returns:
true if the object can be accessed by the remote store, false otherwise

setAllowRemoteAccess

public void setAllowRemoteAccess(boolean allowRemoteAccess)
Sets if object can be accessed by remote stores.

Parameters:
allowRemoteAccess - true if the object can be accessed by the remote store, false otherwise


Copyright (C) 2007-2012 ScaleOut Software, Inc.