AMFormatUtils.java revision 8af80418ba1ec431c8027fa9668e5678658d3611
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 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: AMFormatUtils.java,v 1.5 2009/01/28 05:34:56 ww203982 Exp $
*
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
/**
* <code>AMFormatUtils</code> provides a set of formating methods
*/
public class AMFormatUtils
implements AMAdminConstants
{
/**
* Sorts items in a set.
*
* @param collection to sort.
* @param locale of user.
* @return list of sorted items.
*/
}
return sorted;
}
/**
* Reverses key to value String-String map i.e. key of map becomes
* the value; and value becomes key for each entry.
*
* @param map Map to reverse.
* @return reversed map.
*/
}
}
return mapReverse;
}
/**
* Sorts keys in a map.
*
* @param map to sort.
* @param locale of user.
* @return a list of sorted keys.
*/
}
return sorted;
}
/**
* Returns an option list of sorted label.
*
* @param map Map of value to its label.
* @param locale Locale of user.
* @return an option list of sorted label.
*/
}
return optionList;
}
/**
* Gets relative distinguished name
*
* @param model
* @param dn - distinguished name
* @return name of relative distinguished name
*/
} else {
}
}
return ret;
}
/**
* Sorts keys in a map ordered by its value (String).
*
* @param map to sort
* @param locale of user
* @return a list of sorted keys
*/
}
}
return listSorted;
}
/**
* Replaces a string with another string in a String object.
*
* @param originalString original String.
* @param token string to be replaced.
* @param newString new string to replace token.
* @return a String object after replacement.
*/
public static String replaceString(
) {
while (idx != -1) {
}
return originalString;
}
/**
* Returns a string of comma separated strings that are contained in a set.
*
* @param set Set of strings.
*/
boolean firstEntry = true;
if (!firstEntry) {
} else {
firstEntry = false;
}
}
}
/**
* Returns the display name of an <code>AMIdentity</code>.
* a dispalyable format.
* For example:
* cn=Static-1_ou=Groups_dc=sun_dc=com
* would be dispalyed as
* Static-1 Administrator
*
* This will be used by the Privileges tab and Entity Subject tab views.
*
* @param model handle to AMModel interface.
* @param universalId Universal Id of Entity object.
* @return the display name of an <code>AMIdentity</code>.
*/
public static String getIdentityDisplayName(
) {
try {
} catch (IdRepoException e) {
"Could not get display name returning universalId "
+ universalId);
}
return name;
}
/**
* Returns the display name of an <code>AMIdentity</code>.
* a dispalyable format.
* For example:
* cn=Static-1_ou=Groups_dc=sun_dc=com
* would be dispalyed as
* Static-1 Administrator
*
* This will be used by the Privileges tab and Entity Subject tab views.
*
* @param model handle to AMModel interface.
* @param entity Entity object.
* @return the display name of an <code>AMIdentity</code>.
*/
public static String getIdentityDisplayName(
) {
"admin_suffix.name");
}
}
}
return name;
}
}