Class LifeCycleDatabaseServiceImpl
java.lang.Object
org.opencastproject.lifecyclemanagement.impl.persistence.LifeCycleDatabaseServiceImpl
- All Implemented Interfaces:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
public class LifeCycleDatabaseServiceImpl
extends Object
implements org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJPA persistence unit nameprotected org.opencastproject.security.api.SecurityServiceThe security service -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) org.opencastproject.lifecyclemanagement.api.LifeCyclePolicycreateLifeCyclePolicy(org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy policy, String orgId) org.opencastproject.lifecyclemanagement.api.LifeCycleTaskcreateLifeCycleTask(org.opencastproject.lifecyclemanagement.api.LifeCycleTask task, String orgId) voidbooleandeleteLifeCyclePolicy(org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy policy, String orgId) booleandeleteLifeCycleTask(org.opencastproject.lifecyclemanagement.api.LifeCycleTask task, String orgId) List<org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy> getActiveLifeCyclePolicies(String orgId) List<org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy> getLifeCyclePolicies(int limit, int offset, org.opencastproject.util.requests.SortCriterion sortCriterion) longgetLifeCyclePoliciesTotal(String orgId) org.opencastproject.lifecyclemanagement.api.LifeCyclePolicyorg.opencastproject.lifecyclemanagement.api.LifeCyclePolicygetLifeCyclePolicy(String id, String orgId) protected Function<javax.persistence.EntityManager, Optional<org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy>> getLifeCyclePolicyById(String id, String orgId) Gets a life cycle policy by its ID, using the current organizational context.org.opencastproject.lifecyclemanagement.api.LifeCycleTaskprotected Function<javax.persistence.EntityManager, Optional<org.opencastproject.lifecyclemanagement.api.LifeCycleTask>> getLifeCycleTaskById(String id, String orgId) Gets a life cycle task by its ID, using the current organizational context.org.opencastproject.lifecyclemanagement.api.LifeCycleTaskgetLifeCycleTaskByTargetId(String targetId) List<org.opencastproject.lifecyclemanagement.api.LifeCycleTask> getLifeCycleTasksWithStatus(org.opencastproject.lifecyclemanagement.api.Status status, String orgId) voidsetDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory) voidsetEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DIvoidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback to set the security service.booleanupdateLifeCyclePolicy(org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy policy, String orgId) booleanupdateLifeCycleTask(org.opencastproject.lifecyclemanagement.api.LifeCycleTask task, String orgId)
-
Field Details
-
PERSISTENCE_UNIT
JPA persistence unit name- See Also:
-
securityService
protected org.opencastproject.security.api.SecurityService securityServiceThe security service
-
-
Constructor Details
-
LifeCycleDatabaseServiceImpl
public LifeCycleDatabaseServiceImpl()
-
-
Method Details
-
setEntityManagerFactory
public void setEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DI -
setDBSessionFactory
public void setDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory) -
setSecurityService
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback to set the security service.- Parameters:
securityService- the securityService to set
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) -
getLifeCyclePolicy
public org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy getLifeCyclePolicy(String id) throws org.opencastproject.util.NotFoundException, org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
getLifeCyclePolicyin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.util.NotFoundExceptionorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
getLifeCyclePolicy
public org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy getLifeCyclePolicy(String id, String orgId) throws org.opencastproject.util.NotFoundException, org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
getLifeCyclePolicyin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.util.NotFoundExceptionorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
getLifeCyclePoliciesTotal
public long getLifeCyclePoliciesTotal(String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
getLifeCyclePoliciesTotalin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
getLifeCyclePolicies
public List<org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy> getLifeCyclePolicies(int limit, int offset, org.opencastproject.util.requests.SortCriterion sortCriterion) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
getLifeCyclePoliciesin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
getActiveLifeCyclePolicies
public List<org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy> getActiveLifeCyclePolicies(String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
getActiveLifeCyclePoliciesin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
createLifeCyclePolicy
public org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy createLifeCyclePolicy(org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy policy, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
createLifeCyclePolicyin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
updateLifeCyclePolicy
public boolean updateLifeCyclePolicy(org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy policy, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
updateLifeCyclePolicyin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
deleteLifeCyclePolicy
public boolean deleteLifeCyclePolicy(org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy policy, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
deleteLifeCyclePolicyin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
deleteAllLifeCyclePoliciesCreatedByConfig
public void deleteAllLifeCyclePoliciesCreatedByConfig(String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
deleteAllLifeCyclePoliciesCreatedByConfigin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
getLifeCycleTask
public org.opencastproject.lifecyclemanagement.api.LifeCycleTask getLifeCycleTask(String id) throws org.opencastproject.util.NotFoundException, org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
getLifeCycleTaskin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.util.NotFoundExceptionorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
getLifeCycleTaskByTargetId
public org.opencastproject.lifecyclemanagement.api.LifeCycleTask getLifeCycleTaskByTargetId(String targetId) throws org.opencastproject.util.NotFoundException, org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
getLifeCycleTaskByTargetIdin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.util.NotFoundExceptionorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
getLifeCycleTasksWithStatus
public List<org.opencastproject.lifecyclemanagement.api.LifeCycleTask> getLifeCycleTasksWithStatus(org.opencastproject.lifecyclemanagement.api.Status status, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
getLifeCycleTasksWithStatusin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
createLifeCycleTask
public org.opencastproject.lifecyclemanagement.api.LifeCycleTask createLifeCycleTask(org.opencastproject.lifecyclemanagement.api.LifeCycleTask task, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
createLifeCycleTaskin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
updateLifeCycleTask
public boolean updateLifeCycleTask(org.opencastproject.lifecyclemanagement.api.LifeCycleTask task, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
updateLifeCycleTaskin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
deleteLifeCycleTask
public boolean deleteLifeCycleTask(org.opencastproject.lifecyclemanagement.api.LifeCycleTask task, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException - Specified by:
deleteLifeCycleTaskin interfaceorg.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService- Throws:
org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException- See Also:
-
getLifeCyclePolicyById
protected Function<javax.persistence.EntityManager,Optional<org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy>> getLifeCyclePolicyById(String id, String orgId) Gets a life cycle policy by its ID, using the current organizational context.- Parameters:
id- the policy identifierorgId- the organisation identifier- Returns:
- the policy in an optional
-
getLifeCycleTaskById
protected Function<javax.persistence.EntityManager,Optional<org.opencastproject.lifecyclemanagement.api.LifeCycleTask>> getLifeCycleTaskById(String id, String orgId) Gets a life cycle task by its ID, using the current organizational context.- Parameters:
id- the task identifierorgId- the organisation identifier- Returns:
- the task in an optional
-