Class MappingProviderUtil


  • public class MappingProviderUtil
    extends Object
    Utility class for Mapping Providers
    Since:
    Oct 10, 2006
    Version:
    $Revision$
    Author:
    Anil Saldhana
    • Constructor Detail

      • MappingProviderUtil

        public MappingProviderUtil()
    • Method Detail

      • addPrincipals

        public static Group addPrincipals​(Group grp,
                                          Enumeration<? extends Principal> en)
        Add principals passed via an enumeration into a group
        Parameters:
        grp -
        en -
        Returns:
      • addRoles

        public static Group addRoles​(Group roles,
                                     String[] addRoles)
        Add the roles into the Group
        Parameters:
        roles - Group of roles
        addRoles -
        Returns:
        Group with the added roles
      • getRolesFromCommaSeparatedString

        public static String[] getRolesFromCommaSeparatedString​(String str)
        Given a comma-separated list of roles, return a string array
        Parameters:
        str -
        Returns:
      • instantiatePrincipal

        public static Principal instantiatePrincipal​(Class<?> cls,
                                                     String role)
        Instantiate a Principal representing a principal
        Parameters:
        cls - principal class
        role - Name of the role
        Returns:
      • removePrincipals

        public static Group removePrincipals​(Group grp)
        Remove all the principals from the group
        Parameters:
        grp -
        Returns:
      • removeRoles

        public static Group removeRoles​(Group roles,
                                        String[] removeRoles)
        Remove the roles from the Group
        Parameters:
        roles - Group of roles
        removeRoles -
        Returns:
        Group with roles removed
      • replacePrincipals

        public static Group replacePrincipals​(Group fg,
                                              Group sg)
        Replace the principals in first group with those in the second
        Parameters:
        fg -
        sg -
        Returns: