Package org.onesocialweb.openfire.model.activity

Examples of org.onesocialweb.openfire.model.activity.PersistentActivityEntry


    actor.setEmail(user.getEmail());
   
    // Persist the activities
    final EntityManager em = OswPlugin.getEmFactory().createEntityManager();
    em.getTransaction().begin();
    PersistentActivityEntry oldEntry=em.find(PersistentActivityEntry.class, entry.getId());
   
    if ((oldEntry==null) || (!oldEntry.getActor().getUri().equalsIgnoreCase(userJID)))
      throw new UnauthorizedException();
   
   
    Date published=oldEntry.getPublished();
    entry.setPublished(published);
    entry.setUpdated(Calendar.getInstance().getTime());
   
    em.remove(oldEntry);
   
View Full Code Here


  public void deleteActivity(String fromJID, String activityId) throws UnauthorizedException {
   
    final EntityManager em = OswPlugin.getEmFactory().createEntityManager();
    em.getTransaction().begin();
   
    PersistentActivityEntry activity= em.find(PersistentActivityEntry.class, activityId);
   
    if ((activity==null) || (!activity.getActor().getUri().equalsIgnoreCase(fromJID)))
      throw new UnauthorizedException();
   
    em.remove(activity);
   
    em.getTransaction().commit();
View Full Code Here

    // the inbox..which we agreed we don't want...
    message.setReceived(activity.getPublished());

    // Search if the activity exists in the database
    final EntityManager em = OswPlugin.getEmFactory().createEntityManager();
    PersistentActivityEntry previousActivity = em.find(PersistentActivityEntry.class, activity.getId());

    // Assign the activity to the existing one if it exists
    if (previousActivity != null) {
      message.setActivity(previousActivity);
    } else {
View Full Code Here

TOP

Related Classes of org.onesocialweb.openfire.model.activity.PersistentActivityEntry

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.