Class HealthCheckResultCache
- java.lang.Object
-
- org.apache.felix.hc.core.impl.executor.HealthCheckResultCache
-
public class HealthCheckResultCache extends Object
Caches health check results.
-
-
Constructor Summary
Constructors Constructor Description HealthCheckResultCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear the whole cacheorg.apache.felix.hc.api.execution.HealthCheckExecutionResult
createExecutionResultWithStickyResults(org.apache.felix.hc.api.execution.HealthCheckExecutionResult origResult)
Creates a new execution resultorg.apache.felix.hc.api.execution.HealthCheckExecutionResult
getValidCacheResult(org.apache.felix.hc.api.execution.HealthCheckMetadata metadata, long resultCacheTtlInMs)
Return the cached result if it's still valid.void
removeCachedResult(Long serviceId)
Remove entry from cacheString
toString()
void
updateWith(org.apache.felix.hc.api.execution.HealthCheckExecutionResult result)
Update the cache with the resultvoid
useValidCacheResults(List<org.apache.felix.hc.api.execution.HealthCheckMetadata> metadatas, Collection<org.apache.felix.hc.api.execution.HealthCheckExecutionResult> results, long resultCacheTtlInMs)
Get the valid cache results for given metadata list
-
-
-
Method Detail
-
updateWith
public void updateWith(org.apache.felix.hc.api.execution.HealthCheckExecutionResult result)
Update the cache with the result
-
useValidCacheResults
public void useValidCacheResults(List<org.apache.felix.hc.api.execution.HealthCheckMetadata> metadatas, Collection<org.apache.felix.hc.api.execution.HealthCheckExecutionResult> results, long resultCacheTtlInMs)
Get the valid cache results for given metadata list- Parameters:
metadatas
- list of metadata to get results for. For each found result the metadata will be deletedresults
- matching cached results are added to this list
-
getValidCacheResult
public org.apache.felix.hc.api.execution.HealthCheckExecutionResult getValidCacheResult(org.apache.felix.hc.api.execution.HealthCheckMetadata metadata, long resultCacheTtlInMs)
Return the cached result if it's still valid.
-
createExecutionResultWithStickyResults
public org.apache.felix.hc.api.execution.HealthCheckExecutionResult createExecutionResultWithStickyResults(org.apache.felix.hc.api.execution.HealthCheckExecutionResult origResult)
Creates a new execution result- Parameters:
origResult
-- Returns:
-
clear
public void clear()
Clear the whole cache
-
removeCachedResult
public void removeCachedResult(Long serviceId)
Remove entry from cache
-
-