Class UserMapFactoryBean

  • All Implemented Interfaces:
    org.springframework.beans.factory.FactoryBean

    public class UserMapFactoryBean
    extends Object
    implements org.springframework.beans.factory.FactoryBean
    Takes as input the string that defines a UserMap. When Spring instantiates this bean, it outputs a UserMap.

    This class allows a string that defines a UserMap to be defined once in Spring beans XML, then used by multiple client beans that need access to user to role mappings.

    This class is necessary since UserMap does not define a constructor or setter necessary to populate a UserMap bean, nor does it provide any way to extract its mappings once created.

    Example usage:

         <bean id="userMap" class="java.lang.String">
           <constructor-arg type="java.lang.String">
             <value>
               <![CDATA[
               admin=password,Admin,ceo,Authenticated
               ...
               ]]>
             </value>
           </constructor-arg>
         </bean>
     
         <bean id="userMapFactoryBean"
           class="org.pentaho.security.UserMapFactoryBean">
           <property name="userMap" ref="userMap" />
         </bean>
     
         <bean id="memoryAuthenticationDao"
           class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
           <property name="userMap" ref="userMapFactoryBean" />
         </bean>
     
    Author:
    mlowery
    See Also:
    UserRoleListEnhancedUserMapFactoryBean
    • Constructor Detail

      • UserMapFactoryBean

        public UserMapFactoryBean()
    • Method Detail

      • getObject

        public Object getObject()
                         throws Exception
        Specified by:
        getObject in interface org.springframework.beans.factory.FactoryBean
        Throws:
        Exception
      • getObjectType

        public Class getObjectType()
        Specified by:
        getObjectType in interface org.springframework.beans.factory.FactoryBean
      • isSingleton

        public boolean isSingleton()
        Specified by:
        isSingleton in interface org.springframework.beans.factory.FactoryBean
      • setUserMap

        public void setUserMap​(String userMap)