Package org.apache.james.services

Examples of org.apache.james.services.UsersStore


    public void init() throws MessagingException {
        super.init();
        ServiceManager compMgr = (ServiceManager) getMailetContext()
                .getAttribute(Constants.AVALON_COMPONENT_MANAGER);

        UsersStore usersStore;
        try {
            usersStore = (UsersStore) compMgr.lookup(UsersStore.ROLE);


            enableAliases = new Boolean(getInitParameter("enableAliases",
                    getMailetContext().getAttribute(Constants.DEFAULT_ENABLE_ALIASES).toString()
                    )).booleanValue();
            enableForwarding = new Boolean(getInitParameter("enableForwarding",
                    getMailetContext().getAttribute(Constants.DEFAULT_ENABLE_FORWARDING).toString()
                    )).booleanValue();
            ignoreCase = new Boolean(getInitParameter("ignoreCase",
                    getMailetContext().getAttribute(Constants.DEFAULT_IGNORE_USERNAME_CASE).toString()
                    )).booleanValue();
           
            String userRep = getInitParameter("usersRepository");
            if (userRep == null || userRep.length() == 0) {
                try {
                    usersRepository = (UsersRepository) compMgr
                            .lookup(UsersRepository.ROLE);
                } catch (ServiceException e) {
                    log("Failed to retrieve UsersRepository component:"
                            + e.getMessage());
                }
            } else {
                usersRepository = usersStore.getRepository(userRep);
            }

        } catch (ServiceException cnfe) {
            log("Failed to retrieve UsersStore component:" + cnfe.getMessage());
        }
View Full Code Here


    /**
     * Fetch the repository of users
     */
    protected void initUsersRepository() throws Exception {
        ServiceManager compMgr = (ServiceManager) getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
        UsersStore usersStore = (UsersStore) compMgr.lookup(UsersStore.ROLE);
        String repName = getInitParameter("repositoryName");

        usersRepository = usersStore.getRepository(repName);
        if (usersRepository == null) throw new Exception("Invalid user repository: " + repName);
    }
View Full Code Here

    }

    public void compose( final ComponentManager componentManager )
        throws ComponentException
    {
        UsersStore usersStore = (UsersStore)componentManager.lookup(UsersStore.ROLE);
        repo = usersStore.getRepository("LocalUsers");
    }
View Full Code Here

    public void init() throws MessagingException {
        super.init();
        ServiceManager compMgr = (ServiceManager) getMailetContext()
                .getAttribute(Constants.AVALON_COMPONENT_MANAGER);

        UsersStore usersStore;
        try {
            usersStore = (UsersStore) compMgr.lookup(UsersStore.ROLE);


            enableAliases = new Boolean(getInitParameter("enableAliases",
                    getMailetContext().getAttribute(Constants.DEFAULT_ENABLE_ALIASES).toString()
                    )).booleanValue();
            enableForwarding = new Boolean(getInitParameter("enableForwarding",
                    getMailetContext().getAttribute(Constants.DEFAULT_ENABLE_FORWARDING).toString()
                    )).booleanValue();
            ignoreCase = new Boolean(getInitParameter("ignoreCase",
                    getMailetContext().getAttribute(Constants.DEFAULT_IGNORE_USERNAME_CASE).toString()
                    )).booleanValue();
           
            String userRep = getInitParameter("usersRepository");
            if (userRep == null || userRep.length() == 0) {
                try {
                    usersRepository = (UsersRepository) compMgr
                            .lookup(UsersRepository.ROLE);
                } catch (ServiceException e) {
                    log("Failed to retrieve UsersRepository component:"
                            + e.getMessage());
                }
            } else {
                usersRepository = usersStore.getRepository(userRep);
            }

        } catch (ServiceException cnfe) {
            log("Failed to retrieve UsersStore component:" + cnfe.getMessage());
        }
View Full Code Here

    /**
     * Fetch the repository of users
     */
    protected void initUsersRepository() throws Exception {
        ServiceManager compMgr = (ServiceManager) getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
        UsersStore usersStore = (UsersStore) compMgr.lookup(UsersStore.ROLE);
        String repName = getInitParameter("repositoryName");

        usersRepository = usersStore.getRepository(repName);
        if (usersRepository == null) throw new Exception("Invalid user repository: " + repName);
    }
View Full Code Here

            // Ignore any exceptions, default to true
        }

        ServiceManager compMgr = (ServiceManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
        try {
            UsersStore usersStore = (UsersStore)compMgr.lookup(UsersStore.ROLE);
            String repName = getInitParameter("repositoryName");

            members = (UsersRepository)usersStore.getRepository( repName );
        } catch (ServiceException cnfe) {
            log("Failed to retrieve Store component:" + cnfe.getMessage());
        } catch (Exception e) {
            log("Failed to retrieve Store component:" + e.getMessage());
        }
View Full Code Here

     * Fetch the repository of users
     */
    protected void initUsersRepository() {
        ServiceManager compMgr = (ServiceManager) getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
        try {
            UsersStore usersStore = (UsersStore) compMgr.lookup(UsersStore.ROLE);
            String repName = getInitParameter("repositoryName");

            usersRepository = usersStore.getRepository(repName);
        } catch (Exception e) {
            log("Failed to retrieve Store component:" + e.getMessage());
        }
    }
View Full Code Here

    private UsersRepository members;

    public void init() {
        ComponentManager compMgr = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
        try {
            UsersStore usersStore = (UsersStore) compMgr.lookup("org.apache.james.services.UsersStore");
            String repName = getInitParameter("repositoryName");

            members = (UsersRepository) usersStore.getRepository(repName);
        } catch (ComponentException cnfe) {
            log("Failed to retrieve Store component:" + cnfe.getMessage());
        } catch (Exception e) {
            log("Failed to retrieve Store component:" + e.getMessage());
        }
View Full Code Here

        }
        subjectPrefix = getInitParameter("subjectprefix");

        ComponentManager compMgr = (ComponentManager)getMailetContext().getAttribute(Constants.AVALON_COMPONENT_MANAGER);
        try {
            UsersStore usersStore = (UsersStore)compMgr.lookup("org.apache.james.services.UsersStore");
            String repName = getInitParameter("repositoryName");

            members = (UsersRepository)usersStore.getRepository( repName );
        } catch (ComponentException cnfe) {
            log("Failed to retrieve Store component:" + cnfe.getMessage());
        } catch (Exception e) {
            log("Failed to retrieve Store component:" + e.getMessage());
        }
View Full Code Here

    public void compose( final ComponentManager componentManager )
        throws ComponentException {
        mailServer = (MailServer)componentManager.
            lookup( "org.apache.james.services.MailServer" );
        UsersStore usersStore = (UsersStore)componentManager.
            lookup( "org.apache.james.services.UsersStore" );
        users = usersStore.getRepository("LocalUsers");
        scheduler = (TimeScheduler)componentManager.
            lookup( "org.apache.avalon.cornerstone.services.scheduler.TimeScheduler" );
    }
View Full Code Here

TOP

Related Classes of org.apache.james.services.UsersStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.