001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2007 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: NameIdentifierMapper.java,v 1.2 2008/06/25 05:47:12 qcheng Exp $
026 *
027 */
028
029
030package com.sun.identity.liberty.ws.disco.plugins;
031
032import com.sun.identity.saml.assertion.NameIdentifier;
033import java.util.Map;
034import java.util.List;
035
036/**
037 * The class <code>NameIdentifierMapper</code> is an interface that is 
038 * used to map user's <code>NameIdentifier</code> from one provider 
039 * to another.
040 * <p>
041 * @supported.all.api
042 *
043 */
044public interface NameIdentifierMapper {
045
046    /**
047     * Returns mapped <code>NameIdentifier</code> for specified user.   
048     * This is used by Discovery Service to generate correct 
049     * <code>NameIdentifier</code> when creating credentials for remote
050     * service provider. A <code>NameIdentifier</code> in encrypted format 
051     * could be returned if the response will be passed through a proxy.
052     * @param spProviderID Provider ID of the service provider to which
053     *     the <code>NameIdentifier</code> needs to be mapped. 
054     * @param idpProviderID Provider ID of the identifier provider.
055     * @param nameId The <code>NameIdentifier</code> needs to be mapped. 
056     * @param userID The user whose mapped <code>NameIdentifier</code> will 
057     *     be returned. The value is the universal identifier of the user.
058     * @return the mapped <code>NameIdentifier</code> for specified user, 
059     *     return null if unable to map the <code>NameIdentifier</code>,
060     *     return original name identifier if no need to map the
061     *     <code>NameIdentifier</code>.
062     */
063
064    public NameIdentifier getNameIdentifier(String spProviderID, 
065        String idpProviderID, NameIdentifier nameId, String userID);
066}