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 Details

    • PERSISTENCE_UNIT

      public static final String PERSISTENCE_UNIT
      JPA persistence unit name
      See Also:
    • securityService

      protected org.opencastproject.security.api.SecurityService securityService
      The 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:
      getLifeCyclePolicy in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.getLifeCyclePolicy(String)
    • getLifeCyclePolicy

      public org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy getLifeCyclePolicy(String id, String orgId) throws org.opencastproject.util.NotFoundException, org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      getLifeCyclePolicy in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.getLifeCyclePolicy(String, String)
    • getLifeCyclePoliciesTotal

      public long getLifeCyclePoliciesTotal(String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      getLifeCyclePoliciesTotal in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.getLifeCyclePolicies(int, int, SortCriterion)
    • 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:
      getLifeCyclePolicies in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.getLifeCyclePolicies(int, int, SortCriterion)
    • getActiveLifeCyclePolicies

      public List<org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy> getActiveLifeCyclePolicies(String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      getActiveLifeCyclePolicies in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.getActiveLifeCyclePolicies(String)
    • createLifeCyclePolicy

      public org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy createLifeCyclePolicy(org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy policy, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      createLifeCyclePolicy in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.createLifeCyclePolicy(LifeCyclePolicy, String)
    • updateLifeCyclePolicy

      public boolean updateLifeCyclePolicy(org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy policy, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      updateLifeCyclePolicy in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.updateLifeCyclePolicy(LifeCyclePolicy, String)
    • deleteLifeCyclePolicy

      public boolean deleteLifeCyclePolicy(org.opencastproject.lifecyclemanagement.api.LifeCyclePolicy policy, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      deleteLifeCyclePolicy in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.deleteLifeCyclePolicy(LifeCyclePolicy, String)
    • deleteAllLifeCyclePoliciesCreatedByConfig

      public void deleteAllLifeCyclePoliciesCreatedByConfig(String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      deleteAllLifeCyclePoliciesCreatedByConfig in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.deleteLifeCyclePolicy(LifeCyclePolicy, String)
    • getLifeCycleTask

      public org.opencastproject.lifecyclemanagement.api.LifeCycleTask getLifeCycleTask(String id) throws org.opencastproject.util.NotFoundException, org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      getLifeCycleTask in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.getLifeCycleTask(String)
    • getLifeCycleTaskByTargetId

      public org.opencastproject.lifecyclemanagement.api.LifeCycleTask getLifeCycleTaskByTargetId(String targetId) throws org.opencastproject.util.NotFoundException, org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      getLifeCycleTaskByTargetId in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.getLifeCycleTaskByTargetId(String)
    • 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:
      getLifeCycleTasksWithStatus in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.getLifeCycleTasksWithStatus(Status, String)
    • createLifeCycleTask

      public org.opencastproject.lifecyclemanagement.api.LifeCycleTask createLifeCycleTask(org.opencastproject.lifecyclemanagement.api.LifeCycleTask task, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      createLifeCycleTask in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.createLifeCycleTask(LifeCycleTask, String)
    • updateLifeCycleTask

      public boolean updateLifeCycleTask(org.opencastproject.lifecyclemanagement.api.LifeCycleTask task, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      updateLifeCycleTask in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.updateLifeCycleTask(LifeCycleTask, String)
    • deleteLifeCycleTask

      public boolean deleteLifeCycleTask(org.opencastproject.lifecyclemanagement.api.LifeCycleTask task, String orgId) throws org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      Specified by:
      deleteLifeCycleTask in interface org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseService
      Throws:
      org.opencastproject.lifecyclemanagement.api.LifeCycleDatabaseException
      See Also:
      • LifeCycleDatabaseService.deleteLifeCycleTask(LifeCycleTask, String)
    • 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 identifier
      orgId - 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 identifier
      orgId - the organisation identifier
      Returns:
      the task in an optional