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: AuthnContext.java,v 1.2 2008/06/25 05:47:40 qcheng Exp $
026 *
027 */
028
029
030
031package com.sun.identity.saml2.assertion;
032
033import java.util.List;
034import com.sun.identity.saml2.common.SAML2Exception;
035
036/**
037 * The <code>AuthnContext</code> element specifies the context of an
038 * authentication event. The element can contain an authentication context
039 * class reference, an authentication declaration or declaration reference,
040 * or both. Its type is <code>AuthnContextType</code>.
041 * <p>
042 * <pre>
043 * &lt;complexType name="AuthnContextType">
044 *   &lt;complexContent>
045 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
046 *       &lt;sequence>
047 *         &lt;choice>
048 *           &lt;sequence>
049 *             &lt;element ref="{urn:oasis:names:tc:SAML:2.0:assertion}
050 *             AuthnContextClassRef"/>
051 *             &lt;choice minOccurs="0">
052 *               &lt;element ref="{urn:oasis:names:tc:SAML:2.0:assertion}
053 *               AuthnContextDecl"/>
054 *               &lt;element ref="{urn:oasis:names:tc:SAML:2.0:assertion}
055 *               AuthnContextDeclRef"/>
056 *             &lt;/choice>
057 *           &lt;/sequence>
058 *           &lt;choice>
059 *             &lt;element ref="{urn:oasis:names:tc:SAML:2.0:assertion}
060 *             AuthnContextDecl"/>
061 *             &lt;element ref="{urn:oasis:names:tc:SAML:2.0:assertion}
062 *             AuthnContextDeclRef"/>
063 *           &lt;/choice>
064 *         &lt;/choice>
065 *         &lt;element ref="{urn:oasis:names:tc:SAML:2.0:assertion}
066 *         AuthenticatingAuthority" maxOccurs="unbounded" minOccurs="0"/>
067 *       &lt;/sequence>
068 *     &lt;/restriction>
069 *   &lt;/complexContent>
070 * &lt;/complexType>
071 * </pre>
072 * @supported.all.api
073 */
074public interface AuthnContext {
075
076    /**
077     * Makes the object immutable.
078     */
079    public void makeImmutable();
080
081    /**
082     * Returns the mutability of the object.
083     *
084     * @return <code>true</code> if the object is mutable;
085     *                <code>false</code> otherwise.
086     */
087    public boolean isMutable();
088
089    /**
090     * Returns the value of the <code>AuthnContextClassRef</code> property.
091     *
092     * @return the value of the <code>AuthnContextClassRef</code>.
093     * @see #setAuthnContextClassRef(String)
094     */
095    public String getAuthnContextClassRef();
096
097    /**
098     * Sets the value of the <code>AuthnContextClassRef</code> property.
099     *
100     * @param value new <code>AuthenticationContextClassRef</code>.
101     * @throws SAML2Exception if the object is immutable.
102     * @see #getAuthnContextClassRef()
103     */
104    public void setAuthnContextClassRef(String value)
105        throws SAML2Exception;
106
107    /**
108     * Returns the value of the <code>AuthnContextDeclRef</code> property.
109     *
110     * @return A String representing authentication context
111     *                 declaration reference.
112     * @see #setAuthnContextDeclRef(String)
113     */
114    public String getAuthnContextDeclRef();
115
116    /**
117     * Sets the value of the <code>AuthnContextDeclRef</code> property.
118     *
119     * @param value A String representation of authentication context
120     *                declaration reference.
121     * @throws SAML2Exception if the object is immutable.
122     * @see #getAuthnContextDeclRef()
123     */
124    public void setAuthnContextDeclRef(String value)
125        throws SAML2Exception;
126
127    /**
128     * Returns the value of the <code>AuthnContextDecl</code> property.
129     *
130     * @return An XML String representing authentication context declaration.
131     * @see #setAuthnContextDecl(String)
132     */
133    public String getAuthnContextDecl();
134
135    /**
136     * Sets the value of the <code>AuthnContextDecl</code> property.
137     *
138     * @param value An xml String representing authentication context
139     *                declaration.
140     * @throws SAML2Exception if the object is immutable.
141     * @see #getAuthnContextDecl()
142     */
143    public void setAuthnContextDecl(String value)
144        throws SAML2Exception;
145
146    /**
147     * Sets the value of the <code>AuthenticatingAuthority</code> property.
148     *
149     * @param value List of Strings representing authenticating authority
150     * @throws SAML2Exception if the object is immutable.
151     * @see #getAuthenticatingAuthority()
152     */
153    public void setAuthenticatingAuthority(List value)
154        throws SAML2Exception;
155
156    /**
157     * Returns the value of the <code>AuthenticatingAuthority</code> property.
158     *
159     * @return List of Strings representing
160     *                <code>AuthenticatingAuthority</code>.
161     * @see #setAuthenticatingAuthority(List)
162     */
163    public List getAuthenticatingAuthority();
164
165    /**
166     * Returns a String representation of the element.
167     *
168     * @return A string containing the valid XML for this element.
169     *         By default name space name is prepended to the element name.
170     * @throws SAML2Exception if the object does not conform to the schema.
171     */
172    public String toXMLString()
173        throws SAML2Exception;
174
175    /**
176     * Returns a String representation of the element.
177     *
178     * @param includeNS Determines whether or not the namespace qualifier is
179     *                prepended to the Element when converted
180     * @param declareNS Determines whether or not the namespace is declared
181     *                within the Element.
182     * @return A string containing the valid XML for this element
183     * @throws SAML2Exception if the object does not conform to the schema.
184     */
185    public String toXMLString(boolean includeNS, boolean declareNS)
186        throws SAML2Exception;
187
188}




























































Copyright © 2010-2017, ForgeRock All Rights Reserved.