class MappedUserProvider extends UserMultiProvider
{
    /**
     * Name of the property of which the value is expected to be the classname of the UserProviderMapper instance to be
     * used by instances of this class.
     */
    public static final String PROPERTY_MAPPER_CLASSNAME = "mappedUserProvider.mapper.className";

    /**
     * Used to determine what provider is to be used to operate on a particular user.
     */
    protected final UserProviderMapper mapper;

    public MappedUserProvider()
    {

        // Migrate properties.
        JiveGlobals.migrateProperty( PROPERTY_MAPPER_CLASSNAME );

        // Instantiate mapper.
        final String mapperClass = JiveGlobals.getProperty( PROPERTY_MAPPER_CLASSNAME );
        if ( mapperClass == null )
        {
            throw new IllegalStateException( "A mapper must be specified via openfire.xml or the system properties." );
        }

        try
        {
            final Class c = ClassUtils.forName( mapperClass );
            mapper = (UserProviderMapper) c.newInstance();
        }
        catch ( Exception e )
        {
            throw new IllegalStateException( "Unable to create new instance of UserProviderMapper class: " + mapperClass, e );
        }
    }

    @Override
    public Collection<UserProvider> getUserProviders()
    {
        return mapper.getUserProviders();
    }

    @Override
    public UserProvider getUserProvider( String username )
    {
        return mapper.getUserProvider( username );
    }

    @Override
    public User loadUser( String username ) throws UserNotFoundException
    {<FILL_FUNCTION_BODY>}

    @Override
    public User createUser( String username, String password, String name, String email ) throws UserAlreadyExistsException
    {
        return getUserProvider( username ).createUser( username, password, name, email );
    }

    @Override
    public void deleteUser( String username )
    {
        getUserProvider( username ).deleteUser( username );
    }

    @Override
    public void setName( String username, String name ) throws UserNotFoundException
    {
        getUserProvider( username ).setName( username, name );
    }

    @Override
    public void setEmail( String username, String email ) throws UserNotFoundException
    {
        getUserProvider( username ).setEmail( username, email );
    }

    @Override
    public void setCreationDate( String username, Date creationDate ) throws UserNotFoundException
    {
        getUserProvider( username ).setCreationDate( username, creationDate );
    }

    @Override
    public void setModificationDate( String username, Date modificationDate ) throws UserNotFoundException
    {
        getUserProvider( username ).setModificationDate( username, modificationDate );
    }
}

        final UserProvider userProvider;
        try{
            userProvider = getUserProvider( username );
        } catch (RuntimeException e){
            throw new UserNotFoundException("Unable to identify user provider for username "+username, e);
        }
        return userProvider.loadUser( username );
    
<methods>public non-sealed void <init>() ,public Collection<org.jivesoftware.openfire.user.User> findUsers(Set<java.lang.String>, java.lang.String) throws java.lang.UnsupportedOperationException,public Collection<org.jivesoftware.openfire.user.User> findUsers(Set<java.lang.String>, java.lang.String, int, int) throws java.lang.UnsupportedOperationException,public Set<java.lang.String> getSearchFields() throws java.lang.UnsupportedOperationException,public int getUserCount() ,public Collection<java.lang.String> getUsernames() ,public Collection<org.jivesoftware.openfire.user.User> getUsers() ,public Collection<org.jivesoftware.openfire.user.User> getUsers(int, int) ,public static org.jivesoftware.openfire.user.UserProvider instantiate(java.lang.String) ,public boolean isEmailRequired() ,public boolean isNameRequired() ,public boolean isReadOnly() <variables>private static final Logger Log