Class PlaylistDatabaseServiceImpl
java.lang.Object
org.opencastproject.playlists.persistence.PlaylistDatabaseServiceImpl
- All Implemented Interfaces:
PlaylistDatabaseService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJPA persistence unit nameprotected org.opencastproject.security.api.SecurityServiceThe security service -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) deletePlaylist(Playlist playlist, String orgId) Removes a single playlist.getAllForAdministrativeRead(Date startDate, Date endDate, int limit) getPlaylist(String playlistId) Gets a single playlist in the current organization context by its identifier.getPlaylist(String playlistId, String orgId) Gets a single playlist by its identifier.getPlaylistById(String playlistId, String orgId) Gets a non-deleted playlist by its idgetPlaylists(int limit, int offset, org.opencastproject.util.requests.SortCriterion sortCriterion) Get several playlists based on their order in the databasegetPotentiallyDeletedPlaylist(String playlistId, String orgId) Gets a potentially deleted series by its ID, using the current organizational context.voidsetDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory) voidsetEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DIvoidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback to set the security service.updatePlaylist(Playlist playlist, String orgId) Creates or updates a single playlist.
-
Field Details
-
PERSISTENCE_UNIT
JPA persistence unit name- See Also:
-
securityService
protected org.opencastproject.security.api.SecurityService securityServiceThe security service
-
-
Constructor Details
-
PlaylistDatabaseServiceImpl
public PlaylistDatabaseServiceImpl()
-
-
Method Details
-
setEntityManagerFactory
public void setEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DI -
setDBSessionFactory
public void setDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory) -
setSecurityService
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) OSGi callback to set the security service.- Parameters:
securityService- the securityService to set
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) -
getPlaylist
public Playlist getPlaylist(String playlistId) throws org.opencastproject.util.NotFoundException, PlaylistDatabaseException Gets a single playlist in the current organization context by its identifier.- Specified by:
getPlaylistin interfacePlaylistDatabaseService- Parameters:
playlistId- the playlist identifier- Returns:
- the
Playlistwith the given identifier - Throws:
org.opencastproject.util.NotFoundException- if there is no playlist with this identifierPlaylistDatabaseException- if there is a problem communicating with the underlying data store- See Also:
-
getPlaylist
public Playlist getPlaylist(String playlistId, String orgId) throws org.opencastproject.util.NotFoundException, PlaylistDatabaseException Gets a single playlist by its identifier.- Specified by:
getPlaylistin interfacePlaylistDatabaseService- Parameters:
playlistId- the playlist identifierorgId- the organisation identifier- Returns:
- the
Playlistwith the given identifier - Throws:
org.opencastproject.util.NotFoundException- if there is no playlist with this identifierPlaylistDatabaseException- if there is a problem communicating with the underlying data store- See Also:
-
getPlaylists
public List<Playlist> getPlaylists(int limit, int offset, org.opencastproject.util.requests.SortCriterion sortCriterion) throws PlaylistDatabaseException Get several playlists based on their order in the database- Specified by:
getPlaylistsin interfacePlaylistDatabaseService- Parameters:
limit- Maximum amount of playlists to returnoffset- The index of the first result to return- Returns:
- a list of
Playlists - Throws:
PlaylistDatabaseException- if there is a problem communicating with the underlying data store- See Also:
-
getAllForAdministrativeRead
public List<Playlist> getAllForAdministrativeRead(Date startDate, Date endDate, int limit) throws PlaylistDatabaseException - Specified by:
getAllForAdministrativeReadin interfacePlaylistDatabaseService- Throws:
PlaylistDatabaseException
-
updatePlaylist
Creates or updates a single playlist.- Specified by:
updatePlaylistin interfacePlaylistDatabaseService- Parameters:
playlist- ThePlaylist- Returns:
- The updated
Playlist - Throws:
PlaylistDatabaseException- if there is a problem communicating with the underlying data store- See Also:
-
deletePlaylist
Removes a single playlist.- Specified by:
deletePlaylistin interfacePlaylistDatabaseService- Parameters:
playlist- ThePlaylist- Returns:
- The deleted
Playlist - Throws:
PlaylistDatabaseException- if there is a problem communicating with the underlying data store- See Also:
-
getPlaylistById
protected Function<javax.persistence.EntityManager,Optional<Playlist>> getPlaylistById(String playlistId, String orgId) Gets a non-deleted playlist by its id- Parameters:
playlistId- the playlist identifierorgId- the organisation identifier- Returns:
- the playlist in an optional
-
getPotentiallyDeletedPlaylist
protected Function<javax.persistence.EntityManager,Optional<Playlist>> getPotentiallyDeletedPlaylist(String playlistId, String orgId) Gets a potentially deleted series by its ID, using the current organizational context.- Parameters:
playlistId- the playlist identifierorgId- the organisation identifier- Returns:
- the playlist in an optional
-