/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: NameIDInfo.java,v 1.3 2008/06/25 05:47:45 qcheng Exp $
*
*/
/**
* This class <code>NameIDInfo</code> represents the user account
* federation information stored in the repository.
* The name of attribute name is sun-fm-saml2-nameid-info.
* This multiple-valued attribute is used to store all information
* related to the name identifier, such as IDP, SP entity id, role, etc.
* Value format for this attribute:
* <hosted_entity_id>|<remote_entity_id>|<idp_nameid>|<idp_nameid_qualifier>|
* <idp_nameid_format>|<sp_nameid>|<sp_nameid_qualifier>|<hosted_entity_role>|
* <is_affiliation>
* where:
* <hosted_entity_id> : entity id for this hosted entity
* <remote_entity_id> : entity id for the remote entity
* <idp_nameid> : name identifier for the IDP
* <idp_nameid_qualifier>: nameid qualifier for the IDP
* <idp_nameid_format> : nameid format for the IDP
* <sp_nameid> : name identifier for the SP/Affiliation
* <sp_nameid_qualifier> : nameid qualifier for the SP/Affiliation
* <hosted_entity_role> : value of SPRole, IDPRole or DualRole.
* <is_affiliation> : true for affiliation, false otherwise
* for example:
* vPQyHXLnSWLAVh2BoI3gdUrhanC1|http://www.idp.com|
* urn:oasis:names:tc:SAML:2.0:nameid-format:persistent|
* g6lD46kMqDGSsFPawoFrw4iNf86C|http://www.sp.com|SPRole|false
*/
public class NameIDInfo {
private boolean _isAffiliation = false;
/**
* Private contstructor.
*/
private NameIDInfo() {}
/**
* Constructor
* @param hostEntityID <code>EntityID</code> of the hosted entity.
* @param remoteEntityID <code>EntityID</code> of the remote entity.
* @param nameID <code>NameID</code> object.
* @param hostEntityRole the role of the hosted entity.
* @param isAffiliation true if this account federation information
* is an affilation based federation.
* @exception SAML2Exception if any of the parameter values are null.
*/
public NameIDInfo (
boolean isAffiliation
) throws SAML2Exception {
"nullNameID"));
}
if(hostEntityID == null) {
"nullHostEntityID"));
}
if(remoteEntityID == null) {
"nullRemoteEntityID"));
}
if(hostEntityRole == null) {
"nullEntityRole"));
}
}
/**
* Returns the <code>NameID</code> object.
* @return the <code>NameID</code> object.
*/
return _nameID;
}
/**
* Returns the <code>NameIDInfoKey</code>
* @return the <code>NameID</code> object.
* @exception SAML2Exception if any failure.
*/
}
/**
* Returns the <code>NameID</code> value.
* @return the value of the <code>NameID</code>.
*/
return _nameIDValue;
}
/**
* Returns the value of the <code>NameQualifier</code>.
* @return the value of the <code>NameQualifier</code>.
*/
return _nameQualifier;
}
/**
* Returns the value of the <code>NameID</code> format.
* @return the value of the <code>NameID</code> format.
*/
return _format;
}
/**
* Returns the Service Provider provided <code>NameID</code> value.
* @return the value of the Service Provider provided <code>NameID</code>.
*/
return _spNameIDValue;
}
/**
* Returns the Service Provider provided <code>NameID</code>'s
* Name Qualifier.
* @return the value of Service Provider provided <code>NameID</code>'s
* Name Qualifier.
*/
return _spNameQualifier;
}
/**
* Returns the <code>EntityID</code> of the hosted provider.
* @return the <code>EntityID</code> of the hosted provider.
*/
return _hostEntityID;
}
/**
* Returns the <code>EntityID</code> of the remote provider.
* @return the <code>EntityID</code> of the remote provider.
*/
return _remoteEntityID;
}
/**
* Returns the role of the host entity.
* @return the role of the host entity.
*/
return _role;
}
/**
* Checks if this is an affiliation based federation.
* @return true if this is an affiliation based federation.
*/
public boolean isAffiliation() {
return _isAffiliation;
}
/**
* Returns the account federation information key value string that is
* stored in the repository.
* @return the value of the <code>NameIDInfo</code> that is
* stored in the repository.
*/
} else {
}
} else {
}
} else {
}
} else {
}
} else {
}
}
/**
* Returns the <code>NameIDInfo</code> by parsing the string value.
* @return the <code>NameIDInfo</code>
* @exception SAML2Exception if the parsing fails.
*/
"nullNameIDInfo"));
}
"inValidNameIDInfo"));
}
}
}
}
}
}
}