Package org.apache.james.services

Examples of org.apache.james.services.UsersRepository


     * @return false if the user isn't subscribed, true otherwise
     * @throws MessagingException
     */
    protected boolean checkSubscriptionStatus(Mail mail) throws MessagingException {
        MailAddress mailAddress = mail.getSender();
        UsersRepository usersRepository = getUsersRepository();
        if (!usersRepository.contains(mailAddress.toString())) {
            getCommandListservManager().onError(mail,
                    "Invalid request",
                    xmlResources.getString("not.subscribed", getStandardProperties()));
            return false;
        }
View Full Code Here


     * @return false if the user isn't subscribed, true otherwise
     * @throws MessagingException
     */
    protected boolean checkSubscriptionStatus(Mail mail) throws MessagingException {
        MailAddress mailAddress = mail.getSender();
        UsersRepository usersRepository = getUsersRepository();
        if (!usersRepository.contains(mailAddress.toString())) {
            getCommandListservManager().onError(mail,
                    "Invalid request",
                    xmlResources.getString("not.subscribed", getStandardProperties()));
            return false;
        }
View Full Code Here

            Configuration repConf = repConfs[i];
            String repName = repConf.getAttribute("name");
            String repClass = repConf.getAttribute("class");

      getLogger().debug("Starting " + repClass);
            UsersRepository rep = (UsersRepository) Class.forName(repClass).newInstance();

            setupLogger((Component)rep);

            if (rep instanceof Contextualizable) {
                ((Contextualizable) rep).contextualize(context);
View Full Code Here

        getLogger().info("AvalonUsersStore ...init");
    }


    public UsersRepository getRepository(String request) {
        UsersRepository response = (UsersRepository) repositories.get(request);
        if (response == null) {
            getLogger().warn("No users repository called: " + request);
        }
        return response;
    }
View Full Code Here

        return list;
    }

    public boolean setRepository(String name)
            throws RemoteException {
        UsersRepository repos = usersStore.getRepository(name);
        if (repos == null) {
            getLogger().warn("No user repository found with name " + name);
            return false;
        }
        this.users = repos;
View Full Code Here

            if (theClassLoader == null) {
                theClassLoader = this.getClass().getClassLoader();
            }

            UsersRepository rep = (UsersRepository) theClassLoader.loadClass(repClass).newInstance();

            setupLogger((Component)rep);

            if (rep instanceof Contextualizable) {
                ((Contextualizable) rep).contextualize(context);
View Full Code Here

     * @param name the name of the desired repository
     *
     * @return the UsersRepository corresponding to the name parameter
     */
    public UsersRepository getRepository(String name) {
        UsersRepository response = (UsersRepository) repositories.get(name);
        if ((response == null) && (getLogger().isWarnEnabled())) {
            getLogger().warn("No users repository called: " + name);
        }
        return response;
    }
View Full Code Here

        if (argument == null || argument.equals("")) {
            writeLoggedFlushedResponse("Usage: user [repositoryName]");
            return true;
        }
        String repositoryName = argument.toLowerCase(Locale.US);
        UsersRepository repos = theConfigData.getUserStore().getRepository(repositoryName);
        if ( repos == null ) {
            writeLoggedFlushedResponse("No such repository: " + repositoryName);
        } else {
            users = repos;
            StringBuffer responseBuffer =
View Full Code Here

     */
    protected String getMemberList() {

        StringBuffer buffer = new StringBuffer(0x1000);
        buffer.append("\r\n");
        UsersRepository usersRepository = getUsersRepository();
        for (Iterator it = usersRepository.list(); it.hasNext();) {
            String userName = (String) it.next();
            buffer.append("    ").append(userName);
            buffer.append("\r\n");
        }

View Full Code Here

     * @return false if the user is subscribed, true otherwise
     * @throws MessagingException
     */
    protected boolean checkSubscriptionStatus(Mail mail) throws MessagingException {
        MailAddress mailAddress = mail.getSender();
        UsersRepository usersRepository = getUsersRepository();
        if (usersRepository.contains(mailAddress.toString())) {
            getCommandListservManager().onError(mail,
                    "Invalid request",
                    xmlResources[SUBSCRIBE_CONFIRM].getString("already.subscribed", getStandardProperties()));
            return false;
        }
View Full Code Here

TOP

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

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.