Class ThemesServiceDatabaseImpl

java.lang.Object
org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
org.opencastproject.themes.persistence.ThemesServiceDatabaseImpl
All Implemented Interfaces:
org.opencastproject.elasticsearch.index.rebuild.IndexProducer, ThemesServiceDatabase

public class ThemesServiceDatabaseImpl extends org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer implements ThemesServiceDatabase
Implements ThemesServiceDatabase. Defines permanent storage for themes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.opencastproject.db.DBSession
     
    protected org.opencastproject.db.DBSessionFactory
     
    protected javax.persistence.EntityManagerFactory
    Factory used to create EntityManagers for transactions
    protected org.opencastproject.elasticsearch.index.ElasticsearchIndex
    The elasticsearch indices
    protected org.opencastproject.security.api.OrganizationDirectoryService
    The organization directory service to get organizations
    static final String
     
    protected org.opencastproject.security.api.SecurityService
    The security service
    protected org.opencastproject.security.api.UserDirectoryService
    The user directory service
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(org.osgi.service.component.ComponentContext cc)
    Creates EntityManagerFactory using persistence provider and properties passed via OSGi.
    int
     
    void
    deleteTheme(long id)
    Delete a theme by using a unique id to find it.
    org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.Service
     
    getTheme(long id)
    Return the theme by the unique given id.
    void
    repopulate(org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.DataType type)
     
    void
    setDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory)
     
    void
    setEntityManagerFactory(javax.persistence.EntityManagerFactory emf)
    OSGi DI
    void
    setIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex index)
    OSGi DI
    void
    setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService)
    OSGi DI
    void
    setSecurityService(org.opencastproject.security.api.SecurityService securityService)
    OSGi callback to set the security service.
    void
    setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
    OSGi callback to set the user directory service
    Crate or update a theme.

    Methods inherited from class org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer

    logIndexRebuildBegin, logIndexRebuildBegin, logIndexRebuildError, logIndexRebuildError, logIndexRebuildError, logIndexRebuildProgress, logIndexRebuildProgress, logIndexRebuildProgress, logIndexRebuildProgress, logSkippingElement, logSkippingElement

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer

    dataTypeSupported, getSupportedDataTypes
  • Field Details

    • PERSISTENCE_UNIT

      public static final String PERSISTENCE_UNIT
      See Also:
    • emf

      protected javax.persistence.EntityManagerFactory emf
      Factory used to create EntityManagers for transactions
    • dbSessionFactory

      protected org.opencastproject.db.DBSessionFactory dbSessionFactory
    • db

      protected org.opencastproject.db.DBSession db
    • securityService

      protected org.opencastproject.security.api.SecurityService securityService
      The security service
    • userDirectoryService

      protected org.opencastproject.security.api.UserDirectoryService userDirectoryService
      The user directory service
    • organizationDirectoryService

      protected org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService
      The organization directory service to get organizations
    • index

      protected org.opencastproject.elasticsearch.index.ElasticsearchIndex index
      The elasticsearch indices
  • Constructor Details

    • ThemesServiceDatabaseImpl

      public ThemesServiceDatabaseImpl()
  • Method Details

    • activate

      public void activate(org.osgi.service.component.ComponentContext cc)
      Creates EntityManagerFactory using persistence provider and properties passed via OSGi.
      Parameters:
      cc -
    • 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 security service
    • setUserDirectoryService

      public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
      OSGi callback to set the user directory service
      Parameters:
      userDirectoryService - the user directory service
    • setOrganizationDirectoryService

      public void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService)
      OSGi DI
    • setIndex

      public void setIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex index)
      OSGi DI
    • getTheme

      public Theme getTheme(long id) throws ThemesServiceDatabaseException, org.opencastproject.util.NotFoundException
      Description copied from interface: ThemesServiceDatabase
      Return the theme by the unique given id.
      Specified by:
      getTheme in interface ThemesServiceDatabase
      Parameters:
      id - The unique id of the theme.
      Returns:
      A Theme that matches the id.
      Throws:
      ThemesServiceDatabaseException - if there is a problem communicating with the underlying data store
      org.opencastproject.util.NotFoundException - if the theme could not be found
    • updateTheme

      public Theme updateTheme(Theme theme) throws ThemesServiceDatabaseException
      Description copied from interface: ThemesServiceDatabase
      Crate or update a theme.
      Specified by:
      updateTheme in interface ThemesServiceDatabase
      Parameters:
      theme - The theme to create or update.
      Returns:
      The updated Theme.
      Throws:
      ThemesServiceDatabaseException - if there is a problem communicating with the underlying data store
    • deleteTheme

      public void deleteTheme(long id) throws ThemesServiceDatabaseException, org.opencastproject.util.NotFoundException
      Description copied from interface: ThemesServiceDatabase
      Delete a theme by using a unique id to find it.
      Specified by:
      deleteTheme in interface ThemesServiceDatabase
      Parameters:
      id - The unique id of the theme.
      Throws:
      ThemesServiceDatabaseException - if there is a problem communicating with the underlying data store
      org.opencastproject.util.NotFoundException
    • countThemes

      public int countThemes() throws ThemesServiceDatabaseException
      Specified by:
      countThemes in interface ThemesServiceDatabase
      Returns:
      Count the total number of themes.
      Throws:
      ThemesServiceDatabaseException - if there is a problem communicating with the underlying data store
    • repopulate

      public void repopulate(org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.DataType type) throws org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException
      Specified by:
      repopulate in interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer
      Throws:
      org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException
    • getService

      public org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.Service getService()
      Specified by:
      getService in interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer