Package net.shibboleth.profile.relyingparty

# Class BasicRelyingPartyConfiguration

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.profile.relyingparty.BasicRelyingPartyConfiguration

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

public class BasicRelyingPartyConfiguration extends AbstractIdentifiableInitializableComponent implements RelyingPartyConfiguration, Predicate<ProfileRequestContext>
The configuration that applies to a peer with which the software is communicating.

The name "Relying Party" is historical and encompasses both sources and consumers of identity information.

Since:
  5.0.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private Predicate<ProfileRequestContext>`
`activationCondition`
Predicate that must be true for this configuration to be active for a given request.
`private Predicate<ProfileRequestContext>`
`detailedErrorsPredicate`
Controls whether detailed information about errors should be exposed.
`private Function<ProfileRequestContext,String>`
`issuerLookupStrategy`
Lookup function to supply issuer.
`private Function<ProfileRequestContext,Map<String,ProfileConfiguration>>`
`profileConfigurationsLookupStrategy`
Lookup function to supply `profileConfigurations` property.
`private Function<ProfileRequestContext,SecurityConfiguration>`
`securityConfigurationLookupStrategy`
Lookup function to supply securityConfiguration property.

## Constructor Summary

Constructors
Constructor
Description
`BasicRelyingPartyConfiguration()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getIssuer(ProfileRequestContext profileRequestContext)`
Get the name to use when issuing messages to peers.
`ProfileConfiguration`
`getProfileConfiguration(ProfileRequestContext profileRequestContext, String profileId)`
Get the profile configuration, for the relying party, for the given profile.
`Map<String,ProfileConfiguration>`
`getProfileConfigurations(ProfileRequestContext profileRequestContext)`
Get the unmodifiable set of profile configurations for this relying party.
`SecurityConfiguration`
`getSecurityConfiguration(ProfileRequestContext profileRequestContext)`
Get the default `SecurityConfiguration` to use.
`boolean`
`isDetailedErrors(ProfileRequestContext profileRequestContext)`
Get whether detailed information about errors should be exposed.
`void`
`setActivationCondition(Predicate<ProfileRequestContext> condition)`
Set the condition under which the relying party configuration should be active.
`void`
`setDetailedErrors(boolean flag)`
Set whether detailed information about errors should be exposed.
`void`
`setDetailedErrorsPredicate(Predicate<ProfileRequestContext> condition)`
Set a condition to determine whether detailed information about errors should be exposed.
`void`
`setIssuer(String issuer)`
Set the name to use when issuing messages to peers.
`void`
`setIssuerLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set a lookup strategy for the name to use when issuing messages to peers.
`void`
`setProfileConfigurations(Collection<ProfileConfiguration> configs)`
Set the profile configurations for this relying party.
`void`
`setProfileConfigurationsLookupStrategy(Function<ProfileRequestContext,Map<String,ProfileConfiguration>> strategy)`
Set a lookup strategy for the `profileConfigurations` property.
`void`
`setResponderId(String issuer)`
Deprecated, for removal: This API element is subject to removal in a future version.
`void`
`setResponderIdLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Deprecated, for removal: This API element is subject to removal in a future version.
`void`
`setSecurityConfiguration(SecurityConfiguration configuration)`
Sets the security configuration for this profile.
`void`
`setSecurityConfigurationLookupStrategy(Function<ProfileRequestContext,SecurityConfiguration> strategy)`
Set a lookup strategy for the security configuration.
`boolean`
`test(ProfileRequestContext input)`

### 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

### issuerLookupStrategy

@Nonnull private Function<ProfileRequestContext,String> issuerLookupStrategy
Lookup function to supply issuer.

### detailedErrorsPredicate

@Nonnull private Predicate<ProfileRequestContext> detailedErrorsPredicate
Controls whether detailed information about errors should be exposed.

### securityConfigurationLookupStrategy

@Nonnull private Function<ProfileRequestContext,SecurityConfiguration> securityConfigurationLookupStrategy
Lookup function to supply securityConfiguration property.

### profileConfigurationsLookupStrategy

@Nonnull private Function<ProfileRequestContext,Map<String,ProfileConfiguration>> profileConfigurationsLookupStrategy
Lookup function to supply `profileConfigurations` property.

### activationCondition

@Nonnull private Predicate<ProfileRequestContext> activationCondition
Predicate that must be true for this configuration to be active for a given request.

## Constructor Details

### BasicRelyingPartyConfiguration

public BasicRelyingPartyConfiguration()
Constructor.

## Method Details

### getIssuer

@Nullable @NotEmpty public String getIssuer(@Nullable ProfileRequestContext profileRequestContext)
Get the name to use when issuing messages to peers.

In SAML this is an "entityID", in other protocols it may have other labels.

Specified by:
  `getIssuer` in interface `RelyingPartyConfiguration`
Parameters:
  `profileRequestContext` - current profile request context
Returns:
  name to use when issuing messages

### setIssuer

public void setIssuer(@Nullable @NotEmpty String issuer)
Set the name to use when issuing messages to peers.

Parameters:
  `issuer` - name to set
Since:
  5.0.0

### setIssuerLookupStrategy

public void setIssuerLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
Set a lookup strategy for the name to use when issuing messages to peers.

Parameters:
  `strategy` - lookup strategy
Since:
  5.0.0

### setResponderId

@Deprecated(since="5.0.0", forRemoval=true) public void setResponderId(@Nullable @NotEmpty String issuer)
Deprecated, for removal: This API element is subject to removal in a future version.
Legacy property setter for issuer.

Specified by:
  `setResponderId` in interface `RelyingPartyConfiguration`
Parameters:
  `issuer` - the issuer to set

### setResponderIdLookupStrategy

@Deprecated(since="5.0.0", forRemoval=true) public void setResponderIdLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
Deprecated, for removal: This API element is subject to removal in a future version.
Set a lookup strategy for the issuer property.

Parameters:
  `strategy` - lookup strategy

### isDetailedErrors

public boolean isDetailedErrors(@Nullable ProfileRequestContext profileRequestContext)
Get whether detailed information about errors should be exposed.

Specified by:
  `isDetailedErrors` in interface `RelyingPartyConfiguration`
Parameters:
  `profileRequestContext` - current profile request context
Returns:
  true iff it is acceptable to expose detailed error information

### setDetailedErrors

public void setDetailedErrors(boolean flag)
Set whether detailed information about errors should be exposed.

Parameters:
  `flag` - flag to set

### setDetailedErrorsPredicate

public void setDetailedErrorsPredicate(@Nonnull Predicate<ProfileRequestContext> condition)
Set a condition to determine whether detailed information about errors should be exposed.

Parameters:
  `condition` - condition to set

### getSecurityConfiguration

@Nullable public SecurityConfiguration getSecurityConfiguration(@Nullable ProfileRequestContext profileRequestContext)
Get the default `SecurityConfiguration` to use.

Specified by:
  `getSecurityConfiguration` in interface `RelyingPartyConfiguration`
Parameters:
  `profileRequestContext` - current profile request context
Returns:
  default security configuration

### setSecurityConfiguration

public void setSecurityConfiguration(@Nullable SecurityConfiguration configuration)
Sets the security configuration for this profile.

Parameters:
  `configuration` - security configuration for this profile
Since:
  5.0.0

### setSecurityConfigurationLookupStrategy

public void setSecurityConfigurationLookupStrategy(@Nonnull Function<ProfileRequestContext,SecurityConfiguration> strategy)
Set a lookup strategy for the security configuration.

Parameters:
  `strategy` - lookup strategy
Since:
  5.0.0

### getProfileConfigurations

@Nonnull @Unmodifiable @NotLive public Map<String,ProfileConfiguration> getProfileConfigurations(@Nullable ProfileRequestContext profileRequestContext)
Get the unmodifiable set of profile configurations for this relying party.

Specified by:
  `getProfileConfigurations` in interface `RelyingPartyConfiguration`
Parameters:
  `profileRequestContext` - current profile request context
Returns:
  unmodifiable set of profile configurations for this relying party, never null

### getProfileConfiguration

@Nullable public ProfileConfiguration getProfileConfiguration(@Nullable ProfileRequestContext profileRequestContext, @Nullable String profileId)
Get the profile configuration, for the relying party, for the given profile. This is a convenience method and is equivalent to calling `Map.get(Object)` on the return of `RelyingPartyConfiguration.getProfileConfigurations(ProfileRequestContext)`. This map contains no null entries, keys, or values.

Specified by:
  `getProfileConfiguration` in interface `RelyingPartyConfiguration`
Parameters:
  `profileRequestContext` - current profile request context
  `profileId` - the ID of the profile
Returns:
  the configuration for the profile or null if the profile ID was null or empty or there is no configuration for the given profile

### setProfileConfigurations

public void setProfileConfigurations(@Nullable Collection<ProfileConfiguration> configs)
Set the profile configurations for this relying party.

Parameters:
  `configs` - the configurations to set

### setProfileConfigurationsLookupStrategy

public void setProfileConfigurationsLookupStrategy(@Nonnull Function<ProfileRequestContext,Map<String,ProfileConfiguration>> strategy)
Set a lookup strategy for the `profileConfigurations` property.

Parameters:
  `strategy` - lookup strategy
Since:
  4.0.0

### setActivationCondition

public void setActivationCondition(@Nonnull Predicate<ProfileRequestContext> condition)
Set the condition under which the relying party configuration should be active.

Parameters:
  `condition` - the activation condition

### test

public boolean test(@Nullable ProfileRequestContext input)

Specified by:
  `test` in interface `Predicate<ProfileRequestContext>`