org.opensaml.common.binding.artifact
Class SAMLArtifact

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

public abstract class SAMLArtifact
extends java.lang.Object

Base class for SAML artifacts.


Field Summary
protected  java.security.SecureRandom randomGen
          Random number generator.
 
Constructor Summary
protected SAMLArtifact(byte[] code)
          Constructor.
 
Method Summary
 java.lang.String base64Encode()
          Gets the Base64 encoded artifact.
 boolean equals(java.lang.Object o)
          
 byte[] getArtifactBytes()
          Gets the bytes for the artifact.
abstract  byte[] getRemainingArtifact()
          Gets the artifact bytes minus the type code.
 byte[] getTypeCode()
          Gets the 2 byte type code for this artifact.
 int hashCode()
          
 java.lang.String hexEncode()
          Gets the hex encoded artifact.
protected  void setTypeCode(byte[] newTypeCode)
          Sets the 2 byte type code for this artifact.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

randomGen

protected java.security.SecureRandom randomGen
Random number generator.

Constructor Detail

SAMLArtifact

protected SAMLArtifact(byte[] code)
Constructor.

Parameters:
code - the artifact type code
Throws:
java.lang.IllegalArgumentException - thrown if the given type code is not two bytes in length
Method Detail

getArtifactBytes

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

Returns:
the bytes for the artifact

getTypeCode

public byte[] getTypeCode()
Gets the 2 byte type code for this artifact.

Returns:
the type code for this artifact

setTypeCode

protected void setTypeCode(byte[] newTypeCode)
Sets the 2 byte type code for this artifact.

Parameters:
newTypeCode - 2 byte type code for this artifact
Throws:
java.lang.IllegalArgumentException - thrown if the given type code is not two bytes

getRemainingArtifact

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

Returns:
artifact bytes minus the type code

base64Encode

public java.lang.String base64Encode()
Gets the Base64 encoded artifact.

Returns:
Base64 encoded artifact.

hexEncode

public java.lang.String hexEncode()
Gets the hex encoded artifact.

Returns:
hex encoded artifact

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object