Examples of DomainListException


Examples of org.apache.james.domainlist.api.DomainListException

            if (!result.isEmpty()) {
                return true;
            }
        } catch (IOException e) {
            log.error("Error while counting domains from HBase", e);
            throw new DomainListException("Error while counting domains from HBase", e);
        } finally {
            if (table != null) {
                try {
                    table.close();
                } catch (IOException e) {
View Full Code Here

Examples of org.apache.james.domainlist.api.DomainListException

    @Override
    public void addDomain(String domain) throws DomainListException {
        // TODO: Remove later. Temporary fix to get sure no domains can be added
        // to the XMLDomainList
        if (managementDisabled)
            throw new DomainListException("Read-Only DomainList implementation");

        String newDomain = domain.toLowerCase(Locale.US);
        if (!containsDomain(newDomain)) {
            domainNames.add(newDomain);
        }
View Full Code Here

Examples of org.apache.james.domainlist.api.DomainListException

     */
    @Override
    public void addDomain(String domain) throws DomainListException {
        String lowerCasedDomain = domain.toLowerCase();
        if (containsDomain(lowerCasedDomain)) {
            throw new DomainListException(lowerCasedDomain + " already exists.");
        }
        HTable table = null;
        try {
            table = TablePool.getInstance().getDomainlistTable();
            Put put = new Put(Bytes.toBytes(lowerCasedDomain));
            put.add(HDomainList.COLUMN_FAMILY_NAME, HDomainList.COLUMN.DOMAIN, null);
            table.put(put);
            table.flushCommits();
        } catch (IOException e) {
            log.error("Error while adding domain in HBase", e);
            throw new DomainListException("Error while adding domain in HBase", e);
        } finally {
            if (table != null) {
                try {
                    table.close();
                } catch (IOException e) {
View Full Code Here

Examples of org.apache.james.domainlist.api.DomainListException

    @Override
    public void removeDomain(String domain) throws DomainListException {
        // TODO: Remove later. Temporary fix to get sure no domains can be added
        // to the XMLDomainList
        if (managementDisabled)
            throw new DomainListException("Read-Only DomainList implementation");

        domainNames.remove(domain.toLowerCase(Locale.US));
    }
View Full Code Here

Examples of org.apache.james.domainlist.api.DomainListException

            Delete delete = new Delete(Bytes.toBytes(domain));
            table.delete(delete);
            table.flushCommits();
        } catch (IOException e) {
            log.error("Error while deleting user from HBase", e);
            throw new DomainListException("Error while deleting domain from HBase", e);
        } finally {
            if (table != null) {
                try {
                    table.close();
                } catch (IOException e) {
View Full Code Here

Examples of org.apache.james.domainlist.api.DomainListException

            while ((result = resultScanner.next()) != null) {
                list.add(Bytes.toString(result.getRow()));
            }
        } catch (IOException e) {
            log.error("Error while counting domains from HBase", e);
            throw new DomainListException("Error while counting domains from HBase", e);
        } finally {
            if (resultScanner != null) {
                resultScanner.close();
            }
            if (table != null) {
View Full Code Here

Examples of org.apache.james.domainlist.api.DomainListException

    }

    @Override
    public void addDomain(String domain) throws DomainListException {
        if (domains.contains(domain)) {
            throw new DomainListException("Domain " + domain + " already exist");
        }
        domains.add(domain);
    }
View Full Code Here

Examples of org.apache.james.domainlist.api.DomainListException

    }

    @Override
    public void removeDomain(String domain) throws DomainListException {
        if (!domains.remove(domain)) {
            throw new DomainListException("Domain " + domain + " does not exist");
        }
    }
View Full Code Here

Examples of org.apache.james.domainlist.api.DomainListException

        } catch (PersistenceException e) {
            getLogger().error("Failed to list domains", e);
            if (transaction.isActive()) {
                transaction.rollback();
            }
            throw new DomainListException("Unable to retrieve domains", e);
        } finally {
            entityManager.close();
        }
        if (domains.size() == 0) {
            return null;
View Full Code Here

Examples of org.apache.james.domainlist.api.DomainListException

        } catch (PersistenceException e) {
            getLogger().error("Failed to find domain", e);
            if (transaction.isActive()) {
                transaction.rollback();
            }
            throw new DomainListException("Unable to retrieve domains", e);
        } finally {
            entityManager.close();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.