Class MappedRoleMapper

  • All Implemented Interfaces:
    RoleMapper

    public class MappedRoleMapper
    extends Object
    implements RoleMapper
    A simple mapping role mapper. Maps each role to a set of new roles using a String to Set map.
    Author:
    Martin Mazanek
    • Constructor Detail

      • MappedRoleMapper

        public MappedRoleMapper()
        Construct a new instance. Called from WildFly core when using this as a custom component. You should not use this constructor and use MappedRoleMapper.Builder instead. You must call #initialize(Map) to configure mapping map before usage.
        See Also:
        MappedRoleMapper.Builder
    • Method Detail

      • initialize

        public void initialize​(Map<String,​String> configuration)
        Custom component method. Called from WildFly core. Used to include mapped role mapping functionality in older WildFly versions.
        Parameters:
        configuration - map of mapping rules where key is delegate role and value is whitespace separated list of new roles
        Throws:
        IllegalStateException - when called mapper is already initialized
      • mapRoles

        public Roles mapRoles​(Roles rolesToMap)
        Description copied from interface: RoleMapper
        Returns a set of strings representing the roles mapped from the given roles in their raw form.
        Specified by:
        mapRoles in interface RoleMapper
        Parameters:
        rolesToMap - the roles in their raw form to apply mapping
        Returns:
        the mapped role set