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 Summary
Fields Modifier and Type Field Description static intUSER_CALL_DAYS_LIVETIMEThe Constant USER_CALL_DAYS_LIVETIME.
-
Constructor Summary
Constructors Constructor Description CallDAO()Instantiates a new call DAO.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the storage.intdeleteAllUsersCalls()Delete all users calls older of 2 days.CallEntityfindGroupCallByOwnerId(String ownerId)Find group call by owner id.CallEntityfindGroupCallByOwnerTypeId(String ownerId, String ownerType)Find group call by owner type and id.List<CallEntity>findGroupCallsByOwnerTypeId(String ownerId, String ownerType)Find group calls by owner type and id.List<CallEntity>findUserGroupCalls(String userId)Find user group calls.
-
-
-
Field Detail
-
USER_CALL_DAYS_LIVETIME
public static final int USER_CALL_DAYS_LIVETIME
The Constant USER_CALL_DAYS_LIVETIME.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
nullif no call found - Throws:
javax.persistence.PersistenceException- the persistence exceptionIllegalStateException- the illegal state exceptionIllegalArgumentException- 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 idownerType- the owner type- Returns:
- the list with call entities or empty list if nothing found
- Throws:
javax.persistence.PersistenceException- the persistence exceptionIllegalStateException- the illegal state exceptionIllegalArgumentException- 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 idownerType- the owner type- Returns:
- the list with call entities or empty list if nothing found
- Throws:
javax.persistence.PersistenceException- the persistence exceptionIllegalStateException- the illegal state exceptionIllegalArgumentException- 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 exceptionIllegalStateException- the illegal state exceptionIllegalArgumentException- the illegal argument exception
-
deleteAllUsersCalls
public int deleteAllUsersCalls() throws javax.persistence.PersistenceException, IllegalStateException, IllegalArgumentExceptionDelete all users calls older of 2 days.- Returns:
- the int number of actually removed calls
- Throws:
javax.persistence.PersistenceException- the persistence exceptionIllegalStateException- the illegal state exceptionIllegalArgumentException- the illegal argument exception
-
clear
public void clear()
Clear the storage.
-
-