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 templateEntityDescriptor
that 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 EntityDescriptorBuilder
builder()
Utility method that creates anEntityDescriptorBuilder
instance.static EntityDescriptorBuilder
builder
(InputStream resource) Utility method that creates anEntityDescriptorBuilder
instance from a supplied input stream.static EntityDescriptorBuilder
builder
(EntityDescriptor template) Utility method that creates anEntityDescriptorBuilder
instance from a supplied template.static EntityDescriptorBuilder
builder
(EntityDescriptor template, boolean clone) Utility method that creates anEntityDescriptorBuilder
instance 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 theContactPerson
elements 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, anExtensionsBuilder
is returned.protected Class
<EntityDescriptor> Returns the object type.Assigns the ID attribute for theEntityDescriptor
.organization
(Organization organization) Assigns theOrganization
element 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 entireEntityDescriptor
object is created from data assigned using the builder. -
EntityDescriptorBuilder
public EntityDescriptorBuilder(InputStream resource) throws XMLParserException, UnmarshallingException, IOException Constructor setting up the builder with a templateEntityDescriptor
that 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 anEntityDescriptorBuilder
instance.- Returns:
- an EntityDescriptorBuilder instance
-
builder
public static EntityDescriptorBuilder builder(InputStream resource) throws XMLParserException, UnmarshallingException, IOException Utility method that creates anEntityDescriptorBuilder
instance 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 anEntityDescriptorBuilder
instance from a supplied template.- Parameters:
template
- the template- Returns:
- an EntityDescriptorBuilder instance
-
builder
Utility method that creates anEntityDescriptorBuilder
instance 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, anExtensionsBuilder
is returned. If the object holds anExtensions
object, 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 theOrganization
element to the entity descriptor.- Parameters:
organization
- the organization (will be cloned before assignment)- Returns:
- the builder
-
contactPersons
Assigns theContactPerson
elements 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:
getObjectType
in classAbstractSAMLObjectBuilder<EntityDescriptor>
- Returns:
- the object type
-