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

    Fields
    Modifier and Type
    Field
    Description
    protected org.opencastproject.security.api.OrganizationDirectoryService
    The organization directory
    Persistent storage
    protected org.opencastproject.security.api.SecurityService
    The security service

    Fields inherited from interface org.opencastproject.series.api.SeriesService

    JOB_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(org.osgi.service.component.ComponentContext cc)
    Activates Series Service.
    void
    addMessageHandler(org.opencastproject.message.broker.api.update.SeriesUpdateHandler handler)
    OSGi callbacks for settings and removing handlers.
    void
    deleteSeries(String seriesID)
     
    boolean
     
    void
    deleteSeriesProperty(String seriesID, String propertyName)
     
    static boolean
    equals(org.opencastproject.metadata.dublincore.DublinCoreCatalog a, org.opencastproject.metadata.dublincore.DublinCoreCatalog b)
    Define equality on DublinCoreCatalogs.
    static boolean
    equals(org.opencastproject.security.api.AccessControlList a, org.opencastproject.security.api.AccessControlList b)
    Define equality on AccessControlLists.
    List<org.opencastproject.series.api.Series>
     
    org.opencastproject.metadata.dublincore.DublinCoreCatalog
    getSeries(String seriesID)
     
    org.opencastproject.security.api.AccessControlList
     
    int
     
    Optional<byte[]>
     
     
     
    getSeriesProperty(String seriesID, String propertyName)
     
    org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.Service
     
    void
    removeMessageHandler(org.opencastproject.message.broker.api.update.SeriesUpdateHandler handler)
     
    void
    repopulate(org.opencastproject.elasticsearch.index.rebuild.IndexRebuildService.DataType type)
     
    void
    setAclServiceFactory(org.opencastproject.authorization.xacml.manager.api.AclServiceFactory aclServiceFactory)
     
    void
    setElasticsearchIndex(org.opencastproject.elasticsearch.index.ElasticsearchIndex index)
    OSGi callbacks for setting the Elasticsearch index.
    void
    setOrgDirectory(org.opencastproject.security.api.OrganizationDirectoryService orgDirectory)
    OSGi callback for setting the organization directory service.
    void
    OSGi callback for setting persistance.
    void
    setSecurityService(org.opencastproject.security.api.SecurityService securityService)
    OSGi callback for setting the security service.
    boolean
    updateAccessControl(String seriesId, org.opencastproject.security.api.AccessControlList accessControl)
     
    boolean
    updateAccessControl(String seriesId, org.opencastproject.security.api.AccessControlList accessControl, boolean overrideEpisodeAcl)
     
    boolean
    updateExtendedMetadata(String seriesId, String type, org.opencastproject.metadata.dublincore.DublinCoreCatalog dc)
     
    org.opencastproject.metadata.dublincore.DublinCoreCatalog
    updateSeries(org.opencastproject.metadata.dublincore.DublinCoreCatalog dc)
     
    boolean
    updateSeriesElement(String seriesId, String type, byte[] data)
     
    void
    updateSeriesProperty(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, 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

      protected SeriesServiceDatabase persistence
      Persistent storage
    • securityService

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

      protected org.opencastproject.security.api.OrganizationDirectoryService orgDirectory
      The organization directory
  • Constructor Details

    • SeriesServiceImpl

      public SeriesServiceImpl()
  • Method Details

    • setPersistence

      public void setPersistence(SeriesServiceDatabase persistence)
      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

      public void activate(org.osgi.service.component.ComponentContext cc) throws Exception
      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:
      updateSeries in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.series.api.SeriesException
      org.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:
      updateAccessControl in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.util.NotFoundException
      org.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:
      updateAccessControl in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.series.api.SeriesException
    • deleteSeries

      public void deleteSeries(String seriesID) throws org.opencastproject.series.api.SeriesException, org.opencastproject.util.NotFoundException
      Specified by:
      deleteSeries in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.series.api.SeriesException
      org.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:
      getSeries in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.series.api.SeriesException
      org.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:
      getAllForAdministrativeRead in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.series.api.SeriesException
      org.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:
      getSeriesAccessControl in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.util.NotFoundException
      org.opencastproject.series.api.SeriesException
    • getSeriesCount

      public int getSeriesCount() throws org.opencastproject.series.api.SeriesException
      Specified by:
      getSeriesCount in interface org.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:
      getSeriesProperties in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.series.api.SeriesException
      org.opencastproject.util.NotFoundException
      org.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:
      getSeriesProperty in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.series.api.SeriesException
      org.opencastproject.util.NotFoundException
      org.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:
      updateSeriesProperty in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.series.api.SeriesException
      org.opencastproject.util.NotFoundException
      org.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:
      deleteSeriesProperty in interface org.opencastproject.series.api.SeriesService
      Throws:
      org.opencastproject.series.api.SeriesException
      org.opencastproject.util.NotFoundException
      org.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:
      getSeriesElements in interface org.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:
      getSeriesElementData in interface org.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:
      updateExtendedMetadata in interface org.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:
      updateSeriesElement in interface org.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:
      deleteSeriesElement in interface org.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:
      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