Class MetadataSettings.Builder
java.lang.Object
se.swedenconnect.spring.saml.idp.settings.AbstractSettings.AbstractBuilder<MetadataSettings,MetadataSettings.Builder>
se.swedenconnect.spring.saml.idp.settings.MetadataSettings.Builder
- Enclosing class:
MetadataSettings
public static final class MetadataSettings.Builder
extends AbstractSettings.AbstractBuilder<MetadataSettings,MetadataSettings.Builder>
A builder for
MetadataSettings
.-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Is invoked byAbstractSettings.AbstractBuilder.build()
to apply default values to those settings that are mandatory and has not been assigned.protected MetadataSettings
Is invoked byAbstractSettings.AbstractBuilder.build()
and builds the settings object.cacheDuration
(Duration cacheDuration) Assigns how long the published IdP metadata can remain in a cache.contactPersons
(Map<MetadataSettings.ContactPersonType, MetadataSettings.ContactPersonSettings> contactPersons) Assigns aMap
where the keys areMetadataSettings.ContactPersonType
and the valuesMetadataSettings.ContactPersonSettings
.digestMethods
(List<String> digestMethods) Assigns thealg:DigestMethod
elements that should be included in the metadata.digestMethodsUnderRole
(Boolean underRole) Assigns whetheralg:DigestMethod
elements should be placed in anExtensions
element under the role descriptor (i.e., theIDPSSODescriptor
).encryptionMethods
(List<MetadataSettings.EncryptionMethodSettings> encryptionMethods) Assigns themd:EncryptionMethod
elements that should be included under themd:KeyDescriptor
for the encryption key.organization
(MetadataSettings.OrganizationSettings organization) Assigns theOrganization
element.requestedPrincipalSelection
(List<String> attributeNames) Assigns the attribute names that should be included under theRequestedPrincipalSelection
metadata extension.signingMethods
(List<MetadataSettings.SigningMethodSettings> signingMethods) Assigns thealg:SigningMethod
elements that should be included in the metadata.signingMethodsUnderRole
(Boolean underRole) Assigns whetheralg:SigningMethod
elements should be placed in anExtensions
element under the role descriptor (i.e., theIDPSSODescriptor
).Assigns the template for the IdP metadata.Assigns theMetadataSettings.UIInfoSettings
.validityPeriod
(Duration validityPeriod) Assigns for how long a published metadata entry should be valid.Methods inherited from class se.swedenconnect.spring.saml.idp.settings.AbstractSettings.AbstractBuilder
build, getSettings, getThis, setting, settings
-
Method Details
-
template
Assigns the template for the IdP metadata.- Parameters:
template
- the metadata template- Returns:
- the builder
-
cacheDuration
Assigns how long the published IdP metadata can remain in a cache.- Parameters:
cacheDuration
- the cache duration- Returns:
- the builder
-
validityPeriod
Assigns for how long a published metadata entry should be valid.- Parameters:
validityPeriod
- for how long a published metadata entry should be valid- Returns:
- the builder
-
digestMethods
Assigns thealg:DigestMethod
elements that should be included in the metadata.- Parameters:
digestMethods
- a list of algorithms- Returns:
- the builder
-
digestMethodsUnderRole
Assigns whetheralg:DigestMethod
elements should be placed in anExtensions
element under the role descriptor (i.e., theIDPSSODescriptor
). Iffalse
, thealg:DigestMethod
elements are included as elements in theExtensions
element of theEntityDescriptor
.- Parameters:
underRole
- assign under role- Returns:
- where to place elements
-
signingMethods
public MetadataSettings.Builder signingMethods(List<MetadataSettings.SigningMethodSettings> signingMethods) Assigns thealg:SigningMethod
elements that should be included in the metadata.- Parameters:
signingMethods
- the signing methods- Returns:
- a list of signing methods
-
signingMethodsUnderRole
Assigns whetheralg:SigningMethod
elements should be placed in anExtensions
element under the role descriptor (i.e., theIDPSSODescriptor
). Iffalse
, thealg:SigningMethod
elements are included as elements in theExtensions
element of theEntityDescriptor
.- Parameters:
underRole
- assign under role- Returns:
- where to place elements
-
encryptionMethods
public MetadataSettings.Builder encryptionMethods(List<MetadataSettings.EncryptionMethodSettings> encryptionMethods) Assigns themd:EncryptionMethod
elements that should be included under themd:KeyDescriptor
for the encryption key. Note that these algorithms must match the configured encryption key.- Parameters:
encryptionMethods
- a list ofMetadataSettings.EncryptionMethodSettings
- Returns:
- the builder
-
uiInfo
Assigns theMetadataSettings.UIInfoSettings
.- Parameters:
uiInfo
-MetadataSettings.UIInfoSettings
- Returns:
- the builder
-
requestedPrincipalSelection
Assigns the attribute names that should be included under theRequestedPrincipalSelection
metadata extension.- Parameters:
attributeNames
- list of attribute names- Returns:
- the builder
-
organization
Assigns theOrganization
element.- Parameters:
organization
- anMetadataSettings.OrganizationSettings
- Returns:
- the builder
-
contactPersons
public MetadataSettings.Builder contactPersons(Map<MetadataSettings.ContactPersonType, MetadataSettings.ContactPersonSettings> contactPersons) Assigns aMap
where the keys areMetadataSettings.ContactPersonType
and the valuesMetadataSettings.ContactPersonSettings
.- Parameters:
contactPersons
- a map of contact persons- Returns:
- the builder
-
applyDefaultSettings
protected void applyDefaultSettings()Is invoked byAbstractSettings.AbstractBuilder.build()
to apply default values to those settings that are mandatory and has not been assigned.- Specified by:
applyDefaultSettings
in classAbstractSettings.AbstractBuilder<MetadataSettings,
MetadataSettings.Builder>
-
buildObject
Is invoked byAbstractSettings.AbstractBuilder.build()
and builds the settings object.- Specified by:
buildObject
in classAbstractSettings.AbstractBuilder<MetadataSettings,
MetadataSettings.Builder> - Returns:
- the settings object
-