Package org.apache.james.user.api

Examples of org.apache.james.user.api.UsersRepository


        if (parameters == null || parameters.equals("")) {
            response = new RemoteManagerResponse("Usage: " + help.getSyntax());
            return response;
        }
        String repositoryName = parameters.toLowerCase(Locale.US);
        UsersRepository repos = uStore.getRepository(repositoryName);
        if ( repos == null ) {
            response = new RemoteManagerResponse("No such repository: " + repositoryName);
        } else {
            session.getState().put(RemoteManagerSession.CURRENT_USERREPOSITORY,repos);
            StringBuilder responseBuffer =
View Full Code Here


     */
    protected String getMemberList() {

        StringBuffer buffer = new StringBuffer(0x1000);
        buffer.append("\r\n");
        UsersRepository usersRepository = getUsersRepository();
        for (Iterator<String> it = usersRepository.list(); it.hasNext();) {
            String userName = 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

     * @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.getString("already.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

     * @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

    private UsersRepository getUserRepository(String repositoryName) {
        if (repositoryName == null) return localUsers; // return default

        if (usersStore == null) throw new IllegalArgumentException("cannot access user repository named " + repositoryName);

        UsersRepository repository = usersStore.getRepository(repositoryName);
        if (repository == null) throw new IllegalArgumentException("user repository does not exist: " + repositoryName);
       
        return repository;
    }
View Full Code Here

    /**
     * @see org.apache.james.user.api.UserManagementMBean#deleteUser(java.lang.String, java.lang.String)
     */
    public boolean deleteUser(String userName, String repositoryName) {
        UsersRepository users = getUserRepository(repositoryName);
        if (!users.contains(userName)) return false;
        users.removeUser(userName);
        return true;
    }
View Full Code Here

    /**
     * @see org.apache.james.user.api.UserManagementMBean#verifyExists(java.lang.String, java.lang.String)
     */
    public boolean verifyExists(String userName, String repositoryName) {
        UsersRepository users = getUserRepository(repositoryName);
        return users.contains(userName);
    }
View Full Code Here

    /**
     * @see org.apache.james.user.api.UserManagementMBean#countUsers(java.lang.String)
     */
    public long countUsers(String repositoryName) {
        UsersRepository users = getUserRepository(repositoryName);
        return users.countUsers();
    }
View Full Code Here

TOP

Related Classes of org.apache.james.user.api.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.