org.apache.james.mailbox.jpa.user
Class JPASubscriptionMapper

java.lang.Object
  extended by org.apache.james.mailbox.store.transaction.TransactionalMapper
      extended by org.apache.james.mailbox.jpa.JPATransactionalMapper
          extended by org.apache.james.mailbox.jpa.user.JPASubscriptionMapper
All Implemented Interfaces:
Mapper, SubscriptionMapper

public class JPASubscriptionMapper
extends JPATransactionalMapper
implements SubscriptionMapper

JPA implementation of a SubscriptionMapper. This class is not thread-safe!


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.james.mailbox.store.transaction.Mapper
Mapper.MailboxMembershipCallback<Id>, Mapper.Transaction<T>, Mapper.VoidTransaction
 
Field Summary
 
Fields inherited from class org.apache.james.mailbox.jpa.JPATransactionalMapper
entityManager, entityManagerFactory
 
Constructor Summary
JPASubscriptionMapper(javax.persistence.EntityManagerFactory entityManagerFactory)
           
 
Method Summary
 void delete(Subscription subscription)
           
 Subscription findMailboxSubscriptionForUser(String user, String mailbox)
           
 List<Subscription> findSubscriptionsForUser(String user)
           
 void save(Subscription subscription)
           
 
Methods inherited from class org.apache.james.mailbox.jpa.JPATransactionalMapper
begin, commit, endRequest, getEntityManager, rollback
 
Methods inherited from class org.apache.james.mailbox.store.transaction.TransactionalMapper
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.james.mailbox.store.transaction.Mapper
endRequest, execute
 

Constructor Detail

JPASubscriptionMapper

public JPASubscriptionMapper(javax.persistence.EntityManagerFactory entityManagerFactory)
Method Detail

findMailboxSubscriptionForUser

public Subscription findMailboxSubscriptionForUser(String user,
                                                   String mailbox)
                                            throws SubscriptionException
Specified by:
findMailboxSubscriptionForUser in interface SubscriptionMapper
Throws:
SubscriptionException

save

public void save(Subscription subscription)
          throws SubscriptionException
Specified by:
save in interface SubscriptionMapper
Throws:
SubscriptionException
See Also:
SubscriptionMapper.save(Subscription)

findSubscriptionsForUser

public List<Subscription> findSubscriptionsForUser(String user)
                                            throws SubscriptionException
Specified by:
findSubscriptionsForUser in interface SubscriptionMapper
Throws:
SubscriptionException
See Also:
SubscriptionMapper.findSubscriptionsForUser(java.lang.String)

delete

public void delete(Subscription subscription)
            throws SubscriptionException
Specified by:
delete in interface SubscriptionMapper
Throws:
SubscriptionException
See Also:
SubscriptionMapper.delete(Subscription)


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.