/**
* 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: FSAccountUtils.java,v 1.3 2008/06/25 05:46:40 qcheng Exp $
*
*/
/**
* The utility class contains the helper functions used in
* account management.
*/
public class FSAccountUtils {
/**
* Attribute name to store Account's federation information key
*/
"iplanet-am-user-federation-info-key";
/**
* Attribute name to store Account's federation information.
*/
"iplanet-am-user-federation-info";
/**
* Parses federation information string and put corresponding parts in
* object fields.
*
* @param fedInfoString - String containg federation information.
* @return Account federation information object.
* @throws FSAccountMgmtException if <code>fedInfoString</code> cannot be
* parsed.
*/
throws FSAccountMgmtException {
fedInfoObject = new FSAccountFedInfo();
try {
// Local Name Identifier fields.
}
}
try {
} catch (SAMLException se) {
+ "SAMLException: ", se);
}
} else {
// just ignore two tokens.
}
// Remote Name Identifier fields.
}
}
try {
} catch (SAMLException se) {
+ "SAMLException: ", se);
}
} else {
// just ignore two tokens.
}
fedInfoObject.setRole(true);
fedInfoObject.setRole(false);
} else {
throw new FSAccountMgmtException(
}
} else {
throw new FSAccountMgmtException(
}
if (str.hasMoreTokens()) {
{
fedInfoObject.setAffiliation(true);
}
}
} catch (NoSuchElementException nsee) {
"FSAccountUtils.stringToObject() : NoSuchElementException: ",
nsee);
}
return fedInfoObject;
}
/**
* Returns string equalivent of <code>FSAccountFedInfo</code> object.
*
* @return Account Federation information.
* @param fedInfoObject federation info as an object.
* @exception FSAccountMgmtException if <code>fedInfoObject</code> cannot
* be converted to string.
*/
throws FSAccountMgmtException {
"both NameIdentifiers are null");
throw new FSAccountMgmtException(
}
} else {
"FSAccountUtils.objectToInfoString(): local Name is null");
throw new FSAccountMgmtException(
}
} else {
}
} else {
}
} else {
}
} else {
"FSAccountUtils.objectToInfoString(): remote Name is null");
throw new FSAccountMgmtException(
}
} else {
}
} else {
}
} else {
.append("null");
}
if (fedInfoObject.isRoleIDP()) {
} else {
}
if (fedInfoObject.isFedStatusActive()) {
} else {
}
if(fedInfoObject.getAffiliation()) {
}
}
/**
* Returns nameSpace and name of account federation information key.
*
* @return string equalivent of account federation information key.
* @param fedInfoKeyObject Account federation information key.
* in the fedInfoKeyObject are null.
*/
throws FSAccountMgmtException {
"Invalid Argument : nameSpace is NULL");
throw new FSAccountMgmtException(
}
"Invalid Argument : name is NULL");
throw new FSAccountMgmtException(
}
"FSAccountUtils.objectToKeyString(): Value: " + fedKeyValue);
}
return fedKeyValue;
}
/**
* Creates filter.
* @param providerID provider id
* @return filter
*/
}
/**
* Creates filter.
* @param providerID provider id
* @param nameID name id
* @return filter
*/
+ nameID + FED_INFO_DELIM;
return str;
}
/**
* Creates filter.
* @param fedInfoKey federation info key
* @return filter
* the fedInfoKey are null.
*/
throws FSAccountMgmtException
{
"Invalid Argument : nameSpace is NULL");
throw new FSAccountMgmtException(
}
"Invalid Argument : name is NULL");
throw new FSAccountMgmtException(
}
+ name + FED_INFO_DELIM;
}
}