/*
* (non-Javadoc)
* @see org.apache.james.mailbox.store.mail.MessageMapper#delete(org.apache.james.mailbox.store.mail.model.Mailbox, org.apache.james.mailbox.store.mail.model.Message)
*/
public void delete(Mailbox<String> mailbox, Message<String> message) throws MailboxException {
JCRMessage membership = (JCRMessage) message;
if (membership.isPersistent()) {
try {
getSession().getNodeByIdentifier(membership.getId()).remove();
} catch (RepositoryException e) {
throw new MailboxException("Unable to delete message " + message + " in mailbox " + mailbox, e);
}
}
}