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: NameIDPolicy.java,v 1.2 2008/06/25 05:47:57 qcheng Exp $
026 *
027 * Portions Copyrighted 2016 ForgeRock AS.
028 */
029
030
031package com.sun.identity.saml2.protocol;
032
033import com.fasterxml.jackson.annotation.JsonTypeInfo;
034import com.sun.identity.saml2.common.SAML2Exception;
035import com.sun.identity.saml2.protocol.impl.NameIDPolicyImpl;
036
037/** 
038 * This interface defines methods to retrieve name identifier related 
039 * properties.
040 *
041 * @supported.all.api
042 */
043
044@JsonTypeInfo(include = JsonTypeInfo.As.PROPERTY, use = JsonTypeInfo.Id.CLASS,
045        defaultImpl = NameIDPolicyImpl.class)
046public interface NameIDPolicy {
047    
048    /** 
049     * Returns the value of <code>Format</code> attribute.
050     *
051     * @return the value of <code>Format</code> attribute.
052     * @see #setFormat(String)
053     */
054    public String getFormat();
055    
056    /** 
057     * Sets the value of the <code>Format</code> attribute.
058     *
059     * @param uri the new value of <code>Format</code> attribute.
060     * @throws SAML2Exception if the object is immutable.
061     * @see #getFormat
062     */
063    public void setFormat(String uri) throws SAML2Exception;
064    
065    /** 
066     * Returns the value of the <code>SPNameQualifier</code> attribute.
067     *
068     * @return the value of <code>SPNameQualifier</code> attribute.
069     * @see #setSPNameQualifier(String)
070     */
071    public String getSPNameQualifier();
072    
073    /** 
074     * Sets the value of <code>SPNameQualifier</code> attribute.
075     *
076     * @param spNameQualifier new value of <code>SPNameQualifier</code> 
077     *        attribute.
078     * @throws SAML2Exception if the object is immutable.
079     * @see #getSPNameQualifier
080     */
081    public void setSPNameQualifier(String spNameQualifier) throws SAML2Exception ;
082    
083    /** 
084     * Sets the value of <code>AllowCreate</code> attribute.
085     *
086     * @param allowCreate the new value of <code>AllowCreate</code> attribute.
087     * @throws SAML2Exception if the object is immutable.
088     */
089    public void setAllowCreate(boolean allowCreate) throws SAML2Exception ;
090    
091    /** 
092     * Returns true if the identity provider is allowed to create a
093     * new identifier to represent the principal.
094     *
095     * @return value of <code>AllowCreate</code> attribute.
096     */
097    public boolean isAllowCreate();
098    
099    /** 
100     * Returns a String representation of this Object.
101     *
102     * @return String representation of this Object.
103     * @throws SAML2Exception if cannot create String object.
104     */
105    public String toXMLString() throws SAML2Exception ;
106    
107    /** 
108     * Returns a String representation of this object.
109     *
110     * @param includeNSPrefix determines whether or not the namespace
111     *        qualifier is prepended to the Element when converted
112     * @param declareNS determines whether or not the namespace is declared
113     *        within the Element.
114     * @return String representation of this Object.
115     * @throws SAML2Exception if cannot create String object.
116     */
117    
118    public String toXMLString(boolean includeNSPrefix,boolean declareNS)
119    throws SAML2Exception ;
120        
121    /** 
122     * Makes this object immutable. 
123     */
124    public void makeImmutable() ;
125    
126    /** 
127     * Returns true if object is mutable.
128     *
129     * @return true if object is mutable.
130     */
131    public boolean isMutable();
132}