Package org.opencastproject.series.impl
Class SeriesServiceImpl
java.lang.Object
org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
org.opencastproject.series.impl.SeriesServiceImpl
- All Implemented Interfaces:
org.opencastproject.elasticsearch.index.rebuild.IndexProducer,org.opencastproject.series.api.SeriesService
public class SeriesServiceImpl
extends org.opencastproject.elasticsearch.index.rebuild.AbstractIndexProducer
implements org.opencastproject.series.api.SeriesService
Implements
SeriesService. Uses SeriesServiceDatabase for permanent storage and
ElasticsearchIndex for searching.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.opencastproject.security.api.OrganizationDirectoryServiceThe organization directoryprotected SeriesServiceDatabasePersistent storageprotected org.opencastproject.security.api.SecurityServiceThe security serviceFields inherited from interface org.opencastproject.series.api.SeriesService
JOB_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) Activates Series Service.voidaddMessageHandler(org.opencastproject.message.broker.api.update.SeriesUpdateHandler handler) OSGi callbacks for settings and removing handlers.voiddeleteSeries(String seriesID) booleandeleteSeriesElement(String seriesId, String type) voiddeleteSeriesProperty(String seriesID, String propertyName) static booleanequals(org.opencastproject.metadata.dublincore.DublinCoreCatalog a, org.opencastproject.metadata.dublincore.DublinCoreCatalog b) Define equality on DublinCoreCatalogs.static booleanequals(org.opencastproject.security.api.AccessControlList a, org.opencastproject.security.api.AccessControlList b) Define equality on AccessControlLists.List<org.opencastproject.series.api.Series> getAllForAdministrativeRead(Date from, Optional<Date> to, int limit) org.opencastproject.metadata.dublincore.DublinCoreCatalogorg.opencastproject.security.api.AccessControlListgetSeriesAccessControl(String seriesID) intOptional<byte[]> getSeriesElementData(String seriesId, String type) getSeriesElements(String seriesId) getSeriesProperties(String seriesID) getSeriesProperty(String seriesID, String propertyName) org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.ServicevoidremoveMessageHandler(org.opencastproject.message.broker.api.update.SeriesUpdateHandler handler) voidrepopulate(org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.DataType type) voidsetAclServiceFactory(org.opencastproject.authorization.xacml.manager.api.AclServiceFactory aclServiceFactory) voidsetElasticsearchIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex index) OSGi callbacks for setting the Elasticsearch index.voidsetOrgDirectory(org.opencastproject.security.api.OrganizationDirectoryService orgDirectory) OSGi callback for setting the organization directory service.voidsetPersistence(SeriesServiceDatabase persistence) OSGi callback for setting persistance.voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback for setting the security service.booleanupdateAccessControl(String seriesId, org.opencastproject.security.api.AccessControlList accessControl) booleanupdateAccessControl(String seriesId, org.opencastproject.security.api.AccessControlList accessControl, boolean overrideEpisodeAcl) booleanupdateExtendedMetadata(String seriesId, String type, org.opencastproject.metadata.dublincore.DublinCoreCatalog dc) org.opencastproject.metadata.dublincore.DublinCoreCatalogupdateSeries(org.opencastproject.metadata.dublincore.DublinCoreCatalog dc) booleanupdateSeriesElement(String seriesId, String type, byte[] data) voidupdateSeriesProperty(String seriesID, String propertyName, String propertyValue) 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
Persistent storage -
securityService
protected org.opencastproject.security.api.SecurityService securityServiceThe security service -
orgDirectory
protected org.opencastproject.security.api.OrganizationDirectoryService orgDirectoryThe organization directory
-
-
Constructor Details
-
SeriesServiceImpl
public SeriesServiceImpl()
-
-
Method Details
-
setPersistence
OSGi callback for setting persistance. -
setSecurityService
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback for setting the security service. -
setOrgDirectory
public void setOrgDirectory(org.opencastproject.security.api.OrganizationDirectoryService orgDirectory) OSGi callback for setting the organization directory service. -
addMessageHandler
public void addMessageHandler(org.opencastproject.message.broker.api.update.SeriesUpdateHandler handler) OSGi callbacks for settings and removing handlers. -
removeMessageHandler
public void removeMessageHandler(org.opencastproject.message.broker.api.update.SeriesUpdateHandler handler) -
setElasticsearchIndex
public void setElasticsearchIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex index) OSGi callbacks for setting the Elasticsearch index. -
setAclServiceFactory
public void setAclServiceFactory(org.opencastproject.authorization.xacml.manager.api.AclServiceFactory aclServiceFactory) -
activate
Activates Series Service. Checks whether we are using synchronous or asynchronous indexing. If asynchronous is used, Executor service is set. If index is empty, persistent storage is queried if it contains any series. If that is the case, series are retrieved and indexed.- Throws:
Exception
-
updateSeries
public org.opencastproject.metadata.dublincore.DublinCoreCatalog updateSeries(org.opencastproject.metadata.dublincore.DublinCoreCatalog dc) throws org.opencastproject.series.api.SeriesException, org.opencastproject.security.api.UnauthorizedException - Specified by:
updateSeriesin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesExceptionorg.opencastproject.security.api.UnauthorizedException
-
updateAccessControl
public boolean updateAccessControl(String seriesId, org.opencastproject.security.api.AccessControlList accessControl) throws org.opencastproject.util.NotFoundException, org.opencastproject.series.api.SeriesException - Specified by:
updateAccessControlin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.util.NotFoundExceptionorg.opencastproject.series.api.SeriesException
-
updateAccessControl
public boolean updateAccessControl(String seriesId, org.opencastproject.security.api.AccessControlList accessControl, boolean overrideEpisodeAcl) throws org.opencastproject.util.NotFoundException, org.opencastproject.series.api.SeriesException - Specified by:
updateAccessControlin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.util.NotFoundExceptionorg.opencastproject.series.api.SeriesException
-
deleteSeries
public void deleteSeries(String seriesID) throws org.opencastproject.series.api.SeriesException, org.opencastproject.util.NotFoundException - Specified by:
deleteSeriesin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesExceptionorg.opencastproject.util.NotFoundException
-
getSeries
public org.opencastproject.metadata.dublincore.DublinCoreCatalog getSeries(String seriesID) throws org.opencastproject.series.api.SeriesException, org.opencastproject.util.NotFoundException - Specified by:
getSeriesin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesExceptionorg.opencastproject.util.NotFoundException
-
getAllForAdministrativeRead
public List<org.opencastproject.series.api.Series> getAllForAdministrativeRead(Date from, Optional<Date> to, int limit) throws org.opencastproject.series.api.SeriesException, org.opencastproject.security.api.UnauthorizedException - Specified by:
getAllForAdministrativeReadin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesExceptionorg.opencastproject.security.api.UnauthorizedException
-
getSeriesAccessControl
public org.opencastproject.security.api.AccessControlList getSeriesAccessControl(String seriesID) throws org.opencastproject.util.NotFoundException, org.opencastproject.series.api.SeriesException - Specified by:
getSeriesAccessControlin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.util.NotFoundExceptionorg.opencastproject.series.api.SeriesException
-
getSeriesCount
public int getSeriesCount() throws org.opencastproject.series.api.SeriesException- Specified by:
getSeriesCountin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesException
-
getSeriesProperties
public Map<String,String> getSeriesProperties(String seriesID) throws org.opencastproject.series.api.SeriesException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException - Specified by:
getSeriesPropertiesin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesExceptionorg.opencastproject.util.NotFoundExceptionorg.opencastproject.security.api.UnauthorizedException
-
getSeriesProperty
public String getSeriesProperty(String seriesID, String propertyName) throws org.opencastproject.series.api.SeriesException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException - Specified by:
getSeriesPropertyin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesExceptionorg.opencastproject.util.NotFoundExceptionorg.opencastproject.security.api.UnauthorizedException
-
updateSeriesProperty
public void updateSeriesProperty(String seriesID, String propertyName, String propertyValue) throws org.opencastproject.series.api.SeriesException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException - Specified by:
updateSeriesPropertyin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesExceptionorg.opencastproject.util.NotFoundExceptionorg.opencastproject.security.api.UnauthorizedException
-
deleteSeriesProperty
public void deleteSeriesProperty(String seriesID, String propertyName) throws org.opencastproject.series.api.SeriesException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException - Specified by:
deleteSeriesPropertyin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesExceptionorg.opencastproject.util.NotFoundExceptionorg.opencastproject.security.api.UnauthorizedException
-
equals
public static boolean equals(org.opencastproject.metadata.dublincore.DublinCoreCatalog a, org.opencastproject.metadata.dublincore.DublinCoreCatalog b) Define equality on DublinCoreCatalogs. Two DublinCores are considered equal if they have the same properties and if each property has the same values in the same order.Note: As long as http://opencast.jira.com/browse/MH-8759 is not fixed, the encoding scheme of values is not considered.
Implementation Note: DublinCores should not be compared by their string serialization since the ordering of properties is not defined and cannot be guaranteed between serializations.
-
equals
public static boolean equals(org.opencastproject.security.api.AccessControlList a, org.opencastproject.security.api.AccessControlList b) Define equality on AccessControlLists. Two AccessControlLists are considered equal if they contain the exact same entries no matter in which order. -
getSeriesElements
public Optional<Map<String,byte[]>> getSeriesElements(String seriesId) throws org.opencastproject.series.api.SeriesException - Specified by:
getSeriesElementsin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesException
-
getSeriesElementData
public Optional<byte[]> getSeriesElementData(String seriesId, String type) throws org.opencastproject.series.api.SeriesException - Specified by:
getSeriesElementDatain interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesException
-
updateExtendedMetadata
public boolean updateExtendedMetadata(String seriesId, String type, org.opencastproject.metadata.dublincore.DublinCoreCatalog dc) throws org.opencastproject.series.api.SeriesException - Specified by:
updateExtendedMetadatain interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesException
-
updateSeriesElement
public boolean updateSeriesElement(String seriesId, String type, byte[] data) throws org.opencastproject.series.api.SeriesException - Specified by:
updateSeriesElementin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesException
-
deleteSeriesElement
public boolean deleteSeriesElement(String seriesId, String type) throws org.opencastproject.series.api.SeriesException - Specified by:
deleteSeriesElementin interfaceorg.opencastproject.series.api.SeriesService- Throws:
org.opencastproject.series.api.SeriesException
-
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
-