protected static class ExpirationConfiguration.ExpirationPolicyMetaData extends Object implements ExpirationConfiguration.ExpirationPolicyConfigurer
ExpirationConfiguration.ExpirationPolicyMetaData
is a ExpirationConfiguration.ExpirationPolicyConfigurer
implementation that encapsulates
the expiration configuration meta-data (e.g. expiration timeout and action) necessary to configure
a Regions's
expiration policy and behavior.
This class is meant to capture the expiration configuration meta-data specified in the EnableExpiration.ExpirationPolicy
nested annotation in the application-level EnableExpiration
annotation.Modifier and Type | Field and Description |
---|---|
protected static String[] |
ALL_REGIONS |
Modifier | Constructor and Description |
---|---|
protected |
ExpirationPolicyMetaData(com.gemstone.gemfire.cache.ExpirationAttributes expirationAttributes,
Set<String> regionNames,
Set<EnableExpiration.ExpirationType> types)
Constructs an instance of
ExpirationConfiguration.ExpirationPolicyMetaData initialized with the given expiration policy
configuraiton meta-data and Region expiration settings. |
protected |
ExpirationPolicyMetaData(int timeout,
ExpirationActionType action,
Set<String> regionNames,
Set<EnableExpiration.ExpirationType> types)
Constructs an instance of
ExpirationConfiguration.ExpirationPolicyMetaData initialized with the given expiration policy
configuraiton meta-data and Region expiration settings. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accepts(com.gemstone.gemfire.cache.Region region)
Determines whether to apply this expiration policy to the given
Region . |
protected boolean |
accepts(String regionName)
Determines whether to apply this expiration policy to the given
Region identified by name. |
<K,V> com.gemstone.gemfire.cache.Region<K,V> |
configure(com.gemstone.gemfire.cache.Region<K,V> region)
Configures the expiration policy for the given
Region . |
protected com.gemstone.gemfire.cache.ExpirationAttributes |
defaultExpirationAttributes()
Returns the default, fallback
ExpirationAttributes . |
protected static ExpirationConfiguration.ExpirationPolicyMetaData |
from(AnnotationAttributes expirationPolicyAttributes)
Factory method to construct an instance of
ExpirationConfiguration.ExpirationPolicyMetaData initialized with
the given AnnotationAttributes from the nested EnableExpiration.ExpirationPolicy annotation
specified in an application-level EnableExpiration annotation. |
protected static ExpirationConfiguration.ExpirationPolicyMetaData |
from(EnableExpiration.ExpirationPolicy expirationPolicy)
Factory method to construct an instance of
ExpirationConfiguration.ExpirationPolicyMetaData initialized with
the given attribute values from the nested EnableExpiration.ExpirationPolicy annotation specified in
an application-level EnableExpiration annotation. |
protected static ExpirationConfiguration.ExpirationPolicyMetaData |
fromDefaults()
Factory method to construct an instance of
ExpirationConfiguration.ExpirationPolicyMetaData using default expiration policy
settings. |
protected boolean |
isIdleTimeout()
Determines whether Idle Timeout Expiration (TTI) was configured for this expiration policy.
|
protected boolean |
isTimeToLive()
Determines whether Time-To-Live Expiration (TTL) was configured for this expiration policy.
|
protected static com.gemstone.gemfire.cache.ExpirationAttributes |
newExpirationAttributes(int timeout,
com.gemstone.gemfire.cache.ExpirationAction action)
Factory method used to construct a new instance of the
ExpirationAttributes initialized with
the given expiration timeout and action that is taken when an Region entry times out. |
protected static com.gemstone.gemfire.cache.ExpirationAttributes |
newExpirationAttributes(int timeout,
ExpirationActionType action)
Factory method used to construct a new instance of the
ExpirationAttributes initialized with
the given expiration timeout and action that is taken when an Region entry times out. |
protected static ExpirationConfiguration.ExpirationPolicyMetaData |
newExpirationPolicyMetaData(int timeout,
ExpirationActionType action,
String[] regionNames,
EnableExpiration.ExpirationType[] types)
Factory method used to construct an instance of
ExpirationConfiguration.ExpirationPolicyMetaData initialized with
the given expiration policy meta-data. |
protected static ExpirationActionType |
resolveAction(ExpirationActionType action)
Resolves the
ExpirationAction used in the expiration policy. |
protected static int |
resolveTimeout(int timeout)
Resolves the expiration timeout used in the expiration policy.
|
protected static final String[] ALL_REGIONS
protected ExpirationPolicyMetaData(int timeout, ExpirationActionType action, Set<String> regionNames, Set<EnableExpiration.ExpirationType> types)
ExpirationConfiguration.ExpirationPolicyMetaData
initialized with the given expiration policy
configuraiton meta-data and Region
expiration settings.timeout
- int value indicating the expiration timeout in seconds.action
- expiration action taken when the Region
entry expires.regionNames
- names of Regions
configured with the expiration policy meta-data.types
- type of expiration algorithm/behavior (TTI/TTL) configured for the Region
.IllegalArgumentException
- if the EnableExpiration.ExpirationType
Set
is empty.EnableExpiration.ExpirationType
,
ExpirationActionType
,
#ExpirationPolicyMetaData(ExpirationAttributes, Set, Set)
,
newExpirationAttributes(int, ExpirationActionType)
,
resolveAction(ExpirationActionType)
,
resolveTimeout(int)
protected ExpirationPolicyMetaData(com.gemstone.gemfire.cache.ExpirationAttributes expirationAttributes, Set<String> regionNames, Set<EnableExpiration.ExpirationType> types)
ExpirationConfiguration.ExpirationPolicyMetaData
initialized with the given expiration policy
configuraiton meta-data and Region
expiration settings.expirationAttributes
- ExpirationAttributes
specifying the expiration timeout in seconds
and expiration action taken when the Region
entry expires.regionNames
- names of Regions
configured with the expiration policy meta-data.types
- type of expiration algorithm/behaviors (TTI/TTL) configured for the Region
.IllegalArgumentException
- if the EnableExpiration.ExpirationType
Set
is empty.EnableExpiration.ExpirationType
,
ExpirationAttributes
protected static ExpirationConfiguration.ExpirationPolicyMetaData from(AnnotationAttributes expirationPolicyAttributes)
ExpirationConfiguration.ExpirationPolicyMetaData
initialized with
the given AnnotationAttributes
from the nested EnableExpiration.ExpirationPolicy
annotation
specified in an application-level EnableExpiration
annotation.expirationPolicyAttributes
- AnnotationAttributes
from a EnableExpiration.ExpirationPolicy
annotation.ExpirationConfiguration.ExpirationPolicyMetaData
initialized from
EnableExpiration.ExpirationPolicy
AnnotationAttributes
.IllegalArgumentException
- if AnnotationAttributes.annotationType()
is not assignable to
EnableExpiration.ExpirationPolicy
.#newExpirationPolicyMetaData(int, ExpirationActionType, String[], ExpirationType[])
,
AnnotationAttributes
protected static ExpirationConfiguration.ExpirationPolicyMetaData from(EnableExpiration.ExpirationPolicy expirationPolicy)
ExpirationConfiguration.ExpirationPolicyMetaData
initialized with
the given attribute values from the nested EnableExpiration.ExpirationPolicy
annotation specified in
an application-level EnableExpiration
annotation.expirationPolicy
- EnableExpiration.ExpirationPolicy
annotation containing the attribute values
used to initialize the ExpirationConfiguration.ExpirationPolicyMetaData
instance.ExpirationConfiguration.ExpirationPolicyMetaData
initialized from
EnableExpiration.ExpirationPolicy
attributes values.EnableExpiration.ExpirationPolicy
,
#newExpirationPolicyMetaData(int, ExpirationActionType, String[], ExpirationType[])
protected static ExpirationConfiguration.ExpirationPolicyMetaData fromDefaults()
ExpirationConfiguration.ExpirationPolicyMetaData
using default expiration policy
settings.#newExpirationPolicyMetaData(int, ExpirationActionType, String[], ExpirationType[])
protected static com.gemstone.gemfire.cache.ExpirationAttributes newExpirationAttributes(int timeout, ExpirationActionType action)
ExpirationAttributes
initialized with
the given expiration timeout and action that is taken when an Region
entry times out.timeout
- int value indicating the expiration timeout in seconds.action
- expiration action to take when the Region
entry times out.ExpirationAttributes
initialized with the given expiration timeout
and action.ExpirationAttributes
,
newExpirationAttributes(int, ExpirationAction)
protected static com.gemstone.gemfire.cache.ExpirationAttributes newExpirationAttributes(int timeout, com.gemstone.gemfire.cache.ExpirationAction action)
ExpirationAttributes
initialized with
the given expiration timeout and action that is taken when an Region
entry times out.timeout
- int value indicating the expiration timeout in seconds.action
- expiration action to take when the Region
entry times out.ExpirationAttributes
initialized with the given expiration timeout
and action.ExpirationAttributes
protected static ExpirationConfiguration.ExpirationPolicyMetaData newExpirationPolicyMetaData(int timeout, ExpirationActionType action, String[] regionNames, EnableExpiration.ExpirationType[] types)
ExpirationConfiguration.ExpirationPolicyMetaData
initialized with
the given expiration policy meta-data.timeout
- int value indicating the expiration timeout in seconds.action
- expiration action taken when the Region
entry expires.regionNames
- names of Regions
configured with the expiration policy meta-data.types
- type of expiration algorithm/behavior (TTI/TTL) configured for the Region
.ExpirationConfiguration.ExpirationPolicyMetaData
initialized with the given expiration policy
meta-data.IllegalArgumentException
- if the EnableExpiration.ExpirationType
array is empty.EnableExpiration.ExpirationType
,
ExpirationActionType
,
#ExpirationPolicyMetaData(ExpirationAttributes, Set, Set)
,
newExpirationAttributes(int, ExpirationActionType)
protected static ExpirationActionType resolveAction(ExpirationActionType action)
ExpirationAction
used in the expiration policy. Defaults to
ExpirationActionType.INVALIDATE
if action
is null.action
- given ExpirationActionType
to evaluate.ExpirationActionType
or the default if action
is null.ExpirationActionType
protected static int resolveTimeout(int timeout)
timeout
is less than 0.timeout
- int value expressing the expiration timeout in seconds.protected boolean accepts(com.gemstone.gemfire.cache.Region region)
Region
.region
- Region
to evaluate.Region
.Region
,
accepts(String)
protected boolean accepts(String regionName)
Region
identified by name.regionName
- name of the Region
to evaluate.Region
identified by name.protected boolean isIdleTimeout()
protected boolean isTimeToLive()
public <K,V> com.gemstone.gemfire.cache.Region<K,V> configure(com.gemstone.gemfire.cache.Region<K,V> region)
ExpirationConfiguration.ExpirationPolicyConfigurer
Region
.configure
in interface ExpirationConfiguration.ExpirationPolicyConfigurer
K
- type
of the Region
keys.V
- type
of the Region
values.region
- Region
who's expiration policy will be configured.Region
.Region
protected com.gemstone.gemfire.cache.ExpirationAttributes defaultExpirationAttributes()
ExpirationAttributes
.ExpirationAttributes
containing the defaults.ExpirationAttributes
Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.