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: AttributeMapper.java,v 1.4 2008/08/19 19:11:13 veiming Exp $
026 *
027 */
028
029
030package com.sun.identity.saml.plugins;
031
032import com.sun.identity.saml.assertion.Assertion;
033import com.sun.identity.saml.common.SAMLException;
034import com.sun.identity.saml.protocol.AttributeQuery;
035
036import java.util.List;
037
038/**
039 * The class <code>AttributeMapper</code> is an interface that is 
040 * implemented to get SSO information and map partner attributes to
041 * OpenSSO attributes.
042 * <p>
043 * A different implementation of the interface may be developed for different
044 * partner. The mapping between the partner source ID and the implementation
045 * class are configured at the <code>Trusted Partner Sites</code> field
046 * in SAML service.
047 *
048 * @supported.all.api
049 */
050public interface AttributeMapper {
051
052    /**
053     * Returns the single sign on token id to OpenSSO from the query.
054     * @param query The received <code>AttributeQuery</code>.
055     * @return String which is the single sign on token ID.
056     */
057    public String getSSOTokenID(AttributeQuery query);
058
059    /**
060     * Returns the Assertion that contains Authentication information that
061     * can be used to obtain single sign on token.
062     *
063     * @param query The received <code>AttributeQuery</code>.
064     * @return Assertion The assertion contained inside the query.
065     */
066    public Assertion getSSOAssertion(AttributeQuery query);
067
068    /**
069     * Returns Attributes for the user.
070     *
071     * @param query The received <code>AttributeQuery</code>.
072     * @param sourceID source ID for the site from which the query originated.
073     * @param token User' session to retrieve the attributes.
074     * @return A List of Attributes
075     * @exception SAMLException if an error occurs
076     */
077    public List getAttributes(AttributeQuery query, String sourceID,
078         Object token) throws SAMLException;
079}