org.opensaml.common.binding.artifact
Class SAMLArtifactFactory

java.lang.Object
  extended by org.opensaml.common.binding.artifact.SAMLArtifactFactory

public class SAMLArtifactFactory
extends java.lang.Object

Factory for producing SAML artifacts.


Constructor Summary
SAMLArtifactFactory()
          Constructor.
 
Method Summary
 SAMLArtifact buildArtifact(SAMLVersion samlVersion, byte[] artifact)
          Builds a populated artifact from its byte representation.
 SAMLArtifact buildArtifact(SAMLVersion samlVersion, byte[] artifactType, java.lang.String relyingParty)
          Builds the the artifact for a specific version of SAML and artifact type.
protected  SAMLArtifactBuilder getBuilder(SAMLVersion samlVersion, byte[] artifactType)
          Gets the artifact builder for a particular version of SAML and artifact type.
 java.util.Map<java.lang.String,SAMLArtifactBuilder<? extends AbstractSAML1Artifact>> getSAML1ArtifactBuilders()
          Gets the registered SAML 1 artifact builders.
 java.util.Map<java.lang.String,SAMLArtifactBuilder<? extends AbstractSAML2Artifact>> getSAML2ArtifactBuilders()
          Gets the registered SAML 2 artifact builders.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAMLArtifactFactory

public SAMLArtifactFactory()
Constructor.

Method Detail

buildArtifact

public SAMLArtifact buildArtifact(SAMLVersion samlVersion,
                                  byte[] artifactType,
                                  java.lang.String relyingParty)
                           throws BindingException
Builds the the artifact for a specific version of SAML and artifact type. Build artifacts are "empty" and must have their appropriate data set before they can be used.

Parameters:
samlVersion - SAML version
artifactType - the type code of the artifact
relyingParty - the party the artifact is meant for
Returns:
the empty artifact
Throws:
BindingException - thrown if the artifact can not be created usually because no builder was registered for the given version/type

buildArtifact

public SAMLArtifact buildArtifact(SAMLVersion samlVersion,
                                  byte[] artifact)
                           throws BindingException
Builds a populated artifact from its byte representation.

Parameters:
samlVersion - SAML version
artifact - byte representation of the artifact
Returns:
artifact representation of the artifact
Throws:
BindingException - thrown if the given artifact can not be built, usually because there is not builder for the given SAML version/artifact type

getSAML1ArtifactBuilders

public java.util.Map<java.lang.String,SAMLArtifactBuilder<? extends AbstractSAML1Artifact>> getSAML1ArtifactBuilders()
Gets the registered SAML 1 artifact builders. The map key is the string representation of the artifact type (using the default encoding) and the value is the builder. This map is mutable and new builders my be registered through it. Existing builders may be replaced by registering a new builder with the same type.

Returns:
registered SAML 1 artifact builders

getSAML2ArtifactBuilders

public java.util.Map<java.lang.String,SAMLArtifactBuilder<? extends AbstractSAML2Artifact>> getSAML2ArtifactBuilders()
Gets the registered SAML 2 artifact builders. The map key is the string representation of the artifact type (using the default encoding) and the value is the builder. This map is mutable and new builders my be registered through it. Existing builders may be replaced by registering a new builder with the same type.

Returns:
registered SAML 2 artifact builders

getBuilder

protected SAMLArtifactBuilder getBuilder(SAMLVersion samlVersion,
                                         byte[] artifactType)
Gets the artifact builder for a particular version of SAML and artifact type.

Parameters:
samlVersion - the SAML version
artifactType - the artifact type
Returns:
artifact builder for the given SAML version/artifact type or null if no builder is registered