org.opensaml.saml1.binding.artifact
Class SAML1ArtifactType0002

java.lang.Object
  extended by org.opensaml.common.binding.artifact.SAMLArtifact
      extended by org.opensaml.saml1.binding.artifact.AbstractSAML1Artifact
          extended by org.opensaml.saml1.binding.artifact.SAML1ArtifactType0002

public class SAML1ArtifactType0002
extends AbstractSAML1Artifact

SAML 1 Type 0x0002 Artifact. SAML 1, type 2, artifacts contains a 2 byte type code with a value of 1 followed by a 20 byte assertion handle followed by an unspecified number of bytes which are a UTF-8 encouded source location string.


Field Summary
static byte[] TYPE_CODE
          Artifact type code (0x0002)
 
Fields inherited from class org.opensaml.common.binding.artifact.SAMLArtifact
randomGen
 
Constructor Summary
SAML1ArtifactType0002()
          Constructor
SAML1ArtifactType0002(byte[] assertionHandle, java.lang.String sourceLocation)
          Constructor
SAML1ArtifactType0002(java.lang.String sourceLocation)
          Constructor.
 
Method Summary
 byte[] getAssertionHandle()
          Gets the artifiact's 20 byte assertion handle.
 byte[] getRemainingArtifact()
          Gets the artifact bytes minus the type code.
 java.lang.String getSourceLocation()
          Gets the source location component of this artifact.
static SAML1ArtifactType0002 parseArtifact(byte[] artifact)
          Constructs a SAML 1 artifact from its byte representation.
 void setAssertionHandle(byte[] assertionHandle)
          Sets the artifiact's 20 byte assertion handle.
protected  void setSourceLocation(java.lang.String newLocation)
          Sets source location component of this artifact.
 
Methods inherited from class org.opensaml.common.binding.artifact.SAMLArtifact
base64Encode, equals, getArtifactBytes, getTypeCode, hashCode, hexEncode, setTypeCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_CODE

public static final byte[] TYPE_CODE
Artifact type code (0x0002)

Constructor Detail

SAML1ArtifactType0002

public SAML1ArtifactType0002()
Constructor


SAML1ArtifactType0002

public SAML1ArtifactType0002(java.lang.String sourceLocation)
                      throws java.lang.IllegalArgumentException
Constructor. A 20 byte random number is generated for use as the assertion handle.

Parameters:
sourceLocation - source location artifact component
Throws:
java.lang.IllegalArgumentException - thrown if the given assertion handle is not 20 bytes or the source location is null or empty

SAML1ArtifactType0002

public SAML1ArtifactType0002(byte[] assertionHandle,
                             java.lang.String sourceLocation)
                      throws java.lang.IllegalArgumentException
Constructor

Parameters:
assertionHandle - 20 byte assertion handle artifact component
sourceLocation - source location artifact component
Throws:
java.lang.IllegalArgumentException - thrown if the given assertion handle is not 20 bytes or the source location is null or empty
Method Detail

parseArtifact

public static SAML1ArtifactType0002 parseArtifact(byte[] artifact)
                                           throws java.lang.IllegalArgumentException
Constructs a SAML 1 artifact from its byte representation.

Parameters:
artifact - the byte array representing the artifact
Throws:
java.lang.IllegalArgumentException - thrown if the artifact type is not 0x0002

getAssertionHandle

public byte[] getAssertionHandle()
Gets the artifiact's 20 byte assertion handle.

Returns:
artifiact's 20 byte assertion handle

setAssertionHandle

public void setAssertionHandle(byte[] assertionHandle)
Sets the artifiact's 20 byte assertion handle.

Parameters:
assertionHandle - artifiact's 20 byte assertion handle

getSourceLocation

public java.lang.String getSourceLocation()
Gets the source location component of this artifact.

Returns:
source location component of this artifact

setSourceLocation

protected void setSourceLocation(java.lang.String newLocation)
                          throws java.lang.IllegalArgumentException
Sets source location component of this artifact.

Parameters:
newLocation - source location component of this artifact
Throws:
java.lang.IllegalArgumentException - thrown if the given location is empty or null

getRemainingArtifact

public byte[] getRemainingArtifact()
Gets the artifact bytes minus the type code.

Specified by:
getRemainingArtifact in class SAMLArtifact
Returns:
artifact bytes minus the type code