Package org.opencastproject.series.impl
Interface SeriesServiceDatabase
- All Known Implementing Classes:
SeriesServiceDatabaseImpl
public interface SeriesServiceDatabase
API that defines persistent storage of series.
-
Method Summary
Modifier and TypeMethodDescriptionintvoiddeleteSeries(String seriesId) Removes series from persistent storage.booleandeleteSeriesElement(String seriesId, String type) Deletes an element of a given type from a seriesvoiddeleteSeriesProperty(String seriesId, String propertyName) Removes the series property from persistent storage.booleanexistsSeriesElement(String seriesId, String type) Returns true if the series with the given identifier contains an element with the given type.org.opencastproject.security.api.AccessControlListgetAccessControlList(String seriesID) Retrieves ACL for series with given ID.List<org.opencastproject.series.api.Series> getAllForAdministrativeRead(Date from, Optional<Date> to, int limit) Returns all series (including deleted ones!)Returns all series in persistent storage.org.opencastproject.metadata.dublincore.DublinCoreCatalogGets a single series by its identifier.Optional<byte[]> getSeriesElement(String seriesId, String type) Returns the data of a series element.getSeriesElements(String seriesId) Returns all elements of a series or an empty map if the series does not contain any elements.getSeriesProperties(String seriesId) Get the properties for particular seriesgetSeriesProperty(String seriesId, String propertyName) Get a series property if it existsorg.opencastproject.metadata.dublincore.DublinCoreCatalogstoreSeries(org.opencastproject.metadata.dublincore.DublinCoreCatalog dc) Store (or update) series.booleanstoreSeriesAccessControl(String seriesID, org.opencastproject.security.api.AccessControlList accessControl) Store access control associated with specified series.booleanstoreSeriesElement(String seriesId, String type, byte[] data) Adds or updates a series element in the series service database.voidupdateSeriesProperty(String seriesId, String propertyName, String propertyValue) Updates a series' property.
-
Method Details
-
storeSeries
org.opencastproject.metadata.dublincore.DublinCoreCatalog storeSeries(org.opencastproject.metadata.dublincore.DublinCoreCatalog dc) throws SeriesServiceDatabaseException, org.opencastproject.security.api.UnauthorizedException Store (or update) series.- Parameters:
dc-DublinCoreCatalogrepresenting series- Returns:
- Dublin Core catalog representing newly created series or null if series Dublin Core was updated
- Throws:
SeriesServiceDatabaseException- if exception occursorg.opencastproject.security.api.UnauthorizedException- if the current user is not authorized to perform this action
-
storeSeriesAccessControl
boolean storeSeriesAccessControl(String seriesID, org.opencastproject.security.api.AccessControlList accessControl) throws org.opencastproject.util.NotFoundException, SeriesServiceDatabaseException Store access control associated with specified series. IllegalArgumentException is thrown if accessControl parameter is null.- Parameters:
seriesID- ID of series to associate access control withaccessControl-AccessControlListrepresenting access control rules for specified series- Returns:
- true if update happened, false if there was no previous entry
- Throws:
org.opencastproject.util.NotFoundException- if series with specified ID does not existSeriesServiceDatabaseException- if exception occurred
-
deleteSeries
void deleteSeries(String seriesId) throws SeriesServiceDatabaseException, org.opencastproject.util.NotFoundException Removes series from persistent storage.- Parameters:
seriesId- ID of the series to be removed- Throws:
SeriesServiceDatabaseException- if exception occursorg.opencastproject.util.NotFoundException- if series with specified ID is not found
-
deleteSeriesProperty
void deleteSeriesProperty(String seriesId, String propertyName) throws SeriesServiceDatabaseException, org.opencastproject.util.NotFoundException Removes the series property from persistent storage.- Parameters:
seriesId- ID of the series to be removed.propertyName- The unique name of the property to delete.- Throws:
SeriesServiceDatabaseException- if exception occursorg.opencastproject.util.NotFoundException- if series with specified ID is not found or if there is no property with the property name
-
getAllSeries
Returns all series in persistent storage.- Returns:
Tuplearray representing stored series- Throws:
SeriesServiceDatabaseException- if exception occurs
-
getAllForAdministrativeRead
List<org.opencastproject.series.api.Series> getAllForAdministrativeRead(Date from, Optional<Date> to, int limit) throws SeriesServiceDatabaseException, 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:
SeriesServiceDatabaseExceptionorg.opencastproject.security.api.UnauthorizedException
-
getAccessControlList
org.opencastproject.security.api.AccessControlList getAccessControlList(String seriesID) throws org.opencastproject.util.NotFoundException, SeriesServiceDatabaseException Retrieves ACL for series with given ID.- Parameters:
seriesID- series for which ACL will be retrieved- Returns:
AccessControlListof series or null if series does not have ACL associated with it- Throws:
org.opencastproject.util.NotFoundException- if series with given ID does not existSeriesServiceDatabaseException- if exception occurred
-
getSeries
org.opencastproject.metadata.dublincore.DublinCoreCatalog getSeries(String seriesId) throws org.opencastproject.util.NotFoundException, SeriesServiceDatabaseException Gets a single series by its identifier.- Parameters:
seriesId- the series identifier- Returns:
- the dublin core catalog for this series
- Throws:
org.opencastproject.util.NotFoundException- if there is no series with this identifierSeriesServiceDatabaseException- if there is a problem communicating with the underlying data store
-
getSeriesProperties
Map<String,String> getSeriesProperties(String seriesId) throws org.opencastproject.util.NotFoundException, SeriesServiceDatabaseException Get the properties for particular series- Parameters:
seriesId- The unique series id to retrieve the properties for.- Returns:
- A
Mapof the properties names and values. - Throws:
org.opencastproject.util.NotFoundException- Thrown if the series can't be found.SeriesServiceDatabaseException- If exception occurred
-
getSeriesProperty
String getSeriesProperty(String seriesId, String propertyName) throws org.opencastproject.util.NotFoundException, SeriesServiceDatabaseException Get a series property if it exists- Parameters:
seriesId- The id used to get the series.propertyName- The unique name for the property.- Returns:
- The property value
- Throws:
org.opencastproject.util.NotFoundException- Thrown if the series or the property doesn't exist.SeriesServiceDatabaseException- Thrown for all other Exceptions.
-
countSeries
- Throws:
SeriesServiceDatabaseException
-
updateSeriesProperty
void updateSeriesProperty(String seriesId, String propertyName, String propertyValue) throws org.opencastproject.util.NotFoundException, SeriesServiceDatabaseException Updates a series' property.- Parameters:
seriesId- The id of the series to add or update the property for.propertyName- A unique name for the property.propertyValue- The value for the property.- Throws:
org.opencastproject.util.NotFoundException- Thrown if the series cannot be found.SeriesServiceDatabaseException- Thrown if another exception occurred
-
existsSeriesElement
Returns true if the series with the given identifier contains an element with the given type.- Parameters:
seriesId- the series identifiertype- the element type- Returns:
- true, if the element exits; false otherwise
- Throws:
SeriesServiceDatabaseException- if there was an error while checking if the element exits
-
storeSeriesElement
boolean storeSeriesElement(String seriesId, String type, byte[] data) throws SeriesServiceDatabaseException Adds or updates a series element in the series service database.- Parameters:
seriesId- the series identifiertype- the element typedata- the element data- Returns:
- true if the element could be added/updated; false if no such series exists
- Throws:
SeriesServiceDatabaseException- if an error occurs while saving the element in the database
-
deleteSeriesElement
Deletes an element of a given type from a series- Parameters:
seriesId- the series identifiertype- the element type- Returns:
- true if the element could be deleted; false if no such series/element exists
- Throws:
SeriesServiceDatabaseException- if an error occurs while removing the element from the database
-
getSeriesElement
Optional<byte[]> getSeriesElement(String seriesId, String type) throws SeriesServiceDatabaseException Returns the data of a series element.- Parameters:
seriesId- the series identifiertype- the element type- Returns:
- the element data or
Opt.none()if no such series/element exists - Throws:
SeriesServiceDatabaseException- if an error occurs while retrieving the element from the database
-
getSeriesElements
Optional<Map<String,byte[]>> getSeriesElements(String seriesId) throws SeriesServiceDatabaseException Returns all elements of a series or an empty map if the series does not contain any elements. The key of the map marks the element type.- Parameters:
seriesId- the series identifier- Returns:
- a map of series elements or
Opt.none()if no such series exists - Throws:
SeriesServiceDatabaseException- if an error occurs while retrieving the element from the database
-