001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
005 *
006 * The contents of this file are subject to the terms
007 * of the Common Development and Distribution License
008 * (the License). You may not use this file except in
009 * compliance with the License.
010 *
011 * You can obtain a copy of the License at
012 * https://opensso.dev.java.net/public/CDDLv1.0.html or
013 * opensso/legal/CDDLv1.0.txt
014 * See the License for the specific language governing
015 * permission and limitations under the License.
016 *
017 * When distributing Covered Code, include this CDDL
018 * Header Notice in each file and include the License file
019 * at opensso/legal/CDDLv1.0.txt.
020 * If applicable, add the following below the CDDL Header,
021 * with the fields enclosed by brackets [] replaced by
022 * your own identifying information:
023 * "Portions Copyrighted [year] [name of copyright owner]"
024 *
025 * $Id: Artifact.java,v 1.2 2008/06/25 05:47:55 qcheng Exp $
026 *
027 * Portions Copyrighted 2016 ForgeRock AS.
028 */
029
030
031
032package com.sun.identity.saml2.protocol;
033
034import com.fasterxml.jackson.annotation.JsonTypeInfo;
035import com.sun.identity.saml2.common.SAML2Exception;
036import com.sun.identity.saml2.protocol.impl.ArtifactImpl;
037
038/**
039 * This class represents the <code>Artifact</code> element in
040 * SAMLv2 protocol schema.
041 * <p>
042 * <pre>
043 * &lt;element name="Artifact" type="{http://www.w3.org/2001/XMLSchema}string"/>
044 * </pre>
045 *
046 * @supported.all.api
047 */
048
049@JsonTypeInfo(include = JsonTypeInfo.As.PROPERTY, use = JsonTypeInfo.Id.CLASS,
050        defaultImpl = ArtifactImpl.class)
051public interface Artifact {
052
053    /**
054     * Returns the artifact.
055     *
056     * @return the value of the artifact. It's <code>Base64</code>
057     *          encoded.
058     */
059    public String getArtifactValue();
060
061    /**
062     * Returns the <code>SourceID</code> of the artifact.
063     *
064     * @return The <code>SourceID</code> of the artifact.
065     */
066    public String getSourceID();
067
068    /**
069     * Returns the <code>MessageHandle</code> of the artifact.
070     *          The result will be decoded.
071     *
072     * @return The <code>MessageHandle</code> of the artifact.
073     */
074    public String getMessageHandle();
075
076    /**
077     * Returns the <code>TypeCode</code> of the artifact.
078     * @return The byte array of the <code>TypeCode</code> for the artifact.
079     */
080    public byte[] getTypeCode();
081
082    /**
083     * Returns the <code>EndpointIndex</code> of the artifact.
084     * @return value of the <code>EndpointIndex</code> for the
085     *          artifact.
086     */
087    public int getEndpointIndex();
088
089    /**
090     * Returns a String representation of the element.
091     *
092     * @return A string containing the valid XML for this element.
093     *          By default name space name is prepended to the element name.
094     * @throws SAML2Exception if the object does not conform to the schema.
095     */
096    public String toXMLString()
097        throws SAML2Exception;
098
099    /**
100     * Returns a String representation of the element.
101     *
102     * @param includeNS Determines whether or not the namespace qualifier is
103     *          prepended to the Element when converted
104     * @param declareNS Determines whether or not the namespace is declared
105     *          within the Element.
106     * @return A string containing the valid XML for this element
107     * @throws SAML2Exception if the object does not conform to the schema.
108     */
109    public String toXMLString(boolean includeNS, boolean declareNS)
110        throws SAML2Exception;
111
112}