public class ParameterCacheImpl extends Object implements ParameterCache
ParameterRequestManager to cache last values of parameters.
The cache will contain the parameters for a predefined time period but can exceed that period if space is available
in the CacheEntry.
A CacheEntry also has a maximum size to prevent it accumulating parameters ad infinitum (e.g. if there are bogus
parameters with the timestamp never changing)
We keep delivery consisting of lists of parameter values together such that
if two parameters have been acquired in the same delivery, they will be given from the same delivery to the clients.
if cacheAll is enabled, all parameters will be cached as they are received.
if cacheAll is disabled:
- a parameter will be put on the list to cache only if somebody has requested it.
- obviously first time when the parameter is requested, no value will be returned.
- however this will greatly reduce the cache size since only a few parameters are monitored in the displays| Constructor and Description |
|---|
ParameterCacheImpl(ParameterCacheConfig cacheConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all the parameters from the cache
|
List<ParameterValue> |
getAllValues(Parameter p)
Returns all values from the cache for the parameter or null if there is no value cached
The parameter are returned in descending order (newest parameter is returned first)
|
List<ParameterValue> |
getAllValues(Parameter p,
long start,
long stop)
Same as above but return all values that have the generation time in the (start, stop] interval
|
ParameterValue |
getLastValue(Parameter p)
Returns last cached value for parameter or null if there is no value in the cache
|
List<ParameterValue> |
getValues(List<Parameter> plist)
Returns cached value for parameter or an empty list if there is no value in the cache
|
void |
update(Collection<ParameterValue> pvs)
update the parameters in the cache
|
public ParameterCacheImpl(ParameterCacheConfig cacheConfig)
public void update(Collection<ParameterValue> pvs)
ParameterCacheupdate in interface ParameterCachepvs - - parameter value listpublic List<ParameterValue> getValues(List<Parameter> plist)
ParameterCachegetValues in interface ParameterCachepublic ParameterValue getLastValue(Parameter p)
ParameterCachegetLastValue in interface ParameterCachep - - parameter for which the last value is returnedpublic List<ParameterValue> getAllValues(Parameter p)
ParameterCachegetAllValues in interface ParameterCachep - - parameter for which all values are returnedpublic List<ParameterValue> getAllValues(Parameter p, long start, long stop)
ParameterCachegetAllValues in interface ParameterCachepublic void clear()
ParameterCacheclear in interface ParameterCacheCopyright © 2018 Space Applications Services. All rights reserved.