Package org.opensaml.saml.metadata.resolver.impl

# Class AbstractDynamicMetadataResolver.BackingStoreCleanupSweeper

java.lang.Object
java.util.TimerTask
org.opensaml.saml.metadata.resolver.impl.AbstractDynamicMetadataResolver.BackingStoreCleanupSweeper

All Implemented Interfaces:
  `Runnable`

Enclosing class:
  AbstractDynamicMetadataResolver

protected class AbstractDynamicMetadataResolver.BackingStoreCleanupSweeper extends TimerTask
Background maintenance task which cleans expired and idle metadata from the backing store, and removes orphaned entity management data.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Logger.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`BackingStoreCleanupSweeper()`

## Method Summary

Modifier and Type
Method
Description
`private boolean`
`isRemoveData(AbstractDynamicMetadataResolver.EntityManagementData mgmtData, Instant now, Instant earliestValidLastAccessed)`
Determine whether metadata should be removed based on expiration and idle time data.
`private void`
`removeExpiredAndIdleMetadata()`
Purge metadata which is either 1) expired or 2) (if `AbstractDynamicMetadataResolver.isRemoveIdleEntityData()` is true) which hasn't been accessed within the last `AbstractDynamicMetadataResolver.getMaxIdleEntityData()` duration.
`void`
`run()`

### Methods inherited from class java.util.TimerTask

`cancel, scheduledExecutionTime`

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

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

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Logger.

## Constructor Details

### BackingStoreCleanupSweeper

protected BackingStoreCleanupSweeper()

## Method Details

### run

public void run()

Specified by:
  `run` in interface `Runnable`
Specified by:
  `run` in class `TimerTask`

### removeExpiredAndIdleMetadata

private void removeExpiredAndIdleMetadata()
Purge metadata which is either 1) expired or 2) (if `AbstractDynamicMetadataResolver.isRemoveIdleEntityData()` is true) which hasn't been accessed within the last `AbstractDynamicMetadataResolver.getMaxIdleEntityData()` duration.

### isRemoveData

private boolean isRemoveData(@Nonnull AbstractDynamicMetadataResolver.EntityManagementData mgmtData, @Nonnull Instant now, @Nonnull Instant earliestValidLastAccessed)
Determine whether metadata should be removed based on expiration and idle time data.

Parameters:
  `mgmtData` - the management data instance for the entity
  `now` - the current time
  `earliestValidLastAccessed` - the earliest last accessed time which would be valid
Returns:
  true if the entity is expired or exceeds the max idle time, false otherwise