@ThreadSafe public class PullUpCacheDurationStage extends BaseIteratingStage<Element>
| Modifier and Type | Field and Description |
|---|---|
private long |
maxCacheDuration
The maximum cache duration in milliseconds.
|
private long |
minCacheDuration
The minimum cache duration in milliseconds.
|
| Constructor and Description |
|---|
PullUpCacheDurationStage() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doExecute(Item<Element> item)
Processes a given Item.
|
long |
getMaximumCacheDuration()
Gets the maximum cache duration in milliseconds.
|
long |
getMinimumCacheDuration()
Gets the minimum cache duration in milliseconds.
|
protected Long |
getShortestCacheDuration(Element descriptor)
Gets the shortest cache duration for a given entity or entities descriptor and all its descendant descriptors.
|
protected void |
setCacheDuration(Element descriptor,
Long cacheDuration)
Sets the cache duration on the given descriptor.
|
void |
setMaximumCacheDuration(long duration)
Sets the maximum cache duration in milliseconds.
|
void |
setMinimumCacheDuration(long duration)
Sets the minimum cache duration in milliseconds.
|
doExecuteexecute, getCollectionPredicate, setCollectionPredicatesetIddoInitialize, getIddestroy, doDestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, isDestroyedprivate long minCacheDuration
0private long maxCacheDuration
public long getMinimumCacheDuration()
public void setMinimumCacheDuration(long duration)
duration - the minimum cache duration in millisecondspublic long getMaximumCacheDuration()
public void setMaximumCacheDuration(long duration)
duration - maximum cache duration in milliseconds, must be greater than 0protected boolean doExecute(@Nonnull Item<Element> item) throws StageProcessingException
doExecute in class BaseIteratingStage<Element>item - Item on which to operateStageProcessingException - thrown if there is a problem with the stage processingprotected Long getShortestCacheDuration(@Nonnull Element descriptor)
descriptor - descriptor from which to get the shortest cache durationprotected void setCacheDuration(@Nonnull Element descriptor, @Nullable Long cacheDuration)
minCacheDuration then the minimum cache
duration is set. If the given cache duration is greater than maxCacheDuration then the maximum cache
duration is set. Otherwise the given cache duration is set.descriptor - entity or entities descriptor to receive the cache duration, never nullcacheDuration - cache duration to be set, may be nullCopyright © 1999–2016. All rights reserved.