Class IdpEntityDescriptorBuilder
- java.lang.Object
-
- se.litsec.opensaml.core.AbstractSAMLObjectBuilder<EntityDescriptor>
-
- se.litsec.opensaml.saml2.metadata.build.AbstractEntityDescriptorBuilder<IdpEntityDescriptorBuilder>
-
- se.litsec.opensaml.saml2.metadata.build.IdpEntityDescriptorBuilder
-
- All Implemented Interfaces:
SAMLObjectBuilder<EntityDescriptor>
public class IdpEntityDescriptorBuilder extends AbstractEntityDescriptorBuilder<IdpEntityDescriptorBuilder>
A builder for building anmd:EntityDescription(metadata) object for an Identity Provider.- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
-
-
Field Summary
Fields Modifier and Type Field Description static StringASSURANCE_CERTIFICATION_ATTRIBUTE_NAMEThe attribute name for the assurance certification attribute stored as an attribute in the entity attributes extension.static AttributeTemplateASSURANCE_CERTIFICATION_ATTRIBUTE_TEMPLATEThe attribute template for the assurance certification attribute stored as an attribute in the entity attributes extension.-
Fields inherited from class se.litsec.opensaml.saml2.metadata.build.AbstractEntityDescriptorBuilder
ENTITY_CATEGORY_ATTRIBUTE_NAME, ENTITY_CATEGORY_TEMPLATE
-
-
Constructor Summary
Constructors Constructor Description IdpEntityDescriptorBuilder()Constructor setting up the builder with no template.IdpEntityDescriptorBuilder(InputStream resource)Constructor setting up the builder with a templateEntityDescriptorthat is read from a resource.IdpEntityDescriptorBuilder(EntityDescriptor template)Constructor setting up the builder with a templateEntityDescriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IdpEntityDescriptorBuilderassuranceCertificationUris(String... uris)IdpEntityDescriptorBuilderassuranceCertificationUris(List<String> uris)Adds a set of URIs to the assurance certification attribute (urn:oasis:names:tc:SAML:attribute:assurance-certification) that is part of themdattr:EntityAttributeselement that is part of the metadata extension element.static IdpEntityDescriptorBuilderbuilder()Utility method that creates anIdpEntityDescriptorBuilderinstance.static IdpEntityDescriptorBuilderbuilder(InputStream resource)Utility method that creates anIdpEntityDescriptorBuilderinstance from a supplied input stream.static IdpEntityDescriptorBuilderbuilder(EntityDescriptor template)Utility method that creates anIdpEntityDescriptorBuilderinstance from a supplied template.protected IdpEntityDescriptorBuildergetThis()In order for us to be able to make chaining calls we need to return the concrete type of the builder.protected booleanmatchingSSODescriptorType(EntityDescriptor descriptor)Checks that the SSO descriptor of the suppliedEntityDescriptoris of the correct type given the factory bean type.IdpEntityDescriptorBuildersingleSignOnServices(List<SingleSignOnService> singleSignOnServices)Addsmd:SingleSignOnServiceelements to theIDPSSODescriptor.IdpEntityDescriptorBuildersingleSignOnServices(SingleSignOnService... singleSignOnServices)protected SSODescriptorssoDescriptor()Returns the SSO role descriptor of the template entity descriptor.IdpEntityDescriptorBuilderwantAuthnRequestsSigned(Boolean b)Assigns theWantAuthnRequestsSignedattribute of themd:IDPSSODescriptorelement.-
Methods inherited from class se.litsec.opensaml.saml2.metadata.build.AbstractEntityDescriptorBuilder
cacheDuration, contactPersons, contactPersons, digestMethods, digestMethods, entityAttributesExtension, entityAttributesExtension, entityCategories, entityCategories, entityID, getObjectType, id, keyDescriptors, keyDescriptors, nameIDFormats, nameIDFormats, organization, signingMethods, signingMethods, singleLogoutServices, singleLogoutServices, uiInfoExtension, updateExtensions, validUntil
-
Methods inherited from class se.litsec.opensaml.core.AbstractSAMLObjectBuilder
build, getDefaultElementName, object
-
-
-
-
Field Detail
-
ASSURANCE_CERTIFICATION_ATTRIBUTE_NAME
public static final String ASSURANCE_CERTIFICATION_ATTRIBUTE_NAME
The attribute name for the assurance certification attribute stored as an attribute in the entity attributes extension.- See Also:
- Constant Field Values
-
ASSURANCE_CERTIFICATION_ATTRIBUTE_TEMPLATE
public static final AttributeTemplate ASSURANCE_CERTIFICATION_ATTRIBUTE_TEMPLATE
The attribute template for the assurance certification attribute stored as an attribute in the entity attributes extension.
-
-
Constructor Detail
-
IdpEntityDescriptorBuilder
public IdpEntityDescriptorBuilder()
Constructor setting up the builder with no template. This means that the entireEntityDescriptorobject is created from data assigned using the builder.
-
IdpEntityDescriptorBuilder
public IdpEntityDescriptorBuilder(InputStream resource) throws XMLParserException, UnmarshallingException, IOException
Constructor setting up the builder with a templateEntityDescriptorthat is read from a resource. Users of the bean may now change, add or delete, the elements and attributes of the template object using the assignment methods of the builder.- Parameters:
resource- the template resource- Throws:
IOException- if the resource can not be readUnmarshallingException- for unmarshalling errorsXMLParserException- for XML parsing errors
-
IdpEntityDescriptorBuilder
public IdpEntityDescriptorBuilder(EntityDescriptor template) throws UnmarshallingException, MarshallingException
Constructor setting up the builder with a templateEntityDescriptor. Users of the bean may now change, add or delete, the elements and attributes of the template object using the assignment methods of the builder.- Parameters:
template- the template- Throws:
UnmarshallingException- for unmarshalling errorsMarshallingException- for marshalling errors
-
-
Method Detail
-
builder
public static IdpEntityDescriptorBuilder builder()
Utility method that creates anIdpEntityDescriptorBuilderinstance.- Returns:
- an
IdpEntityDescriptorBuilderinstance
-
builder
public static IdpEntityDescriptorBuilder builder(InputStream resource) throws XMLParserException, UnmarshallingException, IOException
Utility method that creates anIdpEntityDescriptorBuilderinstance from a supplied input stream.- Parameters:
resource- the template resource- Returns:
- an
IdpEntityDescriptorBuilderinstance - Throws:
IOException- if the resource can not be readUnmarshallingException- for unmarshalling errorsXMLParserException- for XML parsing errors
-
builder
public static IdpEntityDescriptorBuilder builder(EntityDescriptor template) throws UnmarshallingException, MarshallingException
Utility method that creates anIdpEntityDescriptorBuilderinstance from a supplied template.- Parameters:
template- the template- Returns:
- an
IdpEntityDescriptorBuilderinstance - Throws:
UnmarshallingException- for unmarshalling errorsMarshallingException- for marshalling errors
-
getThis
protected IdpEntityDescriptorBuilder getThis()
In order for us to be able to make chaining calls we need to return the concrete type of the builder.- Specified by:
getThisin classAbstractEntityDescriptorBuilder<IdpEntityDescriptorBuilder>- Returns:
- the concrete type of the builder
-
ssoDescriptor
protected SSODescriptor ssoDescriptor()
Returns the SSO role descriptor of the template entity descriptor. If no role descriptor is present, the method creates such an object.- Specified by:
ssoDescriptorin classAbstractEntityDescriptorBuilder<IdpEntityDescriptorBuilder>- Returns:
- the role descriptor
-
matchingSSODescriptorType
protected boolean matchingSSODescriptorType(EntityDescriptor descriptor)
Checks that the SSO descriptor of the suppliedEntityDescriptoris of the correct type given the factory bean type.An entity descriptor that does not yet have an SSODescriptor element will also be regarded as a matching type.
- Specified by:
matchingSSODescriptorTypein classAbstractEntityDescriptorBuilder<IdpEntityDescriptorBuilder>- Parameters:
descriptor- the descriptor to check- Returns:
trueif the type is OK, andfalseotherwise
-
wantAuthnRequestsSigned
public IdpEntityDescriptorBuilder wantAuthnRequestsSigned(Boolean b)
Assigns theWantAuthnRequestsSignedattribute of themd:IDPSSODescriptorelement.- Parameters:
b- boolean (ifnull, the attribute is not set)- Returns:
- the builder
-
assuranceCertificationUris
public IdpEntityDescriptorBuilder assuranceCertificationUris(List<String> uris)
Adds a set of URIs to the assurance certification attribute (urn:oasis:names:tc:SAML:attribute:assurance-certification) that is part of themdattr:EntityAttributeselement that is part of the metadata extension element.The method does not update any of the other attributes that may exist in the entity attributes extension.
- Parameters:
uris- the assurance URI values that should be added- Returns:
- the builder
- See Also:
AbstractEntityDescriptorBuilder.entityAttributesExtension(List)
-
assuranceCertificationUris
public IdpEntityDescriptorBuilder assuranceCertificationUris(String... uris)
- Parameters:
uris- the assurance URI values that should be added- Returns:
- the builder
- See Also:
assuranceCertificationUris(List),AbstractEntityDescriptorBuilder.entityAttributesExtension(List)
-
singleSignOnServices
public IdpEntityDescriptorBuilder singleSignOnServices(List<SingleSignOnService> singleSignOnServices)
Addsmd:SingleSignOnServiceelements to theIDPSSODescriptor.- Parameters:
singleSignOnServices- single sign on service objects (cloned before assignment)- Returns:
- the builder
-
singleSignOnServices
public IdpEntityDescriptorBuilder singleSignOnServices(SingleSignOnService... singleSignOnServices)
- Parameters:
singleSignOnServices- single sign on service objects (cloned before assignment)- Returns:
- the builder
- See Also:
AbstractEntityDescriptorBuilder.singleLogoutServices(List)
-
-