a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * The contents of this file are subject to the terms
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * of the Common Development and Distribution License
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * (the License). You may not use this file except in
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * compliance with the License.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * You can obtain a copy of the License at
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * See the License for the specific language governing
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * permission and limitations under the License.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * When distributing Covered Code, include this CDDL
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Header Notice in each file and include the License file
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * If applicable, add the following below the CDDL Header,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * with the fields enclosed by brackets [] replaced by
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * your own identifying information:
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * $Id: NameIDInfoKey.java,v 1.2 2008/06/25 05:47:45 qcheng Exp $
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * This class <code>NameIDInfoKey</code> represents the user account
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * federation information key: sun-fm-saml2-nameid-info-key.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * This multiple-valued attribute is used for searching purpose, in case
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * of ldap datastore, an equality index need to be created for this
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * attribute for better search performance.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Value format for this attribute:
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * <hosted_entity_id>|<remote_entity_id>|<idp_nameid>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * <hosted_entity_id> : entity id for this hosted entity
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * <remote_entity_id> : entity id for the remote entity
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * <idp_nameid> : name identifier for the IDP
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * for example:
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * http://www.sp1.com|http://www.idp1.com|vPQyHXLnSWLAVh2BoI3gdUrhanC1
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Private contstructor.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Constructor
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param nameIDValue randomly generated name identifier value.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param hostEntityID <code>EntityID</code> of the hosted provider.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param remoteEntityID <code>EntityID</code> of the remote provider.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @exception SAML2Exception if any of the parameter values are null.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster throw new SAML2Exception(SAML2Utils.bundle.getString(
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster "nullNameIDValue"));
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster throw new SAML2Exception(SAML2Utils.bundle.getString(
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster "nullHostEntityID"));
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster throw new SAML2Exception(SAML2Utils.bundle.getString(
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster "nullRemoteEntityID"));
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Returns the <code>NameID</code> value.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @return the value of the <code>NameID</code>.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Returns the <code>EntityID</code> of the hosted provider.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @return the <code>EntityID</code> of the hosted provider.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Returns the <code>EntityID</code> of the remote provider.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @return the <code>EntityID</code> of the remote provider.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Returns the account federation information key value string that is
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * stored in the repository.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @return the value of the <code>NameIDInfoKey</code> that is
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * stored in the repository.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Returns the <code>NameIDInfoKey</code> by parsing the string value.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @return the <code>NameIDInfoKey</code>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @exception SAML2Exception if the parsing fails.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster public static NameIDInfoKey parse(String infoKey) throws SAML2Exception {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster throw new SAML2Exception(SAML2Utils.bundle.getString(
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster "nullNameIDInfoKey"));
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster StringTokenizer st = new StringTokenizer(infoKey, DELIM);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster throw new SAML2Exception(SAML2Utils.bundle.getString(
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster "inValidNameIDInfoKey"));