Package net.shibboleth.idp.consent.flow.impl

# Class ConsentFlowDescriptor

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.profile.interceptor.ProfileInterceptorFlowDescriptor
net.shibboleth.idp.consent.flow.impl.ConsentFlowDescriptor

All Implemented Interfaces:
  `Predicate<ProfileRequestContext>`, `FlowDescriptor`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`

Direct Known Subclasses:
  `AttributeReleaseFlowDescriptor`

public class ConsentFlowDescriptor extends ProfileInterceptorFlowDescriptor
Descriptor for a consent flow. A consent flow models a sequence of actions which retrieves consent from storage as well as extracts consent from user input.

## Field Summary

Fields
Modifier and Type
Field
Description
`private boolean`
`compareValues`
Whether consent equality includes comparing consent values.
`private int`
`expandedMaxStoredRecords`
Expanded maximum number of records stored in the storage service.
`private long`
`expandedStorageThreshold`
Value size at which expanded maximum takes effect.
`private Function<ProfileRequestContext,Duration>`
`lifetimeLookupStrategy`
Time to expire consent storage records.
`private int`
`maxStoredRecords`
Maximum number of records stored in the storage service.

### Fields inherited from class net.shibboleth.idp.profile.interceptor.ProfileInterceptorFlowDescriptor

`FLOW_ID_PREFIX`

## Constructor Summary

Constructors
Constructor
Description
`ConsentFlowDescriptor()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`compareValues()`
Whether consent equality includes comparing consent values.
`int`
`getExpandedNumberOfStoredRecords()`
Get the maximum number of records to keep in the storage service if the expanded size threshold is met.
`long`
`getExpandedStorageThreshold()`
Get the storage value size at which the expanded maximum record size kicks in.
`Duration`
`getLifetime()`
Deprecated, for removal: This API element is subject to removal in a future version.
`Duration`
`getLifetime(ProfileRequestContext profileRequestContext)`
Gets time to expire consent storage records.
`int`
`getMaximumNumberOfStoredRecords()`
Get the maximum number of records to keep in the storage service if the expanded size threshold is not met.
`void`
`setCompareValues(boolean flag)`
Set whether consent equality includes comparing consent values.
`void`
`setExpandedNumberOfStoredRecords(int maximum)`
Set the maximum number of records to keep in the storage service if the expanded size threshold is met.
`void`
`setExpandedStorageThreshold(long size)`
Set the storage value size at which the expanded maximum record size kicks in.
`void`
`setLifetime(Duration consentLifetime)`
Set time to expire consent storage records.
`void`
`setLifetimeLookupStrategy(Function<ProfileRequestContext,Duration> strategy)`
Set lookup strategy for time to expire consent storage records.
`void`
`setMaximumNumberOfStoredRecords(int maximum)`
Set the maximum number of records to keep in the storage service if the expanded size threshold is not met.

### Methods inherited from class net.shibboleth.idp.profile.interceptor.ProfileInterceptorFlowDescriptor

`equals, getStorageService, hashCode, isNonBrowserSupported, setActivationCondition, setNonBrowserSupported, setStorageService, test, toString`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitialized`

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

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

### Methods inherited from interface net.shibboleth.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiableComponent

`setId`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

### Methods inherited from interface java.util.function.Predicate

`and, negate, or`

## Field Details

### compareValues

private boolean compareValues
Whether consent equality includes comparing consent values.

### lifetimeLookupStrategy

@Nullable private Function<ProfileRequestContext,Duration> lifetimeLookupStrategy
Time to expire consent storage records. Default value: null/infinite.

### maxStoredRecords

private int maxStoredRecords
Maximum number of records stored in the storage service.

### expandedMaxStoredRecords

private int expandedMaxStoredRecords
Expanded maximum number of records stored in the storage service.

### expandedStorageThreshold

private long expandedStorageThreshold
Value size at which expanded maximum takes effect. Default value : 1024 * 1024

## Constructor Details

### ConsentFlowDescriptor

public ConsentFlowDescriptor()
Constructor.

## Method Details

### compareValues

public boolean compareValues()
Whether consent equality includes comparing consent values.

Returns:
  true if consent equality includes comparing consent values

### getLifetime

@Deprecated(since="5.2.0", forRemoval=true) @Nullable public Duration getLifetime()
Deprecated, for removal: This API element is subject to removal in a future version.
Gets time to expire consent storage records.

Returns:
  time to expire consent storage records, null for infinite.

  This is deprecated in favor of `getLifetime(ProfileRequestContext)`.

### getLifetime

@Nullable public Duration getLifetime(@Nullable ProfileRequestContext profileRequestContext)
Gets time to expire consent storage records.

Parameters:
  `profileRequestContext` - profile request context
Returns:
  lifetime, or null for infinite

### getMaximumNumberOfStoredRecords

public int getMaximumNumberOfStoredRecords()
Get the maximum number of records to keep in the storage service if the expanded size threshold is not met.

Returns:
  the maximum number of records, or <=0 for no limit

### getExpandedNumberOfStoredRecords

public int getExpandedNumberOfStoredRecords()
Get the maximum number of records to keep in the storage service if the expanded size threshold is met.

Returns:
  the maximum number of records, or <=0 for no limit

### getExpandedStorageThreshold

public long getExpandedStorageThreshold()
Get the storage value size at which the expanded maximum record size kicks in.

Returns:
  storage value size to enable expanded record maximum

### setCompareValues

public void setCompareValues(boolean flag)
Set whether consent equality includes comparing consent values.

Parameters:
  `flag` - true if consent equality includes comparing consent values

### setLifetime

public void setLifetime(@Nullable Duration consentLifetime)
Set time to expire consent storage records.

Parameters:
  `consentLifetime` - time to expire consent storage records. null means infinite

### setLifetimeLookupStrategy

public void setLifetimeLookupStrategy(@Nonnull Function<ProfileRequestContext,Duration> strategy)
Set lookup strategy for time to expire consent storage records.

Parameters:
  `strategy` - lookup strategy
Since:
  5.2.0

### setMaximumNumberOfStoredRecords

public void setMaximumNumberOfStoredRecords(int maximum)
Set the maximum number of records to keep in the storage service if the expanded size threshold is not met.

Parameters:
  `maximum` - the maximum number of records, or <=0 for no limit

### setExpandedNumberOfStoredRecords

public void setExpandedNumberOfStoredRecords(int maximum)
Set the maximum number of records to keep in the storage service if the expanded size threshold is met.

Parameters:
  `maximum` - the maximum number of records, or <=0 for no limit

### setExpandedStorageThreshold

public void setExpandedStorageThreshold(long size)
Set the storage value size at which the expanded maximum record size kicks in.

Defaults to 1024^2

Parameters:
  `size` - size threshold