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 voidIs invoked byAbstractSettings.AbstractBuilder.build()to apply default values to those settings that are mandatory and has not been assigned.protected MetadataSettingsIs 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 aMapwhere the keys areMetadataSettings.ContactPersonTypeand the valuesMetadataSettings.ContactPersonSettings.digestMethods(List<String> digestMethods) Assigns thealg:DigestMethodelements that should be included in the metadata.digestMethodsUnderRole(Boolean underRole) Assigns whetheralg:DigestMethodelements should be placed in anExtensionselement under the role descriptor (i.e., theIDPSSODescriptor).encryptionMethods(List<MetadataSettings.EncryptionMethodSettings> encryptionMethods) Assigns themd:EncryptionMethodelements that should be included under themd:KeyDescriptorfor the encryption key.organization(MetadataSettings.OrganizationSettings organization) Assigns theOrganizationelement.requestedPrincipalSelection(List<String> attributeNames) Assigns the attribute names that should be included under theRequestedPrincipalSelectionmetadata extension.signingMethods(List<MetadataSettings.SigningMethodSettings> signingMethods) Assigns thealg:SigningMethodelements that should be included in the metadata.signingMethodsUnderRole(Boolean underRole) Assigns whetheralg:SigningMethodelements should be placed in anExtensionselement 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:DigestMethodelements that should be included in the metadata.- Parameters:
digestMethods- a list of algorithms- Returns:
- the builder
-
digestMethodsUnderRole
Assigns whetheralg:DigestMethodelements should be placed in anExtensionselement under the role descriptor (i.e., theIDPSSODescriptor). Iffalse, thealg:DigestMethodelements are included as elements in theExtensionselement of theEntityDescriptor.- Parameters:
underRole- assign under role- Returns:
- where to place elements
-
signingMethods
public MetadataSettings.Builder signingMethods(List<MetadataSettings.SigningMethodSettings> signingMethods) Assigns thealg:SigningMethodelements that should be included in the metadata.- Parameters:
signingMethods- the signing methods- Returns:
- a list of signing methods
-
signingMethodsUnderRole
Assigns whetheralg:SigningMethodelements should be placed in anExtensionselement under the role descriptor (i.e., theIDPSSODescriptor). Iffalse, thealg:SigningMethodelements are included as elements in theExtensionselement of theEntityDescriptor.- Parameters:
underRole- assign under role- Returns:
- where to place elements
-
encryptionMethods
public MetadataSettings.Builder encryptionMethods(List<MetadataSettings.EncryptionMethodSettings> encryptionMethods) Assigns themd:EncryptionMethodelements that should be included under themd:KeyDescriptorfor 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 theRequestedPrincipalSelectionmetadata extension.- Parameters:
attributeNames- list of attribute names- Returns:
- the builder
-
organization
Assigns theOrganizationelement.- Parameters:
organization- anMetadataSettings.OrganizationSettings- Returns:
- the builder
-
contactPersons
public MetadataSettings.Builder contactPersons(Map<MetadataSettings.ContactPersonType, MetadataSettings.ContactPersonSettings> contactPersons) Assigns aMapwhere the keys areMetadataSettings.ContactPersonTypeand 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:
applyDefaultSettingsin classAbstractSettings.AbstractBuilder<MetadataSettings,MetadataSettings.Builder>
-
buildObject
Is invoked byAbstractSettings.AbstractBuilder.build()and builds the settings object.- Specified by:
buildObjectin classAbstractSettings.AbstractBuilder<MetadataSettings,MetadataSettings.Builder> - Returns:
- the settings object
-