Class CallDAO

java.lang.Object
org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CallEntity,String>
org.exoplatform.webconferencing.dao.CallDAO
All Implemented Interfaces:
org.exoplatform.commons.api.persistence.GenericDAO<CallEntity,String>

public class CallDAO extends org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CallEntity,String>
Created by The eXo Platform SAS.
Version:
$Id: CallDAO.java 00000 Dec 22, 2017 pnedonosko $
Author:
Peter Nedonosko
  • Field Details

    • USER_CALL_DAYS_LIVETIME

      public static final int USER_CALL_DAYS_LIVETIME
      The Constant USER_CALL_DAYS_LIVETIME.
      See Also:
  • Constructor Details

    • CallDAO

      public CallDAO()
      Instantiates a new call DAO.
  • Method Details

    • findGroupCallByOwnerId

      public CallEntity findGroupCallByOwnerId(String ownerId) throws javax.persistence.PersistenceException, IllegalStateException, IllegalArgumentException
      Find group call by owner id.
      Parameters:
      ownerId - the owner id
      Returns:
      the call entity or null if no call found
      Throws:
      javax.persistence.PersistenceException - the persistence exception
      IllegalStateException - the illegal state exception
      IllegalArgumentException - the illegal argument exception
    • findGroupCallByOwnerTypeId

      public CallEntity findGroupCallByOwnerTypeId(String ownerId, String ownerType) throws javax.persistence.PersistenceException, IllegalStateException, IllegalArgumentException
      Find group call by owner type and id.
      Parameters:
      ownerId - the owner id
      ownerType - the owner type
      Returns:
      the list with call entities or empty list if nothing found
      Throws:
      javax.persistence.PersistenceException - the persistence exception
      IllegalStateException - the illegal state exception
      IllegalArgumentException - the illegal argument exception
    • findGroupCallsByOwnerTypeId

      public List<CallEntity> findGroupCallsByOwnerTypeId(String ownerId, String ownerType) throws javax.persistence.PersistenceException, IllegalStateException, IllegalArgumentException
      Find group calls by owner type and id.
      Parameters:
      ownerId - the owner id
      ownerType - the owner type
      Returns:
      the list with call entities or empty list if nothing found
      Throws:
      javax.persistence.PersistenceException - the persistence exception
      IllegalStateException - the illegal state exception
      IllegalArgumentException - the illegal argument exception
    • findUserGroupCalls

      public List<CallEntity> findUserGroupCalls(String userId) throws javax.persistence.PersistenceException, IllegalStateException, IllegalArgumentException
      Find user group calls.
      Parameters:
      userId - the user id
      Returns:
      the list, it will be empty if no calls found
      Throws:
      javax.persistence.PersistenceException - the persistence exception
      IllegalStateException - the illegal state exception
      IllegalArgumentException - the illegal argument exception
    • deleteAllUsersCalls

      public int deleteAllUsersCalls() throws javax.persistence.PersistenceException, IllegalStateException, IllegalArgumentException
      Delete all users calls older of 2 days.
      Returns:
      the int number of actually removed calls
      Throws:
      javax.persistence.PersistenceException - the persistence exception
      IllegalStateException - the illegal state exception
      IllegalArgumentException - the illegal argument exception
    • findGroupCallsByState

      public List<CallEntity> findGroupCallsByState(String state)
      Find all group calls by specific state
      Parameters:
      state -
      Returns:
      list of group calls, or empty list if no matched result
    • updateStartedCallState

      public int updateStartedCallState(String state)
      Update Call state
      Parameters:
      state -
      Returns:
      Number of updated calls
    • clear

      public void clear()
      Clear the storage.