Package org.apache.james.mailbox.exception

Examples of org.apache.james.mailbox.exception.SubscriptionException


                    return subscription;
                }
            }
            return null;
        } catch (IOException e) {
            throw new SubscriptionException(e);
        } finally {
            if (subscriptions != null) {
                try {
                    subscriptions.close();
                } catch (IOException ex) {
                    throw new SubscriptionException(ex);
                }
            }
        }
    }
View Full Code Here


        try {
            subscriptions = new HTable(conf, SUBSCRIPTIONS_TABLE);
            Put put = toPut(subscription);
            subscriptions.put(put);
        } catch (IOException e) {
            throw new SubscriptionException(e);
        } finally {
            if (subscriptions != null) {
                try {
                    subscriptions.close();
                } catch (IOException ex) {
                    throw new SubscriptionException(ex);
                }
            }
        }
    }
View Full Code Here

                    subscriptionList.add(new SimpleSubscription(user, Bytes.toString(key.getQualifier())));
                }
            }
            return subscriptionList;
        } catch (IOException e) {
            throw new SubscriptionException(e);
        } finally {
            if (subscriptions != null) {
                try {
                    subscriptions.close();
                } catch (IOException ex) {
                    throw new SubscriptionException(ex);
                }
            }
        }
    }
View Full Code Here

            Delete delete = new Delete(Bytes.toBytes(subscription.getUser()));
            delete.deleteColumns(SUBSCRIPTION_CF, Bytes.toBytes(subscription.getMailbox()));
            subscriptions.delete(delete);
            subscriptions.close();
        } catch (IOException e) {
            throw new SubscriptionException(e);
        } finally {
            if (subscriptions != null) {
                try {
                    subscriptions.close();
                } catch (IOException ex) {
                    throw new SubscriptionException(ex);
                }
            }
        }
    }
View Full Code Here

            return (Subscription) getEntityManager().createNamedQuery("findFindMailboxSubscriptionForUser")
            .setParameter("userParam", user).setParameter("mailboxParam", mailbox).getSingleResult();
        } catch (NoResultException e) {
            return null;
        } catch (PersistenceException e) {
            throw new SubscriptionException(e);
        }
    }
View Full Code Here

     */
    public void save(Subscription subscription) throws SubscriptionException {
        try {
            getEntityManager().persist(subscription);
        } catch (PersistenceException e) {
            throw new SubscriptionException(e);
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public List<Subscription> findSubscriptionsForUser(String user) throws SubscriptionException {
        try {
            return (List<Subscription>) getEntityManager().createNamedQuery("findSubscriptionsForUser").setParameter("userParam", user).getResultList();
        } catch (PersistenceException e) {
            throw new SubscriptionException(e);
        }
    }
View Full Code Here

     */
    public void delete(Subscription subscription) throws SubscriptionException {
        try {
            getEntityManager().remove(subscription);
        } catch (PersistenceException e) {
            throw new SubscriptionException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.exception.SubscriptionException

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.