Class AbstractRequestBuilder<T extends org.opensaml.saml.saml2.core.RequestAbstractType,BUILDER extends AbstractSAMLObjectBuilder<T>>

java.lang.Object
se.swedenconnect.opensaml.common.builder.AbstractSAMLObjectBuilder<T>
se.swedenconnect.opensaml.saml2.core.build.AbstractRequestBuilder<T,BUILDER>
Type Parameters:
T - the type of request message
BUILDER - the builder type
All Implemented Interfaces:
SAMLObjectBuilder<T>
Direct Known Subclasses:
AbstractAuthnRequestBuilder

public abstract class AbstractRequestBuilder<T extends org.opensaml.saml.saml2.core.RequestAbstractType,BUILDER extends AbstractSAMLObjectBuilder<T>> extends AbstractSAMLObjectBuilder<T>
Abstract builder class for building request messages.
Author:
Martin Lindström (martin@idsec.se)
  • Constructor Details

    • AbstractRequestBuilder

      public AbstractRequestBuilder()
  • Method Details

    • 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:
      build in interface SAMLObjectBuilder<T extends org.opensaml.saml.saml2.core.RequestAbstractType>
      Overrides:
      build in class AbstractSAMLObjectBuilder<T extends org.opensaml.saml.saml2.core.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_20 will be assigned as a default.

      Parameters:
      major - major version
      minor - minor version
      Returns:
      the builder
    • version

      public BUILDER version(String version)
      Assigns the version attribute for the request.

      If not assigned, the SAMLVersion.VERSION_20 will be assigned as a default.

      Parameters:
      version - the versions
      Returns:
      the builder
    • id

      public BUILDER id(String id)
      Assigns the ID attribute 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 the Destination attribute of the request.
      Parameters:
      destination - the destination URI
      Returns:
      the builder
    • consent

      public BUILDER consent(String consent)
      Assigns the Consent attribute of the request.
      Parameters:
      consent - the consent string
      Returns:
      the builder
    • issuer

      public BUILDER issuer(String issuer)
      Assigns the Issuer element of the request by adding an Issuer element having the nameID format urn:oasis:names:tc:SAML:2.0:nameid-format:entity.
      Parameters:
      issuer - the entityID of the issuer
      Returns:
      the builder
      See Also:
    • issuer

      public BUILDER issuer(org.opensaml.saml.saml2.core.Issuer issuer)
      Assigns the Issuer element of the request.
      Parameters:
      issuer - the issuer (will be cloned before assignment)
      Returns:
      the builder
    • extensions

      public BUILDER extensions(org.opensaml.saml.saml2.core.Extensions extensions)
      Assigns an Extensions element 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