Class AMFormatUtils
- java.lang.Object
-
- com.sun.identity.console.base.model.AMFormatUtils
-
- All Implemented Interfaces:
AMAdminConstants
public class AMFormatUtils extends Object implements AMAdminConstants
AMFormatUtilsprovides a set of formating methods
-
-
Field Summary
-
Fields inherited from interface com.sun.identity.console.base.model.AMAdminConstants
ADMIN_CONSOLE_SERVICE, ADMIN_DISPLAY_ATTRIBUTE, ADMIN_DISPLAY_READONLY_ATTRIBUTE, AGENT_REPOSITORY_LOCATION_ATTR, AGENTS_NODE_ID, AMSDK_DEBUG_FILENAME, ATTR_USER_OLD_PASSWORD, ATTR_USER_PASSWORD, ATTR_USER_RESOURCE_OFFERING, ATTR_USER_STATUS, AUTH_CONFIG_SERVICE, CDM_CONTENT_TYPE_PROPERTY_NAME, CHOICES, CONFIGURATION_NODE_ID, CONSOLE_DEBUG_FILENAME, CONSOLE_LOCATION_DN, CONSOLE_ORG_CUSTOM_JSP_DIRECTORY, CONSOLE_UM_ENABLED_ATTR, CONSOLE_USER_ATTRS_SEARCH_KEY, CONSOLE_USER_SEARCH_KEY, CONSOLE_USER_SEARCH_RETURN_KEY, CORE_AUTH_SERVICE, CURRENT_ORG, CURRENT_PROFILE, CURRENT_REALM, DEFAULT_RB, DEFAULT_SEARCH_TIMEOUT, DISCOVERY_SERVICE, DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF, DISCOVERY_SERVICE_NAME_DYNAMIC_DISCO_ENTRIES, DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER, DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER_ID_MAPPER, DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER_PROVIDER_ID, DISPLAY_ATTRIBUTE, DISPLAY_READONLY_ATTRIBUTE, DYN_LINK_COMPONENT_NAME, ENCRYPTED, FED_TAB_ID, G11N_SERIVCE_COMMON_NAME_FORMAT, G11N_SERVICE_NAME, IDREPO_SERVICE_NAME, IMAGES_PRIMARY_PRODUCT_NAME_PNG, OPERATION_ADD, OPERATION_EDIT, OPTIONAL_ATTRIBUTE, ORGANIZATION_NODE_ID, PASSWORD, PERMISSION_DELEGATE, PERMISSION_MODIFY, PERMISSION_READ, PG_SESSION_INIT_PAGETRAIL, PLATFORM_SERVICE, POLICY_SELECTED_RESPONSE_PROVIDER, POLICY_SERVICE, PREVIOUS_ORGANIZATION, PREVIOUS_REALM, PREVIOUS_TAB_ID, PW_RESET_SERVICE, REALM_NODE_ID, REQUIRED_ATTRIBUTE, REST_STS_SERVICE, ROLE_DISPLAY_OPTION_ATTRIBUTE_NAME, SAML_SERVICE, SAVE_VB_NAME, SERVICE_NAME, SESSION_SERVICE, SESSIONS_NODE_ID, SOAP_STS_SERVICE, SSO_TOKEN_LOCALE_ATTRIBUTE_NAME, SSO_TOKEN_ORGANIZATION_ATTRIBUTE_NAME, STRING_ACTIVE, STRING_FALSE, STRING_INACTIVE, SUBJECTS_NODE_ID, TAB_AGENT_PREFIX, TAB_AGENT_PREFIX_INT, URL_LOGIN, URL_LOGOUT, USER_SERVICE, USER_SERVICE_PREFERRED_LOCALE, VALUES
-
-
Constructor Summary
Constructors Constructor Description AMFormatUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringDNToName(AMModel model, String dn)Gets relative distinguished namestatic StringgetIdentityDisplayName(AMModel model, AMIdentity entity)Returns the display name of anAMIdentity.static StringgetIdentityDisplayName(AMModel model, String universalId)Returns the display name of anAMIdentity.static com.iplanet.jato.view.html.OptionListgetSortedOptionList(Map map, Locale locale)Returns an option list of sorted label.static StringreplaceString(String originalString, String token, String newString)Replaces a string with another string in a String object.static MapreverseStringMap(Map map)Reverses key to value String-String map i.e. key of map becomes the value; and value becomes key for each entry.static ListsortItems(Collection collection, Locale locale)Sorts items in a set.static ListsortKeyInMap(Map map, Locale locale)Sorts keys in a map.static ListsortMapByValue(Map map, Locale locale)Sorts keys in a map ordered by its value (String).static StringtoCommaSeparatedFormat(Set set)Returns a string of comma separated strings that are contained in a set.
-
-
-
Method Detail
-
sortItems
public static List sortItems(Collection collection, Locale locale)
Sorts items in a set.- Parameters:
collection- to sort.locale- of user.- Returns:
- list of sorted items.
-
reverseStringMap
public static Map reverseStringMap(Map map)
Reverses key to value String-String map i.e. key of map becomes the value; and value becomes key for each entry.- Parameters:
map- Map to reverse.- Returns:
- reversed map.
-
sortKeyInMap
public static List sortKeyInMap(Map map, Locale locale)
Sorts keys in a map.- Parameters:
map- to sort.locale- of user.- Returns:
- a list of sorted keys.
-
getSortedOptionList
public static com.iplanet.jato.view.html.OptionList getSortedOptionList(Map map, Locale locale)
Returns an option list of sorted label.- Parameters:
map- Map of value to its label.locale- Locale of user.- Returns:
- an option list of sorted label.
-
DNToName
public static String DNToName(AMModel model, String dn)
Gets relative distinguished name- Parameters:
model- the model used to resolve localized stringsdn- - distinguished name- Returns:
- name of relative distinguished name
-
sortMapByValue
public static List sortMapByValue(Map map, Locale locale)
Sorts keys in a map ordered by its value (String).- Parameters:
map- to sortlocale- of user- Returns:
- a list of sorted keys
-
replaceString
public static String replaceString(String originalString, String token, String newString)
Replaces a string with another string in a String object.- Parameters:
originalString- original String.token- string to be replaced.newString- new string to replace token.- Returns:
- a String object after replacement.
-
toCommaSeparatedFormat
public static String toCommaSeparatedFormat(Set set)
Returns a string of comma separated strings that are contained in a set.- Parameters:
set- Set of strings.
-
getIdentityDisplayName
public static String getIdentityDisplayName(AMModel model, String universalId)
Returns the display name of anAMIdentity. 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.- Parameters:
model- handle to AMModel interface.universalId- Universal Id of Entity object.- Returns:
- the display name of an
AMIdentity.
-
getIdentityDisplayName
public static String getIdentityDisplayName(AMModel model, AMIdentity entity)
Returns the display name of anAMIdentity. 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.- Parameters:
model- handle to AMModel interface.entity- Entity object.- Returns:
- the display name of an
AMIdentity.
-
-