/*
* (non-Javadoc)
* @see org.apache.james.mailbox.SubscriptionManager#subscribe(org.apache.james.mailbox.MailboxSession, java.lang.String)
*/
public void subscribe(final MailboxSession session, final String mailbox) throws SubscriptionException {
final SubscriptionMapper mapper = mapperFactory.getSubscriptionMapper(session);
try {
mapper.execute(new Mapper.VoidTransaction() {
public void runVoid() throws MailboxException {
final Subscription subscription = mapper.findMailboxSubscriptionForUser(session.getUser().getUserName(), mailbox);
if (subscription == null) {
final Subscription newSubscription = createSubscription(session, mailbox);
mapper.save(newSubscription);
}
}
});
} catch (MailboxException e) {