Class ArtifactImpl
- java.lang.Object
-
- com.sun.identity.saml2.protocol.impl.ArtifactImpl
-
- All Implemented Interfaces:
Artifact
public class ArtifactImpl extends Object implements Artifact
This class implements interfaceArtifact. It models typeurn:oasis:names:tc:SAML:2.0:artifact-04 Artifact.SAML_artifact := B64(TypeCode EndpointIndex RemainingArtifact) TypeCode := Byte1Byte2 EndpointIndex := Byte1Byte2 TypeCode := 0x0004 RemainingArtifact := SourceID messageHandle SourceID := 20-byte_sequence MessageHandle := 20-byte_sequence
-
-
Constructor Summary
Constructors Constructor Description ArtifactImpl(byte[] typecode, int endpointindex, String sourceid, String messagehandle)Constructor.ArtifactImpl(String encodedArtifactValue)Constructor withBase64encodedArtifactvalue.ArtifactImpl(Element element)Class constructor withArtifactinElementformat.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetArtifactValue()Returns the artifact.intgetEndpointIndex()Returns theEndpointIndexof the artifact.StringgetMessageHandle()Returns theMessageHandleof the artifact.StringgetSourceID()Returns theSourceIDof the artifact.byte[]getTypeCode()Returns theTypeCodeof the artifact.StringtoXMLString()Returns a String representation of the element.StringtoXMLString(boolean includeNS, boolean declareNS)Returns a String representation of the element.
-
-
-
Constructor Detail
-
ArtifactImpl
public ArtifactImpl(Element element) throws SAML2Exception
Class constructor withArtifactinElementformat.- Throws:
SAML2Exception
-
ArtifactImpl
public ArtifactImpl(String encodedArtifactValue) throws SAML2Exception
Constructor withBase64encodedArtifactvalue.- Parameters:
encodedArtifactValue- the Artifact value.- Throws:
SAML2Exception- if it fails to instantiate the object.
-
ArtifactImpl
public ArtifactImpl(byte[] typecode, int endpointindex, String sourceid, String messagehandle) throws SAML2ExceptionConstructor.- Parameters:
typecode- two byte sequence representingTypeCode.endpointindex- integer value ofEndpointIndex. Its allowed range is between 0 and 65535.sourceid- String format of 20-byte sequence. Usually obtained from taking the SHA-1 hash of the identification URL (called provider ID).messagehandle- String format of 20-byte sequence identifying a message. This value is constructed from a cryptographically strong random or pseudorandom number sequence.- Throws:
SAML2Exception- if it fails to instantiate the object.
-
-
Method Detail
-
getArtifactValue
public String getArtifactValue()
Returns the artifact.- Specified by:
getArtifactValuein interfaceArtifact- Returns:
- the value of the artifact. It's
Base64encoded.
-
getSourceID
public String getSourceID()
Returns theSourceIDof the artifact.- Specified by:
getSourceIDin interfaceArtifact- Returns:
- The
SourceIDof the artifact.
-
getMessageHandle
public String getMessageHandle()
Returns theMessageHandleof the artifact. The result will be decoded.- Specified by:
getMessageHandlein interfaceArtifact- Returns:
- The
MessageHandleof the artifact.
-
getTypeCode
public byte[] getTypeCode()
Returns theTypeCodeof the artifact.- Specified by:
getTypeCodein interfaceArtifact- Returns:
- The byte array of the
TypeCodefor the artifact.
-
getEndpointIndex
public int getEndpointIndex()
Returns theEndpointIndexof the artifact.- Specified by:
getEndpointIndexin interfaceArtifact- Returns:
- value of the
EndpointIndexfor the artifact.
-
toXMLString
public String toXMLString() throws SAML2Exception
Returns a String representation of the element.- Specified by:
toXMLStringin interfaceArtifact- Returns:
- A string containing the valid XML for this element. By default name space name is prepended to the element name.
- Throws:
SAML2Exception- if the object does not conform to the schema.
-
toXMLString
public String toXMLString(boolean includeNS, boolean declareNS) throws SAML2Exception
Returns a String representation of the element.- Specified by:
toXMLStringin interfaceArtifact- Parameters:
includeNS- Determines whether or not the namespace qualifier is prepended to the Element when converteddeclareNS- Determines whether or not the namespace is declared within the Element.- Returns:
- A string containing the valid XML for this element
- Throws:
SAML2Exception- if the object does not conform to the schema.
-
-