Class HealthCheckResultCache


  • public class HealthCheckResultCache
    extends Object
    Caches health check results.
    • Constructor Detail

      • HealthCheckResultCache

        public HealthCheckResultCache()
    • 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 deleted
        results - 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