Esempio n. 1
0
  public boolean changeOwner(MucRoom room, long ownerId) {
    if (room.getOwner().equals(ownerId)) {
      return false;
    }
    MucOccupant o = oDao.findByRoomIdAndUserId(room.getId(), ownerId);
    if (o == null) {
      return false;
    }
    o.setRole(Role.Moderator);
    oDao.save(o);

    MucOccupant o2 = oDao.findByRoomIdAndUserId(room.getId(), room.getOwner());
    if (o2 != null) {
      o2.setRole(Role.Participant);
      oDao.save(o2);
    }

    room.setOwner(ownerId);
    rDao.save(room);
    return true;
  }
Esempio n. 2
0
 public MucRoom add(MucRoom room, Set<MucOccupant> occupants) {
   Preconditions.checkArgument(room.getId() == null);
   rDao.save(room);
   addOccupants(room, occupants);
   return room;
 }
Esempio n. 3
0
 public void upadte(MucRoom room) {
   Preconditions.checkArgument(room.getId() != null);
   rDao.save(room);
 }
Esempio n. 4
0
 public Page<MucRoom> findByOwner(Long ownerId, Pageable pageable) {
   return rDao.findByOwner(ownerId, pageable);
 }
Esempio n. 5
0
 public Page<MucRoom> findByUser(Long userId, Pageable pageable) {
   return rDao.findByUser(userId, pageable);
 }
Esempio n. 6
0
 public Page<MucRoom> findAll(Pageable pageable) {
   return rDao.findAll(pageable);
 }
Esempio n. 7
0
 public MucRoom findOne(long tenantId, Long id) {
   changeTenantSchema(tenantId);
   return rDao.findOne(id);
 }
Esempio n. 8
0
 public MucRoom findOne(Long id) {
   return rDao.findOne(id);
 }
Esempio n. 9
0
 public void safeDelete(Long roomId, Long userId) {
   rDao.safeDelete(roomId, userId);
 }
Esempio n. 10
0
 public void delete(Long roomId) {
   rDao.delete(roomId);
 }