Package net.shibboleth.idp.relyingparty
Class RelyingPartyConfiguration
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.relyingparty.RelyingPartyConfiguration
- All Implemented Interfaces:
Predicate<ProfileRequestContext>
,Component
,DestructableComponent
,IdentifiableComponent
,IdentifiedComponent
,InitializableComponent
public class RelyingPartyConfiguration
extends AbstractIdentifiableInitializableComponent
implements IdentifiedComponent, Predicate<ProfileRequestContext>
The configuration that applies to a given relying party.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Predicate<ProfileRequestContext>
Predicate that must be true for this configuration to be active for a given request.private Predicate<ProfileRequestContext>
Controls whether detailed information about errors should be exposed.private final org.slf4j.Logger
Class logger.Lookup function to supplyprofileConfigurations
property.private Function<ProfileRequestContext,
String> Lookup function to supplyresponderId
property. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
getProfileConfiguration
(ProfileRequestContext profileRequestContext, String profileId) Get the profile configuration, for the relying party, for the given profile.getProfileConfigurations
(ProfileRequestContext profileRequestContext) Get the unmodifiable set of profile configurations for this relying party.getResponderId
(ProfileRequestContext profileRequestContext) Get the self-referential ID to use when responding to requests.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
Set the profile configurations for this relying party.void
setProfileConfigurationsLookupStrategy
(Function<ProfileRequestContext, Map<String, ProfileConfiguration>> strategy) Set a lookup strategy for theprofileConfigurations
property.void
setResponderId
(String responder) Set the self-referential ID to use when responding to messages.void
Set a lookup strategy for theresponderId
property.boolean
test
(ProfileRequestContext input) Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
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.utilities.java.support.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
responderIdLookupStrategy
Lookup function to supplyresponderId
property. -
detailedErrorsPredicate
Controls whether detailed information about errors should be exposed. -
profileConfigurationsLookupStrategy
@Nonnull private Function<ProfileRequestContext,Map<String, profileConfigurationsLookupStrategyProfileConfiguration>> Lookup function to supplyprofileConfigurations
property. -
activationCondition
Predicate that must be true for this configuration to be active for a given request.
-
-
Constructor Details
-
RelyingPartyConfiguration
public RelyingPartyConfiguration()Constructor.
-
-
Method Details
-
getResponderId
@Nonnull @NotEmpty public String getResponderId(@Nullable ProfileRequestContext profileRequestContext) Get the self-referential ID to use when responding to requests.- Parameters:
profileRequestContext
- current profile request context- Returns:
- ID to use when responding
-
setResponderId
Set the self-referential ID to use when responding to messages.- Parameters:
responder
- ID to use when responding to messages
-
setResponderIdLookupStrategy
Set a lookup strategy for theresponderId
property.- Parameters:
strategy
- lookup strategy- Since:
- 3.4.0
-
isDetailedErrors
Get whether detailed information about errors should be exposed.- 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
Set a condition to determine whether detailed information about errors should be exposed.- Parameters:
condition
- condition to set
-
getProfileConfigurations
@Nonnull @NonnullElements @Unmodifiable @NotLive public Map<String,ProfileConfiguration> getProfileConfigurations(@Nullable ProfileRequestContext profileRequestContext) Get the unmodifiable set of profile configurations for this relying party.- 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 callingMap.get(Object)
on the return ofgetProfileConfigurations(ProfileRequestContext)
. This map contains no null entries, keys, or values.- Parameters:
profileRequestContext
- current profile request contextprofileId
- 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 @NonnullElements 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 theprofileConfigurations
property.- Parameters:
strategy
- lookup strategy- Since:
- 4.0.0
-
setActivationCondition
Set the condition under which the relying party configuration should be active.- Parameters:
condition
- the activation condition
-
doInitialize
- Overrides:
doInitialize
in classAbstractIdentifiedInitializableComponent
- Throws:
ComponentInitializationException
-
test
- Specified by:
test
in interfacePredicate<ProfileRequestContext>
-