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: Subject.java,v 1.2 2008/06/25 05:47:41 qcheng Exp $
026 *
027 * Portions Copyrighted 2015 ForgeRock AS.
028 */
029
030
031package com.sun.identity.saml2.assertion;
032
033import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
034import com.sun.identity.saml2.assertion.impl.SubjectImpl;
035import com.sun.identity.saml2.common.SAML2Exception;
036import java.util.List;
037
038/** 
039 * The <code>Subject</code> specifies the principal that is the subject
040 * of all of the statements in the assertion. It contains an identifier,
041 * a series of one or more subject confirmations, or both.
042 *
043 * @supported.all.api
044 */
045@JsonDeserialize(as=SubjectImpl.class)
046public interface Subject {
047
048    /**
049     *  Returns the encrypted identifier
050     *
051     *  @return the encrypted identifier
052     */
053    public EncryptedID getEncryptedID();
054
055    /**
056     *  Sets the encrypted identifier
057     *
058     *  @param value the encrypted identifier
059     *  @exception SAML2Exception if the object is immutable
060     */
061    public void setEncryptedID(EncryptedID value) throws SAML2Exception;
062
063    /**
064     *  Returns the identifier in <code>NameID</code> format
065     *
066     *  @return the identifier in <code>NameID</code> format
067     */
068    public NameID getNameID();
069
070    /**
071     *  Sets the identifier in <code>NameID</code> format
072     *
073     *  @param value the identifier in <code>NameID</code> format
074     *  @exception SAML2Exception if the object is immutable
075     */
076    public void setNameID(NameID value) throws SAML2Exception;
077
078    /** 
079     * Returns a list of subject confirmations
080     *
081     * @return a list of subject confirmations
082     */
083    public List getSubjectConfirmation();
084
085    /** 
086     * Sets a list of subject confirmations
087     *
088     * @param confirmations a list of subject confirmations
089     *  @exception SAML2Exception if the object is immutable
090     */
091    public void setSubjectConfirmation(List confirmations)
092        throws SAML2Exception;
093
094    /**
095     *  Returns the identifier in <code>BaseID</code> format
096     *
097     *  @return the identifier in <code>BaseID</code> format
098     */
099    public BaseID getBaseID();
100
101    /**
102     *  Sets the identifier in <code>BaseID</code> format
103     *
104     *  @param value the identifier in <code>BaseID</code> format
105     *  @exception SAML2Exception if the object is immutable
106     */
107    public void setBaseID(BaseID value) throws SAML2Exception;
108
109   /**
110    * Returns a String representation
111    * @param includeNSPrefix Determines whether or not the namespace qualifier
112    *        is prepended to the Element when converted
113    * @param declareNS Determines whether or not the namespace is declared
114    *        within the Element.
115    * @return A String representation
116    * @exception SAML2Exception if something is wrong during conversion
117     */
118    public String toXMLString(boolean includeNSPrefix, boolean declareNS)
119     throws SAML2Exception;
120
121   /**
122    * Returns a String representation
123    *
124    * @return A String representation
125    * @exception SAML2Exception if something is wrong during conversion
126    */
127    public String toXMLString() throws SAML2Exception;
128
129   /**
130    * Makes the object immutable
131    */
132    public void makeImmutable();
133
134   /**
135    * Returns true if the object is mutable
136    *
137    * @return true if the object is mutable
138    */
139    public boolean isMutable();
140
141}