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
FieldsModifier and TypeFieldDescriptionprotected org.opencastproject.db.DBSessionprotected org.opencastproject.db.DBSessionFactoryprotected javax.persistence.EntityManagerFactoryFactory used to createEntityManagers for transactionsprotected org.opencastproject.elasticsearch.index.ElasticsearchIndexThe elasticsearch indicesprotected org.opencastproject.security.api.OrganizationDirectoryServiceThe organization directory service to get organizationsstatic final Stringprotected org.opencastproject.security.api.SecurityServiceThe security serviceprotected org.opencastproject.security.api.UserDirectoryServiceThe user directory service -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) CreatesEntityManagerFactoryusing persistence provider and properties passed via OSGi.intvoiddeleteTheme(long id) Delete a theme by using a unique id to find it.org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.ServicegetTheme(long id) Return the theme by the unique given id.voidrepopulate(org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.DataType type) voidsetDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory) voidsetEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DIvoidsetIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex index) OSGi DIvoidsetOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService) OSGi DIvoidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback to set the security service.voidsetUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) OSGi callback to set the user directory serviceupdateTheme(Theme theme) 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, logSkippingElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opencastproject.elasticsearch.index.rebuild.IndexProducer
dataTypeSupported, getSupportedDataTypes
-
Field Details
-
PERSISTENCE_UNIT
- See Also:
-
emf
protected javax.persistence.EntityManagerFactory emfFactory used to createEntityManagers for transactions -
dbSessionFactory
protected org.opencastproject.db.DBSessionFactory dbSessionFactory -
db
protected org.opencastproject.db.DBSession db -
securityService
protected org.opencastproject.security.api.SecurityService securityServiceThe security service -
userDirectoryService
protected org.opencastproject.security.api.UserDirectoryService userDirectoryServiceThe user directory service -
organizationDirectoryService
protected org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryServiceThe organization directory service to get organizations -
index
protected org.opencastproject.elasticsearch.index.ElasticsearchIndex indexThe elasticsearch indices
-
-
Constructor Details
-
ThemesServiceDatabaseImpl
public ThemesServiceDatabaseImpl()
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) CreatesEntityManagerFactoryusing 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:ThemesServiceDatabaseReturn the theme by the unique given id.- Specified by:
getThemein interfaceThemesServiceDatabase- Parameters:
id- The unique id of the theme.- Returns:
- A
Themethat matches the id. - Throws:
ThemesServiceDatabaseException- if there is a problem communicating with the underlying data storeorg.opencastproject.util.NotFoundException- if the theme could not be found
-
updateTheme
Description copied from interface:ThemesServiceDatabaseCrate or update a theme.- Specified by:
updateThemein interfaceThemesServiceDatabase- 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:ThemesServiceDatabaseDelete a theme by using a unique id to find it.- Specified by:
deleteThemein interfaceThemesServiceDatabase- Parameters:
id- The unique id of the theme.- Throws:
ThemesServiceDatabaseException- if there is a problem communicating with the underlying data storeorg.opencastproject.util.NotFoundException
-
countThemes
- Specified by:
countThemesin interfaceThemesServiceDatabase- 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:
repopulatein interfaceorg.opencastproject.elasticsearch.index.rebuild.IndexProducer- Throws:
org.opencastproject.elasticsearch.index.rebuild.IndexRebuildException
-
getService
public org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.Service getService()- Specified by:
getServicein interfaceorg.opencastproject.elasticsearch.index.rebuild.IndexProducer
-