Interface SeriesService


public interface SeriesService
Series service API for creating, removing and searching over series.
  • Field Details

  • Method Details

    • updateSeries

      org.opencastproject.metadata.dublincore.DublinCoreCatalog updateSeries(org.opencastproject.metadata.dublincore.DublinCoreCatalog dc) throws SeriesException, org.opencastproject.security.api.UnauthorizedException
      Adds or updates series. IllegalArgumentException is thrown if dc argument is null.
      Parameters:
      dc - DublinCoreCatalog representing series
      Returns:
      Dublin Core catalog of newly created series or null if series Dublin Core was just updated
      Throws:
      SeriesException - if adding or updating fails
      org.opencastproject.security.api.UnauthorizedException - if the current user is not authorized to perform this action
    • updateAccessControl

      boolean updateAccessControl(String seriesID, org.opencastproject.security.api.AccessControlList accessControl) throws org.opencastproject.util.NotFoundException, SeriesException, org.opencastproject.security.api.UnauthorizedException
      Updates access control rules for specified series. Not specifying series ID or trying to update series with null value will throw IllegalArgumentException.
      Parameters:
      seriesID - series to be updated
      accessControl - AccessControlList defining access control rules
      Returns:
      true if ACL was updated and false it if was created
      Throws:
      org.opencastproject.util.NotFoundException - if series with given ID cannot be found
      org.opencastproject.security.api.UnauthorizedException - if the current user is not authorized to perform this action
      SeriesException - if exception occurred
    • updateAccessControl

      boolean updateAccessControl(String seriesID, org.opencastproject.security.api.AccessControlList accessControl, boolean overrideEpisodeAcl) throws org.opencastproject.util.NotFoundException, SeriesException, org.opencastproject.security.api.UnauthorizedException
      Updates access control rules for specified series. Allows to set the override parameter that controls whether the episode ACLs of the contained media packages will be removed on update. Not specifying series ID or trying to update series with null value will throw IllegalArgumentException.
      Parameters:
      seriesID - series to be updated
      accessControl - AccessControlList defining access control rules
      overrideEpisodeAcl - Whether the new series acl should override the episode acl
      Returns:
      true if ACL was updated and false it if was created
      Throws:
      org.opencastproject.util.NotFoundException - if series with given ID cannot be found
      org.opencastproject.security.api.UnauthorizedException - if the current user is not authorized to perform this action
      SeriesException - if exception occurred
    • deleteSeries

      void deleteSeries(String seriesID) throws SeriesException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException
      Removes series
      Parameters:
      seriesID - ID of the series to be removed
      Throws:
      SeriesException - if deleting fails
      org.opencastproject.util.NotFoundException - if series with specified ID does not exist
      org.opencastproject.security.api.UnauthorizedException - if the current user is not authorized to perform this action
    • getSeries

      org.opencastproject.metadata.dublincore.DublinCoreCatalog getSeries(String seriesID) throws SeriesException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException
      Returns Dublin core representing series by series ID.
      Parameters:
      seriesID - series to be retrieved
      Returns:
      DublinCoreCatalog representing series
      Throws:
      SeriesException - if retrieving fails
      org.opencastproject.security.api.UnauthorizedException - if the current user is not authorized to perform this action
      org.opencastproject.util.NotFoundException
    • getSeriesAccessControl

      org.opencastproject.security.api.AccessControlList getSeriesAccessControl(String seriesID) throws org.opencastproject.util.NotFoundException, SeriesException
      Returns access control rules for series with given ID.
      Parameters:
      seriesID - ID of the series for which access control rules will be retrieved
      Returns:
      AccessControlList defining access control rules
      Throws:
      org.opencastproject.util.NotFoundException - if series with given ID cannot be found
      SeriesException - if exception occurred
    • getAllForAdministrativeRead

      List<Series> getAllForAdministrativeRead(Date from, Optional<Date> to, int limit) throws SeriesException, org.opencastproject.security.api.UnauthorizedException
      Returns all series (including deleted ones!) that have been modified in the given date range from (inclusive) -- to (exclusive). At most limit many series are returned. ACLs/permissions are NOT checked as this is only intended to be used in an administrative context.
      Throws:
      SeriesException
      org.opencastproject.security.api.UnauthorizedException
    • updateExtendedMetadata

      boolean updateExtendedMetadata(String seriesId, String type, org.opencastproject.metadata.dublincore.DublinCoreCatalog dc) throws SeriesException
      Updates the extended metadata of a series from a Dublin Core catalog.
      Parameters:
      seriesId - the series identifier
      type - the type of dublin core catalog
      dc - the dublin core catalog with extended metadata
      Returns:
      true if the extended metadata could be updated
      Throws:
      SeriesException - if an error occurred during updating of the extended metadata
    • getSeriesElements

      com.entwinemedia.fn.data.Opt<Map<String,byte[]>> getSeriesElements(String seriesId) throws SeriesException
      Returns all the elements of a series in a map. The key of the map marks the element type. If the series does not contain any elements, an empty map is returned. If the series does not exist, Opt.none() is returned.
      Parameters:
      seriesId - the series identifier
      Returns:
      the map of elements
      Throws:
      SeriesException - if an error occurred during loading the series elements
    • getSeriesElementData

      com.entwinemedia.fn.data.Opt<byte[]> getSeriesElementData(String seriesId, String type) throws SeriesException
      Returns the element data of the series with the given type. If the series or the element with the given type do not exist, Opt.none() is returned.
      Parameters:
      seriesId - the series identifier
      type - the element type
      Returns:
      the series element data
      Throws:
      SeriesException - if an error occurred during loading the series element
    • updateSeriesElement

      boolean updateSeriesElement(String seriesId, String type, byte[] data) throws SeriesException
      Creates or updates an element of a series.
      Parameters:
      seriesId - the series identifier
      type - the type of the element
      data - the data of the element
      Returns:
      true if the element could be created or updated
      Throws:
      SeriesException - if an error occurs while updating the element
    • deleteSeriesElement

      boolean deleteSeriesElement(String seriesId, String type) throws SeriesException
      Deletes an element from a series.
      Parameters:
      seriesId - the series identifier
      type - the element type
      Returns:
      true if the element could be deleted; false if no such element/series exists
      Throws:
      SeriesException - if an error occurs while deleting the element
    • getSeriesCount

      int getSeriesCount() throws SeriesException
      Throws:
      SeriesException
    • getSeriesProperties

      Map<String,String> getSeriesProperties(String seriesID) throws SeriesException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException
      Returns the properties for a series.
      Parameters:
      seriesID - series to be retrieved
      Returns:
      representing series properties
      Throws:
      SeriesException - if retrieving fails
      org.opencastproject.util.NotFoundException - Thrown if the series or property cannot be found.
      org.opencastproject.security.api.UnauthorizedException - if the current user is not authorized to perform this action
    • getSeriesProperty

      String getSeriesProperty(String seriesID, String propertyName) throws SeriesException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException
      Get a series property.
      Parameters:
      seriesID - The id of the series to get the property from.
      propertyName - The name of the property to retrieve
      Returns:
      The string value of the property.
      Throws:
      SeriesException - Thrown for all other exceptions.
      org.opencastproject.util.NotFoundException - Thrown if the series or property cannot be found.
      org.opencastproject.security.api.UnauthorizedException - Thrown if the user is not able to read the series' properties.
    • updateSeriesProperty

      void updateSeriesProperty(String seriesID, String propertyName, String propertyValue) throws SeriesException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException
      Update a series property or create a new one if it doesn't exist.
      Parameters:
      seriesID - The series to attach the property to.
      propertyName - The unique name of the series property
      propertyValue - The value to assign the series property
      Throws:
      SeriesException - Thrown for all other exceptions.
      org.opencastproject.util.NotFoundException - Thrown if the series or property cannot be found.
      org.opencastproject.security.api.UnauthorizedException - Thrown if the user is not able to write the series' properties.
    • deleteSeriesProperty

      void deleteSeriesProperty(String seriesID, String propertyName) throws SeriesException, org.opencastproject.util.NotFoundException, org.opencastproject.security.api.UnauthorizedException
      Parameters:
      seriesID - The series to attach the property to.
      propertyName - The unique name of the series property
      Throws:
      SeriesException - Thrown for all other exceptions.
      org.opencastproject.util.NotFoundException - Thrown if the series or property cannot be found.
      org.opencastproject.security.api.UnauthorizedException - Thrown if the user is not able to write the series' properties.