T
- the concrete builder typepublic abstract class AbstractEntityDescriptorBuilder<T extends AbstractSAMLObjectBuilder<EntityDescriptor>> extends AbstractSAMLObjectBuilder<EntityDescriptor>
EntityDescriptor
objects using the builder pattern, and optionally a
template object.
When a template object is used, the builder is created using the AbstractEntityDescriptorBuilder(InputStream)
or AbstractEntityDescriptorBuilder(EntityDescriptor)
constructors. The user may later change, or add, any of
the elements and attributes of the template object using the assignment methods.
Note that no Signature will be included.
Modifier and Type | Field and Description |
---|---|
static String |
ENTITY_CATEGORY_ATTRIBUTE_NAME
The attribute name for the entity category attribute stored as an attribute in the entity attributes extension.
|
static AttributeTemplate |
ENTITY_CATEGORY_TEMPLATE
The attribute template for the entity category attribute stored as an attribute in the entity attributes extension.
|
Constructor and Description |
---|
AbstractEntityDescriptorBuilder()
Constructor setting up the builder with no template.
|
AbstractEntityDescriptorBuilder(EntityDescriptor template)
Constructor setting up the builder with a template
EntityDescriptor . |
AbstractEntityDescriptorBuilder(InputStream resource)
Constructor setting up the builder with a template
EntityDescriptor that is read from a resource. |
Modifier and Type | Method and Description |
---|---|
T |
cacheDuration(Long cacheDuration)
Assigns the cacheDuration attribute for the
EntityDescriptor . |
T |
contactPersons(ContactPerson... contactPersons) |
T |
contactPersons(List<ContactPerson> contactPersons)
Assigns the
ContactPerson elements to the entity descriptor. |
T |
entityAttributesExtension(Attribute... attributes) |
T |
entityAttributesExtension(List<Attribute> attributes)
Adds attributes to the
mdattr:EntityAttributes element that is part of the metadata extension element. |
T |
entityCategories(List<String> entityCategories)
Adds a set of entity categories to the entity category attribute (
http://macedir.org/entity-category ) that
is part of the mdattr:EntityAttributes element that is part of the metadata extension element. |
T |
entityCategories(String... entityCategories) |
T |
entityID(String entityID)
Assigns the entityID for the
EntityDescriptor . |
protected Class<EntityDescriptor> |
getObjectType()
Returns the object type.
|
protected abstract T |
getThis()
In order for us to be able to make chaining calls we need to return the concrete type of the builder.
|
T |
id(String id)
Assigns the ID attribute for the
EntityDescriptor . |
T |
keyDescriptors(KeyDescriptor... keyDescriptors) |
T |
keyDescriptors(List<KeyDescriptor> keyDescriptors)
Adds the key descriptor elements.
|
protected abstract boolean |
matchingSSODescriptorType(EntityDescriptor descriptor)
Checks that the SSO descriptor of the supplied
EntityDescriptor is of the correct type given the factory
bean type. |
T |
nameIDFormats(List<String> nameIDFormats)
Assigns the
md:NameIDFormat elements. |
T |
nameIDFormats(String... nameIDFormats) |
T |
organization(Organization organization)
Assigns the
Organization element to the entity descriptor. |
T |
singleLogoutServices(List<SingleLogoutService> singleLogoutServices)
Adds
md:SingleLogoutService elements to the SSODescriptor . |
T |
singleLogoutServices(SingleLogoutService... singleLogoutServices) |
protected abstract SSODescriptor |
ssoDescriptor()
Returns the SSO role descriptor of the template entity descriptor.
|
T |
uiInfoExtension(UIInfo uiInfo)
Assigns the
mdui:UIInfo element as an extension to the role descriptor. |
T |
validUntil(org.joda.time.DateTime time)
Assigns the valid until time.
|
T |
validUntil(LocalDateTime time)
Assigns the valid until time (using the local time zone).
|
build, object
public static final String ENTITY_CATEGORY_ATTRIBUTE_NAME
public static final AttributeTemplate ENTITY_CATEGORY_TEMPLATE
public AbstractEntityDescriptorBuilder()
EntityDescriptor
object is
created from data assigned using the builder.public AbstractEntityDescriptorBuilder(InputStream resource) throws XMLParserException, UnmarshallingException, IOException
EntityDescriptor
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.resource
- the template resourceIOException
- if the resource can not be readUnmarshallingException
- for unmarshalling errorsXMLParserException
- for XML parsing errorspublic AbstractEntityDescriptorBuilder(EntityDescriptor template) throws UnmarshallingException, MarshallingException
EntityDescriptor
. 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.template
- the templateUnmarshallingException
- for unmarshalling errorsMarshallingException
- for marshalling errorsprotected Class<EntityDescriptor> getObjectType()
getObjectType
in class AbstractSAMLObjectBuilder<EntityDescriptor>
protected abstract T getThis()
protected abstract SSODescriptor ssoDescriptor()
protected abstract boolean matchingSSODescriptorType(EntityDescriptor descriptor)
EntityDescriptor
is 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.
descriptor
- the descriptor to checktrue
if the type is OK, and false
otherwisepublic T entityID(String entityID)
EntityDescriptor
.entityID
- the entityIDpublic T id(String id)
EntityDescriptor
.id
- the IDpublic T cacheDuration(Long cacheDuration)
EntityDescriptor
.cacheDuration
- the cache duration (in milliseconds)public T validUntil(org.joda.time.DateTime time)
time
- valid untilpublic T validUntil(LocalDateTime time)
time
- valid untilpublic T entityAttributesExtension(List<Attribute> attributes)
mdattr:EntityAttributes
element that is part of the metadata extension element.attributes
- a list of attributesentityCategories(String...)
public T entityAttributesExtension(Attribute... attributes)
attributes
- attributes to addentityAttributesExtension(List)
public T entityCategories(List<String> entityCategories)
http://macedir.org/entity-category
) that
is part of the mdattr:EntityAttributes
element 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.
entityCategories
- the entity category values that should be addedentityAttributesExtension(List)
public T entityCategories(String... entityCategories)
entityCategories
- the entity category values that should be addedentityCategories(List)
public T uiInfoExtension(UIInfo uiInfo)
mdui:UIInfo
element as an extension to the role descriptor.
If null
is supplied, the extension will be removed from the template entity descriptor (if present).
uiInfo
- the UIInfo
element (will be cloned before assignment)public T keyDescriptors(List<KeyDescriptor> keyDescriptors)
keyDescriptors
- the key descriptorspublic T keyDescriptors(KeyDescriptor... keyDescriptors)
keyDescriptors
- the key descriptorskeyDescriptors(List)
public T nameIDFormats(List<String> nameIDFormats)
md:NameIDFormat
elements.nameIDFormats
- the nameID format stringspublic T nameIDFormats(String... nameIDFormats)
nameIDFormats
- the nameID format stringsnameIDFormats(List)
public T singleLogoutServices(List<SingleLogoutService> singleLogoutServices)
md:SingleLogoutService
elements to the SSODescriptor
.singleLogoutServices
- single logout service objects (cloned before assignment)public T singleLogoutServices(SingleLogoutService... singleLogoutServices)
singleLogoutServices
- single logout service objects (cloned before assignment)singleLogoutServices(List)
public T organization(Organization organization)
Organization
element to the entity descriptor.organization
- the organization (will be cloned before assignment)public T contactPersons(List<ContactPerson> contactPersons)
ContactPerson
elements to the entity descriptor.contactPersons
- the contact person elements (will be cloned before assignment)public T contactPersons(ContactPerson... contactPersons)
contactPersons
- the contact person elements (will be cloned before assignment)contactPersons(List)
Copyright © 2018 Litsec AB. All rights reserved.