Class SeriesServiceRemoteImpl
java.lang.Object
org.opencastproject.serviceregistry.api.RemoteBase
org.opencastproject.series.remote.SeriesServiceRemoteImpl
- All Implemented Interfaces:
SeriesService
A proxy to a remote series service.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencastproject.serviceregistry.api.RemoteBase
RemoteBase.HttpClientClosingInputStream -
Field Summary
Fields inherited from class org.opencastproject.serviceregistry.api.RemoteBase
client, elementsFromHttpResponse, remoteServiceManager, serviceTypeFields inherited from interface org.opencastproject.series.api.SeriesService
JOB_TYPE -
Constructor Summary
Constructors -
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!)Returns Dublin core representing series by series ID.getSeriesAccessControl(String seriesID) Returns access control rules for series with given ID.javax.ws.rs.core.ResponsegetSeriesAccessControlListJson(String seriesID) 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.javax.ws.rs.core.ResponsegetSeriesJSON(String seriesID) getSeriesProperties(String seriesID) Returns the properties for a series.getSeriesProperty(String seriesID, String propertyName) Get a series property.voidsetRemoteServiceManager(ServiceRegistry remoteServiceManager) Sets the remote service manager.voidSets the trusted http clientbooleanupdateAccessControl(String seriesID, AccessControlList accessControl) Updates access control rules for specified series.booleanupdateAccessControl(String seriesID, AccessControlList accessControl, boolean overrideEpisodeAcl) Updates access control rules for specified series.booleanupdateExtendedMetadata(String seriesId, String type, DublinCoreCatalog dc) Updates the extended metadata of a series from a Dublin Core catalog.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.Methods inherited from class org.opencastproject.serviceregistry.api.RemoteBase
closeConnection, getResponse, getResponse, runRequest
-
Constructor Details
-
SeriesServiceRemoteImpl
public SeriesServiceRemoteImpl()
-
-
Method Details
-
setTrustedHttpClient
Sets the trusted http client- Overrides:
setTrustedHttpClientin classRemoteBase- Parameters:
client-
-
setRemoteServiceManager
Sets the remote service manager.- Overrides:
setRemoteServiceManagerin classRemoteBase- Parameters:
remoteServiceManager-
-
updateSeries
public DublinCoreCatalog updateSeries(DublinCoreCatalog dc) throws SeriesException, UnauthorizedException Description copied from interface:SeriesServiceAdds or updates series. IllegalArgumentException is thrown if dc argument is null.- Specified by:
updateSeriesin interfaceSeriesService- 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 failsUnauthorizedException- if the current user is not authorized to perform this action
-
updateAccessControl
public boolean updateAccessControl(String seriesID, AccessControlList accessControl) throws NotFoundException, SeriesException, UnauthorizedException Description copied from interface:SeriesServiceUpdates access control rules for specified series. Not specifying series ID or trying to update series with null value will throw IllegalArgumentException.- Specified by:
updateAccessControlin interfaceSeriesService- Parameters:
seriesID- series to be updatedaccessControl-AccessControlListdefining access control rules- Returns:
- true if ACL was updated and false it if was created
- Throws:
NotFoundException- if series with given ID cannot be foundSeriesException- if exception occurredUnauthorizedException- if the current user is not authorized to perform this action
-
updateAccessControl
public boolean updateAccessControl(String seriesID, AccessControlList accessControl, boolean overrideEpisodeAcl) throws NotFoundException, SeriesException, UnauthorizedException Description copied from interface:SeriesServiceUpdates 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.- Specified by:
updateAccessControlin interfaceSeriesService- 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:
NotFoundException- if series with given ID cannot be foundSeriesException- if exception occurredUnauthorizedException- if the current user is not authorized to perform this action
-
deleteSeries
public void deleteSeries(String seriesID) throws SeriesException, NotFoundException, UnauthorizedException Description copied from interface:SeriesServiceRemoves series- Specified by:
deleteSeriesin interfaceSeriesService- Parameters:
seriesID- ID of the series to be removed- Throws:
SeriesException- if deleting failsNotFoundException- if series with specified ID does not existUnauthorizedException- if the current user is not authorized to perform this action
-
getSeriesJSON
@GET @Produces("application/json") @Path("{seriesID:.+}.json") public javax.ws.rs.core.Response getSeriesJSON(@PathParam("seriesID") String seriesID) throws UnauthorizedException - Throws:
UnauthorizedException
-
getSeriesAccessControlListJson
@GET @Produces("application/json") @Path("/{seriesID:.+}/acl.json") public javax.ws.rs.core.Response getSeriesAccessControlListJson(@PathParam("seriesID") String seriesID) -
getSeries
public DublinCoreCatalog getSeries(String seriesID) throws SeriesException, NotFoundException, UnauthorizedException Description copied from interface:SeriesServiceReturns Dublin core representing series by series ID.- Specified by:
getSeriesin interfaceSeriesService- Parameters:
seriesID- series to be retrieved- Returns:
DublinCoreCatalogrepresenting series- Throws:
SeriesException- if retrieving failsUnauthorizedException- if the current user is not authorized to perform this actionNotFoundException
-
getAllForAdministrativeRead
public List<Series> getAllForAdministrativeRead(Date from, Optional<Date> to, int limit) throws SeriesException, UnauthorizedException Description copied from interface:SeriesServiceReturns 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.- Specified by:
getAllForAdministrativeReadin interfaceSeriesService- Throws:
SeriesExceptionUnauthorizedException
-
getSeriesAccessControl
public AccessControlList getSeriesAccessControl(String seriesID) throws NotFoundException, SeriesException Description copied from interface:SeriesServiceReturns access control rules for series with given ID.- Specified by:
getSeriesAccessControlin interfaceSeriesService- Parameters:
seriesID- ID of the series for which access control rules will be retrieved- Returns:
AccessControlListdefining access control rules- Throws:
NotFoundException- if series with given ID cannot be foundSeriesException- if exception occurred
-
getSeriesCount
- Specified by:
getSeriesCountin interfaceSeriesService- Throws:
SeriesException
-
getSeriesProperties
public Map<String,String> getSeriesProperties(String seriesID) throws SeriesException, NotFoundException, UnauthorizedException Description copied from interface:SeriesServiceReturns the properties for a series.- Specified by:
getSeriesPropertiesin interfaceSeriesService- Parameters:
seriesID- series to be retrieved- Returns:
- representing series properties
- Throws:
SeriesException- if retrieving failsNotFoundException- Thrown if the series or property cannot be found.UnauthorizedException- if the current user is not authorized to perform this action
-
getSeriesProperty
public String getSeriesProperty(String seriesID, String propertyName) throws SeriesException, NotFoundException, UnauthorizedException Description copied from interface:SeriesServiceGet a series property.- Specified by:
getSeriesPropertyin interfaceSeriesService- 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.NotFoundException- Thrown if the series or property cannot be found.UnauthorizedException- Thrown if the user is not able to read the series' properties.
-
updateSeriesProperty
public void updateSeriesProperty(String seriesID, String propertyName, String propertyValue) throws SeriesException, NotFoundException, UnauthorizedException Description copied from interface:SeriesServiceUpdate a series property or create a new one if it doesn't exist.- Specified by:
updateSeriesPropertyin interfaceSeriesService- 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.NotFoundException- Thrown if the series or property cannot be found.UnauthorizedException- Thrown if the user is not able to write the series' properties.
-
deleteSeriesProperty
public void deleteSeriesProperty(String seriesID, String propertyName) throws SeriesException, NotFoundException, UnauthorizedException - Specified by:
deleteSeriesPropertyin interfaceSeriesService- Parameters:
seriesID- The series to attach the property to.propertyName- The unique name of the series property- Throws:
SeriesException- Thrown for all other exceptions.NotFoundException- Thrown if the series or property cannot be found.UnauthorizedException- Thrown if the user is not able to write the series' properties.
-
updateExtendedMetadata
public boolean updateExtendedMetadata(String seriesId, String type, DublinCoreCatalog dc) throws SeriesException Description copied from interface:SeriesServiceUpdates the extended metadata of a series from a Dublin Core catalog.- Specified by:
updateExtendedMetadatain interfaceSeriesService- 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
Description copied from interface:SeriesServiceReturns 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.- Specified by:
getSeriesElementsin interfaceSeriesService- Parameters:
seriesID- the series identifier- Returns:
- the map of elements
- Throws:
SeriesException- if an error occurred during loading the series elements
-
getSeriesElementData
Description copied from interface:SeriesServiceReturns 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.- Specified by:
getSeriesElementDatain interfaceSeriesService- 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
public boolean updateSeriesElement(String seriesID, String type, byte[] data) throws SeriesException Description copied from interface:SeriesServiceCreates or updates an element of a series.- Specified by:
updateSeriesElementin interfaceSeriesService- 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
Description copied from interface:SeriesServiceDeletes an element from a series.- Specified by:
deleteSeriesElementin interfaceSeriesService- 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
-