Package org.opencastproject.series.api
Interface SeriesService
public interface SeriesService
Series service API for creating, removing and searching over series.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteSeries(String seriesID) Removes seriesbooleandeleteSeriesElement(String seriesId, String type) Deletes an element from a series.voiddeleteSeriesProperty(String seriesID, String propertyName) getAllForAdministrativeRead(Date from, Optional<Date> to, int limit) Returns all series (including deleted ones!)org.opencastproject.metadata.dublincore.DublinCoreCatalogReturns Dublin core representing series by series ID.org.opencastproject.security.api.AccessControlListgetSeriesAccessControl(String seriesID) Returns access control rules for series with given ID.intOptional<byte[]> getSeriesElementData(String seriesId, String type) Returns the element data of the series with the given type.getSeriesElements(String seriesId) Returns all the elements of a series in a map.getSeriesProperties(String seriesID) Returns the properties for a series.getSeriesProperty(String seriesID, String propertyName) Get a series property.booleanupdateAccessControl(String seriesID, org.opencastproject.security.api.AccessControlList accessControl) Updates access control rules for specified series.booleanupdateAccessControl(String seriesID, org.opencastproject.security.api.AccessControlList accessControl, boolean overrideEpisodeAcl) Updates access control rules for specified series.booleanupdateExtendedMetadata(String seriesId, String type, org.opencastproject.metadata.dublincore.DublinCoreCatalog dc) Updates the extended metadata of a series from a Dublin Core catalog.org.opencastproject.metadata.dublincore.DublinCoreCatalogupdateSeries(org.opencastproject.metadata.dublincore.DublinCoreCatalog dc) Adds or updates series.booleanupdateSeriesElement(String seriesId, String type, byte[] data) Creates or updates an element of a series.voidupdateSeriesProperty(String seriesID, String propertyName, String propertyValue) Update a series property or create a new one if it doesn't exist.
-
Field Details
-
JOB_TYPE
Identifier for service registration and location- See Also:
-
-
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-DublinCoreCatalogrepresenting series- Returns:
- Dublin Core catalog of newly created series or null if series Dublin Core was just updated
- Throws:
SeriesException- if adding or updating failsorg.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 updatedaccessControl-AccessControlListdefining 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 foundorg.opencastproject.security.api.UnauthorizedException- if the current user is not authorized to perform this actionSeriesException- 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 updatedaccessControl-AccessControlListdefining access control rulesoverrideEpisodeAcl- 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 foundorg.opencastproject.security.api.UnauthorizedException- if the current user is not authorized to perform this actionSeriesException- 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 failsorg.opencastproject.util.NotFoundException- if series with specified ID does not existorg.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:
DublinCoreCatalogrepresenting series- Throws:
SeriesException- if retrieving failsorg.opencastproject.security.api.UnauthorizedException- if the current user is not authorized to perform this actionorg.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:
AccessControlListdefining access control rules- Throws:
org.opencastproject.util.NotFoundException- if series with given ID cannot be foundSeriesException- 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 rangefrom(inclusive) --to(exclusive). At mostlimitmany series are returned. ACLs/permissions are NOT checked as this is only intended to be used in an administrative context.- Throws:
SeriesExceptionorg.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 identifiertype- the type of dublin core catalogdc- 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
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
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 identifiertype- the element type- Returns:
- the series element data
- Throws:
SeriesException- if an error occurred during loading the series element
-
updateSeriesElement
Creates or updates an element of a series.- Parameters:
seriesId- the series identifiertype- the type of the elementdata- 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
Deletes an element from a series.- Parameters:
seriesId- the series identifiertype- 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
- 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 failsorg.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 propertypropertyValue- 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.
-