Package org.apache.felix.hc.core.impl.executor

## 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
`HealthCheckResultCache()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clear()` Clear the whole cache
`org.apache.felix.hc.api.execution.HealthCheckExecutionResult` `createExecutionResultWithStickyResults​(org.apache.felix.hc.api.execution.HealthCheckExecutionResult origResult)` Creates a new execution result
`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.
`void` `removeCachedResult​(Long serviceId)` Remove entry from cache
`String` `toString()`
`void` `updateWith​(org.apache.felix.hc.api.execution.HealthCheckExecutionResult result)` Update the cache with the result
`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

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### 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

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`