Class AbstractRequestBuilder<T extends RequestAbstractType,BUILDER extends AbstractSAMLObjectBuilder<T>>
- java.lang.Object
-
- se.litsec.opensaml.core.AbstractSAMLObjectBuilder<T>
-
- se.litsec.opensaml.saml2.core.build.AbstractRequestBuilder<T,BUILDER>
-
- Type Parameters:
T- the type of request messageBUILDER- the builder type
- All Implemented Interfaces:
SAMLObjectBuilder<T>
- Direct Known Subclasses:
AbstractAuthnRequestBuilder
public abstract class AbstractRequestBuilder<T extends RequestAbstractType,BUILDER extends AbstractSAMLObjectBuilder<T>> extends AbstractSAMLObjectBuilder<T>
Abstract builder class for building request messages.- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
-
-
Constructor Summary
Constructors Constructor Description AbstractRequestBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tbuild()The default implementation of this method assumes that the object has been built during assignment of its attributes and elements so it simply returns the object.BUILDERconsent(String consent)Assigns theConsentattribute of the request.BUILDERdestination(String destination)Assigns theDestinationattribute of the request.BUILDERextensions(Extensions extensions)Assigns anExtensionselement to the request.protected abstract BUILDERgetThis()In order for us to be able to make chaining calls we need to return the concrete type of the builder.BUILDERid(String id)Assigns theIDattribute of the request.BUILDERissueInstant(Instant instant)Assigns the issue instant.BUILDERissuer(String issuer)Assigns theIssuerelement of the request by adding anIssuerelement having the nameID formaturn:oasis:names:tc:SAML:2.0:nameid-format:entity.BUILDERissuer(Issuer issuer)Assigns theIssuerelement of the request.BUILDERversion(int major, int minor)Assigns the version attribute for the request.BUILDERversion(String version)Assigns the version attribute for the request.-
Methods inherited from class se.litsec.opensaml.core.AbstractSAMLObjectBuilder
getDefaultElementName, getObjectType, object
-
-
-
-
Method Detail
-
build
public T build()
The default implementation of this method assumes that the object has been built during assignment of its attributes and elements so it simply returns the object.Implementations that need to perform additional processing during the build step should override this method.
- Specified by:
buildin interfaceSAMLObjectBuilder<T extends RequestAbstractType>- Overrides:
buildin classAbstractSAMLObjectBuilder<T extends RequestAbstractType>- Returns:
- the built object
-
version
public BUILDER version(int major, int minor)
Assigns the version attribute for the request.If not assigned, the
SAMLVersion.VERSION_20will be assigned as a default.- Parameters:
major- major versionminor- minor version- Returns:
- the builder
-
version
public BUILDER version(String version)
Assigns the version attribute for the request.If not assigned, the
SAMLVersion.VERSION_20will be assigned as a default.- Parameters:
version- the versions- Returns:
- the builder
-
id
public BUILDER id(String id)
Assigns theIDattribute of the request.- Parameters:
id- the ID- Returns:
- the builder
-
issueInstant
public BUILDER issueInstant(Instant instant)
Assigns the issue instant.- Parameters:
instant- the issue instant- Returns:
- the builder
-
destination
public BUILDER destination(String destination)
Assigns theDestinationattribute of the request.- Parameters:
destination- the destination URI- Returns:
- the builder
-
consent
public BUILDER consent(String consent)
Assigns theConsentattribute of the request.- Parameters:
consent- the consent string- Returns:
- the builder
-
issuer
public BUILDER issuer(String issuer)
Assigns theIssuerelement of the request by adding anIssuerelement having the nameID formaturn:oasis:names:tc:SAML:2.0:nameid-format:entity.- Parameters:
issuer- the entityID of the issuer- Returns:
- the builder
- See Also:
issuer(Issuer)
-
issuer
public BUILDER issuer(Issuer issuer)
Assigns theIssuerelement of the request.- Parameters:
issuer- the issuer (will be cloned before assignment)- Returns:
- the builder
-
extensions
public BUILDER extensions(Extensions extensions)
Assigns anExtensionselement to the request.- Parameters:
extensions- the extensions element to add- Returns:
- the builder
-
getThis
protected abstract BUILDER getThis()
In order for us to be able to make chaining calls we need to return the concrete type of the builder.- Returns:
- the concrete type of the builder
-
-