Class OaiPmhPublicationServiceRemoteImpl
java.lang.Object
org.opencastproject.serviceregistry.api.RemoteBase
org.opencastproject.publication.oaipmh.remote.OaiPmhPublicationServiceRemoteImpl
- All Implemented Interfaces:
OaiPmhPublicationService
public class OaiPmhPublicationServiceRemoteImpl
extends RemoteBase
implements OaiPmhPublicationService
A remote publication service invoker.
-
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.publication.api.OaiPmhPublicationService
JOB_TYPE, PUBLICATION_CHANNEL_PREFIX, SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionpublish(MediaPackage mediaPackage, String repository, Set<String> downloadIds, Set<String> streamingIds, boolean checkAvailability) Publishes some media package elements.replace(MediaPackage mediaPackage, String repository, Set<? extends MediaPackageElement> downloadElements, Set<? extends MediaPackageElement> streamingElements, Set<MediaPackageElementFlavor> retractDownloadFlavors, Set<MediaPackageElementFlavor> retractStreamingFlavors, Set<? extends Publication> publications, boolean checkAvailability) Updates the given media package in the Oai-Pmh storage incrementally, i.e. without retracting the whole media package.replaceSync(MediaPackage mediaPackage, String repository, Set<? extends MediaPackageElement> downloadElements, Set<? extends MediaPackageElement> streamingElements, Set<MediaPackageElementFlavor> retractDownloadFlavors, Set<MediaPackageElementFlavor> retractStreamingFlavors, Set<? extends Publication> publications, boolean checkAvailability) Synchronously updates the given media package in the Oai-Pmh storage incrementally, i.e. without retracting the whole media package.retract(MediaPackage mediaPackage, String repository) Retract a media package from the publication channel.voidsetRemoteServiceManager(ServiceRegistry serviceRegistry) Sets the remote service manager.voidsetTrustedHttpClient(TrustedHttpClient trustedHttpClient) Sets the trusted http clientupdateMetadata(MediaPackage mediaPackage, String repository, Set<String> flavors, Set<String> tags, boolean checkAvailability) Update all media package elements that match the flavors and tags.Methods inherited from class org.opencastproject.serviceregistry.api.RemoteBase
closeConnection, getResponse, getResponse, runRequest
-
Constructor Details
-
OaiPmhPublicationServiceRemoteImpl
public OaiPmhPublicationServiceRemoteImpl()
-
-
Method Details
-
publish
public Job publish(MediaPackage mediaPackage, String repository, Set<String> downloadIds, Set<String> streamingIds, boolean checkAvailability) throws PublicationException, MediaPackageException Description copied from interface:OaiPmhPublicationServicePublishes some media package elements.- Specified by:
publishin interfaceOaiPmhPublicationService- Parameters:
mediaPackage- the media packagerepository- the OAI-PMH repositorydownloadIds- the download element ids to publishstreamingIds- the streaming element ids to publishcheckAvailability- whether to check the distributed download artifacts are available at its URL- Returns:
- The job
- Throws:
PublicationException- if there was a problem publishing the mediaMediaPackageException- if there was a problem with the mediapackage element
-
replace
public Job replace(MediaPackage mediaPackage, String repository, Set<? extends MediaPackageElement> downloadElements, Set<? extends MediaPackageElement> streamingElements, Set<MediaPackageElementFlavor> retractDownloadFlavors, Set<MediaPackageElementFlavor> retractStreamingFlavors, Set<? extends Publication> publications, boolean checkAvailability) throws PublicationException Description copied from interface:OaiPmhPublicationServiceUpdates the given media package in the Oai-Pmh storage incrementally, i.e. without retracting the whole media package.- Specified by:
replacein interfaceOaiPmhPublicationService- Parameters:
mediaPackage- The media package to publish the element forrepository- The OAI-PMH repositorydownloadElements- the download elements to publishstreamingElements- the streaming elements to publishretractDownloadFlavors- flavors to use to search for download elements to retract.retractStreamingFlavors- flavors to use to search for streaming elements to retract.publications- the publications to updatecheckAvailability- whether to check the distributed download artifacts are available at their URLs- Returns:
- The job which performs the operation (The job payload will hold the publication with the updated media package).
- Throws:
PublicationException- if the job could not be created.
-
replaceSync
public Publication replaceSync(MediaPackage mediaPackage, String repository, Set<? extends MediaPackageElement> downloadElements, Set<? extends MediaPackageElement> streamingElements, Set<MediaPackageElementFlavor> retractDownloadFlavors, Set<MediaPackageElementFlavor> retractStreamingFlavors, Set<? extends Publication> publications, boolean checkAvailability) throws PublicationException Description copied from interface:OaiPmhPublicationServiceSynchronously updates the given media package in the Oai-Pmh storage incrementally, i.e. without retracting the whole media package.- Specified by:
replaceSyncin interfaceOaiPmhPublicationService- Parameters:
mediaPackage- The media package to publish the element forrepository- The OAI-PMH repositorydownloadElements- the download elements to publishstreamingElements- the streaming elements to publishretractDownloadFlavors- flavors to use to search for download elements to retract.retractStreamingFlavors- flavors to use to search for streaming elements to retract.publications- the publications to updatecheckAvailability- whether to check the distributed download artifacts are available at their URLs- Returns:
- The publication with the updated media package.
- Throws:
PublicationException- if the job could not be created.
-
retract
Description copied from interface:OaiPmhPublicationServiceRetract a media package from the publication channel.- Specified by:
retractin interfaceOaiPmhPublicationService- Parameters:
mediaPackage- the media packagerepository- the OAI-PMH repository- Throws:
PublicationException- if there was a problem retracting the mediapackage
-
updateMetadata
public Job updateMetadata(MediaPackage mediaPackage, String repository, Set<String> flavors, Set<String> tags, boolean checkAvailability) throws PublicationException Description copied from interface:OaiPmhPublicationServiceUpdate all media package elements that match the flavors and tags. Also update the media package in the given OAI-PMH repository.- Specified by:
updateMetadatain interfaceOaiPmhPublicationService- Parameters:
mediaPackage- media package with updated elementsrepository- OAI-PMH repository where to update the media packageflavors- updated media package element flavorstags- updated media package element tagscheckAvailability- whether to check the distributed download artifacts are available at its URL- Returns:
- The job to update the media package
- Throws:
PublicationException- if there was a problem publishing the media
-
setTrustedHttpClient
Description copied from class:RemoteBaseSets the trusted http client- Overrides:
setTrustedHttpClientin classRemoteBase- Parameters:
trustedHttpClient-
-
setRemoteServiceManager
Description copied from class:RemoteBaseSets the remote service manager.- Overrides:
setRemoteServiceManagerin classRemoteBase- Parameters:
serviceRegistry-
-