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
FieldsModifier and TypeFieldDescriptionstatic final intThe Constant USER_CALL_DAYS_LIVETIME.Fields inherited from class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl
modelClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the storage.intDelete all users calls older of 2 days.findGroupCallByOwnerId(String ownerId) Find group call by owner id.findGroupCallByOwnerTypeId(String ownerId, String ownerType) Find group call by owner type and id.findGroupCallsByOwnerTypeId(String ownerId, String ownerType) Find group calls by owner type and id.findGroupCallsByState(String state) Find all group calls by specific statefindUserGroupCalls(String userId) Find user group calls.intupdateStartedCallState(String state) Update Call stateMethods inherited from class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl
count, create, createAll, delete, deleteAll, deleteAll, find, findAll, getEntityManager, getHibernateDialect, isMSSQLDialect, isOrcaleDialect, update, updateAll
-
Field Details
-
USER_CALL_DAYS_LIVETIME
public static final int USER_CALL_DAYS_LIVETIMEThe 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 jakarta.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:
jakarta.persistence.PersistenceException- the persistence exceptionIllegalStateException- the illegal state exceptionIllegalArgumentException- the illegal argument exception
-
findGroupCallByOwnerTypeId
public CallEntity findGroupCallByOwnerTypeId(String ownerId, String ownerType) throws jakarta.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:
jakarta.persistence.PersistenceException- the persistence exceptionIllegalStateException- the illegal state exceptionIllegalArgumentException- the illegal argument exception
-
findGroupCallsByOwnerTypeId
public List<CallEntity> findGroupCallsByOwnerTypeId(String ownerId, String ownerType) throws jakarta.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:
jakarta.persistence.PersistenceException- the persistence exceptionIllegalStateException- the illegal state exceptionIllegalArgumentException- the illegal argument exception
-
findUserGroupCalls
public List<CallEntity> findUserGroupCalls(String userId) throws jakarta.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:
jakarta.persistence.PersistenceException- the persistence exceptionIllegalStateException- the illegal state exceptionIllegalArgumentException- the illegal argument exception
-
deleteAllUsersCalls
public int deleteAllUsersCalls() throws jakarta.persistence.PersistenceException, IllegalStateException, IllegalArgumentExceptionDelete all users calls older of 2 days.- Returns:
- the int number of actually removed calls
- Throws:
jakarta.persistence.PersistenceException- the persistence exceptionIllegalStateException- the illegal state exceptionIllegalArgumentException- the illegal argument exception
-
findGroupCallsByState
Find all group calls by specific state- Parameters:
state-- Returns:
- list of group calls, or empty list if no matched result
-
updateStartedCallState
Update Call state- Parameters:
state-- Returns:
- Number of updated calls
-
clear
public void clear()Clear the storage.
-