Class AbstractRequestGenerator<T extends RequestAbstractType,I extends RequestGeneratorInput>
- java.lang.Object
-
- se.litsec.opensaml.saml2.common.request.AbstractRequestGenerator<T,I>
-
- Type Parameters:
T- the request typeI- the type of the input required by this generator
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean,RequestGenerator<T,I>
- Direct Known Subclasses:
AbstractAuthnRequestGenerator
public abstract class AbstractRequestGenerator<T extends RequestAbstractType,I extends RequestGeneratorInput> extends Object implements RequestGenerator<T,I>, org.springframework.beans.factory.InitializingBean
Abstract base class for request generators.- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
-
-
Constructor Summary
Constructors Constructor Description AbstractRequestGenerator(String entityID)Constructor assigning the Service Provider entityID.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()protected RequestHttpObject<T>buildRequestHttpObject(T request, I input, String binding, String destination)protected RequestHttpObject<T>buildRequestHttpObject(T request, I input, String binding, String destination, EntityDescriptor recipientMetadata)Builds a request HTTP object (including signing).protected RequestHttpObject<T>buildRequestHttpObject(T request, I input, String binding, String destination, EntityDescriptor recipientMetadata, SignatureSigningConfiguration defaultSignatureSigningConfiguration)Builds a request HTTP object (including signing).protected StringgenerateID()Generates a request ID.protected abstract StringgetDefaultBinding()Returns the binding URI for the binding the generator should use if there are more than one possible choice.StringgetEntityID()Returns the entityID for the Service Provider this request generator is serving.StringgetName()Returns the display name (for logging etc).protected EntityDescriptorgetPeerMetadata(RequestGeneratorInput input, PeerMetadataResolver metadataResolver)Returns the peer metadata.protected RandomgetRandomizer()Returns the randomizer for generation of ID:s etc.protected X509CredentialgetSigningCredentials()Returns the signature credentials.voidsetName(String name)The human readable name for the SP instancevoidsetSigningCredentials(X509Credential signingCredentials)Assigns the signature credentials for the SP.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface se.litsec.opensaml.saml2.common.request.RequestGenerator
generateRequest
-
-
-
-
Constructor Detail
-
AbstractRequestGenerator
public AbstractRequestGenerator(String entityID)
Constructor assigning the Service Provider entityID.- Parameters:
entityID- the entityID
-
-
Method Detail
-
getPeerMetadata
protected EntityDescriptor getPeerMetadata(RequestGeneratorInput input, PeerMetadataResolver metadataResolver) throws RequestGenerationException
Returns the peer metadata.- Parameters:
input- the request generation inputmetadataResolver- the metadata resolver- Returns:
- peer metadata
- Throws:
RequestGenerationException- if no metadata is found
-
buildRequestHttpObject
@Deprecated protected RequestHttpObject<T> buildRequestHttpObject(T request, I input, String binding, String destination) throws RequestGenerationException
Deprecated.Builds a request HTTP object (including signing).- Parameters:
request- the actual requestinput- the request generation inputbinding- the binding to usedestination- the destination URL- Returns:
- a request HTTP object
- Throws:
RequestGenerationException- for errors during signing or encoding
-
buildRequestHttpObject
protected RequestHttpObject<T> buildRequestHttpObject(T request, I input, String binding, String destination, EntityDescriptor recipientMetadata) throws RequestGenerationException
Builds a request HTTP object (including signing).- Parameters:
request- the actual requestinput- the request generation inputbinding- the binding to usedestination- the destination URLrecipientMetadata- the recipient metadata (may benull)- Returns:
- a request HTTP object
- Throws:
RequestGenerationException- for errors during signing or encoding
-
buildRequestHttpObject
protected RequestHttpObject<T> buildRequestHttpObject(T request, I input, String binding, String destination, EntityDescriptor recipientMetadata, SignatureSigningConfiguration defaultSignatureSigningConfiguration) throws RequestGenerationException
Builds a request HTTP object (including signing).- Parameters:
request- the actual requestinput- the request generation inputbinding- the binding to usedestination- the destination URLrecipientMetadata- the recipient metadata (may benull)defaultSignatureSigningConfiguration- the default signature configuration for the application. Ifnull, the value returned fromSecurityConfigurationSupport.getGlobalSignatureSigningConfiguration()will be used- Returns:
- a request HTTP object
- Throws:
RequestGenerationException- for errors during signing or encoding
-
generateID
protected String generateID()
Generates a request ID.- Returns:
- request ID
-
getSigningCredentials
protected X509Credential getSigningCredentials()
Returns the signature credentials.- Returns:
- the signature credentials
-
getRandomizer
protected Random getRandomizer()
Returns the randomizer for generation of ID:s etc.- Returns:
- randomizer instance
-
getDefaultBinding
protected abstract String getDefaultBinding()
Returns the binding URI for the binding the generator should use if there are more than one possible choice. May be overridden byRequestGeneratorInput.getPreferredBinding().- Returns:
- binding URI
-
getEntityID
public String getEntityID()
Returns the entityID for the Service Provider this request generator is serving.- Specified by:
getEntityIDin interfaceRequestGenerator<T extends RequestAbstractType,I extends RequestGeneratorInput>- Returns:
- the entityID
-
getName
public String getName()
Returns the display name (for logging etc).- Specified by:
getNamein interfaceRequestGenerator<T extends RequestAbstractType,I extends RequestGeneratorInput>- Returns:
- the name
-
setName
public void setName(String name)
The human readable name for the SP instance- Parameters:
name- the name
-
setSigningCredentials
public void setSigningCredentials(X509Credential signingCredentials)
Assigns the signature credentials for the SP. If not assigned, signing will not be possible.- Parameters:
signingCredentials- signature credentials
-
-