org.opensaml.saml2.binding.artifact
Class AbstractSAML2Artifact

java.lang.Object
  extended by org.opensaml.common.binding.artifact.SAMLArtifact
      extended by org.opensaml.saml2.binding.artifact.AbstractSAML2Artifact
Direct Known Subclasses:
SAML2ArtifactType0004

public abstract class AbstractSAML2Artifact
extends SAMLArtifact

SAML 2 Artifact base class. SAML 2 artifacts contains a 2 byte type code follwed by a 2 byte endpoint index followed by remaining artifact data.


Field Summary
 
Fields inherited from class org.opensaml.common.binding.artifact.SAMLArtifact
randomGen
 
Constructor Summary
protected AbstractSAML2Artifact(byte[] artifactType)
          Constructor.
  AbstractSAML2Artifact(byte[] artifactType, byte[] index)
          Constructor.
 
Method Summary
 byte[] getArtifactBytes()
          Gets the bytes for the artifact.
 byte[] getEndpointIndex()
          Gets the 2 byte endpoint index for this artifact.
 void setEndpointIndex(byte[] newIndex)
          Sets the 2 byte endpoint index for this artifact.
 
Methods inherited from class org.opensaml.common.binding.artifact.SAMLArtifact
base64Encode, equals, getRemainingArtifact, getTypeCode, hashCode, hexEncode, setTypeCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractSAML2Artifact

protected AbstractSAML2Artifact(byte[] artifactType)
Constructor.

Parameters:
artifactType - artifact type code

AbstractSAML2Artifact

public AbstractSAML2Artifact(byte[] artifactType,
                             byte[] index)
Constructor.

Parameters:
artifactType - artifact type code
index - 2 byte endpoint index of the artifact
Throws:
java.lang.IllegalArgumentException - thrown if the endpoint index, source ID, or message handle arrays are not of the right size
Method Detail

getArtifactBytes

public byte[] getArtifactBytes()
Gets the bytes for the artifact.

Overrides:
getArtifactBytes in class SAMLArtifact
Returns:
the bytes for the artifact

getEndpointIndex

public byte[] getEndpointIndex()
Gets the 2 byte endpoint index for this artifact.

Returns:
2 byte endpoint index for this artifact

setEndpointIndex

public void setEndpointIndex(byte[] newIndex)
Sets the 2 byte endpoint index for this artifact.

Parameters:
newIndex - 2 byte endpoint index for this artifact
Throws:
java.lang.IllegalArgumentException - thrown if the given index is not 2 bytes