Class EntityDescriptorBuilder
java.lang.Object
se.swedenconnect.opensaml.common.builder.AbstractSAMLObjectBuilder<EntityDescriptor>
se.swedenconnect.opensaml.saml2.metadata.build.EntityDescriptorBuilder
- All Implemented Interfaces:
SAMLObjectBuilder<EntityDescriptor>
A builder for creating
EntityDescriptor objects.- Author:
- Martin Lindström (martin@idsec.se)
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor setting up the builder with no template.EntityDescriptorBuilder(InputStream resource) Constructor setting up the builder with a templateEntityDescriptorthat is read from a resource.EntityDescriptorBuilder(EntityDescriptor template) EntityDescriptorBuilder(EntityDescriptor template, boolean clone) Constructor setting up the builder with a templateEntityDescriptor. -
Method Summary
Modifier and TypeMethodDescriptionstatic EntityDescriptorBuilderbuilder()Utility method that creates anEntityDescriptorBuilderinstance.static EntityDescriptorBuilderbuilder(InputStream resource) Utility method that creates anEntityDescriptorBuilderinstance from a supplied input stream.static EntityDescriptorBuilderbuilder(EntityDescriptor template) Utility method that creates anEntityDescriptorBuilderinstance from a supplied template.static EntityDescriptorBuilderbuilder(EntityDescriptor template, boolean clone) Utility method that creates anEntityDescriptorBuilderinstance from a supplied template.cacheDuration(Long cacheDuration) Assigns the cacheDuration attribute for theEntityDescriptor.cacheDuration(Duration cacheDuration) Assigns the cacheDuration attribute for theEntityDescriptor.contactPersons(List<ContactPerson> contactPersons) Assigns theContactPersonelements to the entity descriptor.contactPersons(ContactPerson... contactPersons) Assigns the entityID for theEntityDescriptor.extensions(Extensions extensions) Assigns metadata extensions.Based on the contents of this object, anExtensionsBuilderis returned.protected Class<EntityDescriptor> Returns the object type.Assigns the ID attribute for theEntityDescriptor.organization(Organization organization) Assigns theOrganizationelement to the entity descriptor.roleDescriptors(List<RoleDescriptor> roleDescriptors) Adds the supplied SSO descriptors.roleDescriptors(RoleDescriptor... roleDescriptors) ssoDescriptor(SSODescriptor ssoDescriptor) Adds one SSO descriptor (which is the most common case).validUntil(Instant time) Assigns the valid until time.Methods inherited from class se.swedenconnect.opensaml.common.builder.AbstractSAMLObjectBuilder
build, getDefaultElementName, object
-
Constructor Details
-
EntityDescriptorBuilder
public EntityDescriptorBuilder()Constructor setting up the builder with no template. This means that the entireEntityDescriptorobject is created from data assigned using the builder. -
EntityDescriptorBuilder
public EntityDescriptorBuilder(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
-
EntityDescriptorBuilder
- Parameters:
template- the template
-
EntityDescriptorBuilder
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 templateclone- whether the template object should be cloned
-
-
Method Details
-
entityID
Assigns the entityID for theEntityDescriptor.- Parameters:
entityID- the entityID- Returns:
- the builder
-
builder
Utility method that creates anEntityDescriptorBuilderinstance.- Returns:
- an EntityDescriptorBuilder instance
-
builder
public static EntityDescriptorBuilder builder(InputStream resource) throws XMLParserException, UnmarshallingException, IOException Utility method that creates anEntityDescriptorBuilderinstance from a supplied input stream.- Parameters:
resource- the template resource- Returns:
- an EntityDescriptorBuilder instance
- Throws:
IOException- if the resource can not be readUnmarshallingException- for unmarshalling errorsXMLParserException- for XML parsing errors
-
builder
Utility method that creates anEntityDescriptorBuilderinstance from a supplied template.- Parameters:
template- the template- Returns:
- an EntityDescriptorBuilder instance
-
builder
Utility method that creates anEntityDescriptorBuilderinstance from a supplied template.- Parameters:
template- the templateclone- whether the template object should be cloned- Returns:
- an EntityDescriptorBuilder instance
-
id
Assigns the ID attribute for theEntityDescriptor.- Parameters:
id- the ID- Returns:
- the builder
-
cacheDuration
Assigns the cacheDuration attribute for theEntityDescriptor.- Parameters:
cacheDuration- the cache duration (in milliseconds)- Returns:
- the builder
-
cacheDuration
Assigns the cacheDuration attribute for theEntityDescriptor.- Parameters:
cacheDuration- the cache duration- Returns:
- the builder
-
validUntil
Assigns the valid until time.- Parameters:
time- valid until- Returns:
- the builder
-
extensions
Assigns metadata extensions.- Parameters:
extensions- the metadata extensions.- Returns:
- the builder
-
getExtensionsBuilder
Based on the contents of this object, anExtensionsBuilderis returned. If the object holds anExtensionsobject, this is fed to the builder (but not cloned).- Returns:
- an
ExtensionsBuilder
-
roleDescriptors
Adds the supplied SSO descriptors.- Parameters:
roleDescriptors- the SSO descriptors to add- Returns:
- the builder
-
roleDescriptors
- Parameters:
roleDescriptors- the SSO descriptors to add- Returns:
- the builder
-
ssoDescriptor
Adds one SSO descriptor (which is the most common case).- Parameters:
ssoDescriptor- the descriptor to add- Returns:
- the builder
-
organization
Assigns theOrganizationelement to the entity descriptor.- Parameters:
organization- the organization (will be cloned before assignment)- Returns:
- the builder
-
contactPersons
Assigns theContactPersonelements to the entity descriptor.- Parameters:
contactPersons- the contact person elements (will be cloned before assignment)- Returns:
- the builder
-
contactPersons
- Parameters:
contactPersons- the contact person elements (will be cloned before assignment)- Returns:
- the builder
- See Also:
-
getObjectType
Returns the object type.- Specified by:
getObjectTypein classAbstractSAMLObjectBuilder<EntityDescriptor>- Returns:
- the object type
-