Class ThemesServiceDatabaseImpl
java.lang.Object
org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
org.opencastproject.themes.persistence.ThemesServiceDatabaseImpl
- All Implemented Interfaces:
IndexProducer,ThemesServiceDatabase
public class ThemesServiceDatabaseImpl
extends AbstractIndexProducer
implements ThemesServiceDatabase
Implements
ThemesServiceDatabase. Defines permanent storage for themes.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DBSessionprotected DBSessionFactoryprotected javax.persistence.EntityManagerFactoryFactory used to createEntityManagers for transactionsprotected ElasticsearchIndexThe elasticsearch indicesprotected OrganizationDirectoryServiceThe organization directory service to get organizationsstatic final Stringprotected SecurityServiceThe security serviceprotected 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.Get the service that implements IndexProducer.getTheme(long id) Return the theme by the unique given id.voidRe-add the data of this service to the index.voidsetDBSessionFactory(DBSessionFactory dbSessionFactory) voidsetEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DIvoidsetIndex(ElasticsearchIndex index) OSGi DIvoidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) OSGi DIvoidsetSecurityService(SecurityService securityService) OSGi callback to set the security service.voidsetUserDirectoryService(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
-
db
-
securityService
The security service -
userDirectoryService
The user directory service -
organizationDirectoryService
The organization directory service to get organizations -
index
The 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
-
setSecurityService
OSGi callback to set the security service.- Parameters:
securityService- the security service
-
setUserDirectoryService
OSGi callback to set the user directory service- Parameters:
userDirectoryService- the user directory service
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) OSGi DI -
setIndex
OSGi DI -
getTheme
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 storeNotFoundException- 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
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 storeNotFoundException
-
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
Description copied from interface:IndexProducerRe-add the data of this service to the index.- Specified by:
repopulatein interfaceIndexProducer- Parameters:
type- Limit the data added to the index. Use ALL to re-index all data.- Throws:
IndexRebuildException
-
getService
Description copied from interface:IndexProducerGet the service that implements IndexProducer.- Specified by:
getServicein interfaceIndexProducer- Returns:
- service The service that implements IndexProducer.
-