Class EntityDescriptorBuilder
java.lang.Object
se.swedenconnect.opensaml.common.builder.AbstractSAMLObjectBuilder<org.opensaml.saml.saml2.metadata.EntityDescriptor>
se.swedenconnect.opensaml.saml2.metadata.build.EntityDescriptorBuilder
- All Implemented Interfaces:
SAMLObjectBuilder<org.opensaml.saml.saml2.metadata.EntityDescriptor>
public class EntityDescriptorBuilder
extends AbstractSAMLObjectBuilder<org.opensaml.saml.saml2.metadata.EntityDescriptor>
A builder for creating
EntityDescriptor
objects.- Author:
- Martin Lindström (martin@idsec.se)
-
Constructor Summary
ConstructorDescriptionConstructor 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
(org.opensaml.saml.saml2.metadata.EntityDescriptor template) EntityDescriptorBuilder
(org.opensaml.saml.saml2.metadata.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
(org.opensaml.saml.saml2.metadata.EntityDescriptor template) Utility method that creates anEntityDescriptorBuilder
instance from a supplied template.static EntityDescriptorBuilder
builder
(org.opensaml.saml.saml2.metadata.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<org.opensaml.saml.saml2.metadata.ContactPerson> contactPersons) Assigns theContactPerson
elements to the entity descriptor.contactPersons
(org.opensaml.saml.saml2.metadata.ContactPerson... contactPersons) Assigns the entityID for theEntityDescriptor
.extensions
(org.opensaml.saml.saml2.metadata.Extensions extensions) Assigns metadata extensions.Based on the contents of this object, anExtensionsBuilder
is returned.protected Class
<org.opensaml.saml.saml2.metadata.EntityDescriptor> Returns the object type.Assigns the ID attribute for theEntityDescriptor
.organization
(org.opensaml.saml.saml2.metadata.Organization organization) Assigns theOrganization
element to the entity descriptor.roleDescriptors
(List<org.opensaml.saml.saml2.metadata.RoleDescriptor> roleDescriptors) Adds the supplied SSO descriptors.roleDescriptors
(org.opensaml.saml.saml2.metadata.RoleDescriptor... roleDescriptors) ssoDescriptor
(org.opensaml.saml.saml2.metadata.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 net.shibboleth.shared.xml.XMLParserException, org.opensaml.core.xml.io.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 readorg.opensaml.core.xml.io.UnmarshallingException
- for unmarshalling errorsnet.shibboleth.shared.xml.XMLParserException
- for XML parsing errors
-
EntityDescriptorBuilder
public EntityDescriptorBuilder(org.opensaml.saml.saml2.metadata.EntityDescriptor template) - Parameters:
template
- the template
-
EntityDescriptorBuilder
public EntityDescriptorBuilder(org.opensaml.saml.saml2.metadata.EntityDescriptor template, boolean clone) 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 net.shibboleth.shared.xml.XMLParserException, org.opensaml.core.xml.io.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 readorg.opensaml.core.xml.io.UnmarshallingException
- for unmarshalling errorsnet.shibboleth.shared.xml.XMLParserException
- for XML parsing errors
-
builder
public static EntityDescriptorBuilder builder(org.opensaml.saml.saml2.metadata.EntityDescriptor template) Utility method that creates anEntityDescriptorBuilder
instance from a supplied template.- Parameters:
template
- the template- Returns:
- an EntityDescriptorBuilder instance
-
builder
public static EntityDescriptorBuilder builder(org.opensaml.saml.saml2.metadata.EntityDescriptor template, boolean clone) 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
public EntityDescriptorBuilder roleDescriptors(List<org.opensaml.saml.saml2.metadata.RoleDescriptor> roleDescriptors) Adds the supplied SSO descriptors.- Parameters:
roleDescriptors
- the SSO descriptors to add- Returns:
- the builder
-
roleDescriptors
public EntityDescriptorBuilder roleDescriptors(org.opensaml.saml.saml2.metadata.RoleDescriptor... roleDescriptors) - Parameters:
roleDescriptors
- the SSO descriptors to add- Returns:
- the builder
-
ssoDescriptor
public EntityDescriptorBuilder ssoDescriptor(org.opensaml.saml.saml2.metadata.SSODescriptor ssoDescriptor) Adds one SSO descriptor (which is the most common case).- Parameters:
ssoDescriptor
- the descriptor to add- Returns:
- the builder
-
organization
public EntityDescriptorBuilder organization(org.opensaml.saml.saml2.metadata.Organization organization) Assigns theOrganization
element to the entity descriptor.- Parameters:
organization
- the organization (will be cloned before assignment)- Returns:
- the builder
-
contactPersons
public EntityDescriptorBuilder contactPersons(List<org.opensaml.saml.saml2.metadata.ContactPerson> contactPersons) Assigns theContactPerson
elements to the entity descriptor.- Parameters:
contactPersons
- the contact person elements (will be cloned before assignment)- Returns:
- the builder
-
contactPersons
public EntityDescriptorBuilder contactPersons(org.opensaml.saml.saml2.metadata.ContactPerson... 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<org.opensaml.saml.saml2.metadata.EntityDescriptor>
- Returns:
- the object type
-