Interface OaiPmhPublicationService


public interface OaiPmhPublicationService
Publishes elements from MediaPackages to OAI-PMH.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Identifier for service registration and location
    static final String
    The Opencast publication channel id is created from the OAI-PMH channel name prefixed by the PUBLICATION_CHANNEL_PREFIX.
    static final String
    Separator used to separate strings when serializing arrays of strings.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.opencastproject.job.api.Job
    publish(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> downloadElementIds, Set<String> streamingElementIds, boolean checkAvailability)
    Publishes some media package elements.
    org.opencastproject.job.api.Job
    replace(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<? extends org.opencastproject.mediapackage.MediaPackageElement> downloadElements, Set<? extends org.opencastproject.mediapackage.MediaPackageElement> streamingElements, Set<org.opencastproject.mediapackage.MediaPackageElementFlavor> retractDownloadFlavors, Set<org.opencastproject.mediapackage.MediaPackageElementFlavor> retractStreamingFlavors, Set<? extends org.opencastproject.mediapackage.Publication> publications, boolean checkAvailability)
    Updates the given media package in the Oai-Pmh storage incrementally, i.e. without retracting the whole media package.
    org.opencastproject.mediapackage.Publication
    replaceSync(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<? extends org.opencastproject.mediapackage.MediaPackageElement> downloadElements, Set<? extends org.opencastproject.mediapackage.MediaPackageElement> streamingElements, Set<org.opencastproject.mediapackage.MediaPackageElementFlavor> retractDownloadFlavors, Set<org.opencastproject.mediapackage.MediaPackageElementFlavor> retractStreamingFlavors, Set<? extends org.opencastproject.mediapackage.Publication> publications, boolean checkAvailability)
    Synchronously updates the given media package in the Oai-Pmh storage incrementally, i.e. without retracting the whole media package.
    org.opencastproject.job.api.Job
    retract(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository)
    Retract a media package from the publication channel.
    org.opencastproject.job.api.Job
    updateMetadata(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> flavors, Set<String> tags, boolean checkAvailability)
    Update all media package elements that match the flavors and tags.
  • Field Details

  • Method Details

    • publish

      org.opencastproject.job.api.Job publish(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> downloadElementIds, Set<String> streamingElementIds, boolean checkAvailability) throws PublicationException, org.opencastproject.mediapackage.MediaPackageException
      Publishes some media package elements.
      Parameters:
      mediaPackage - the media package
      repository - the OAI-PMH repository
      downloadElementIds - the download element ids to publish
      streamingElementIds - the streaming element ids to publish
      checkAvailability - whether to check the distributed download artifacts are available at its URL
      Returns:
      The job
      Throws:
      PublicationException - if there was a problem publishing the media
      org.opencastproject.mediapackage.MediaPackageException - if there was a problem with the mediapackage element
    • replace

      org.opencastproject.job.api.Job replace(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<? extends org.opencastproject.mediapackage.MediaPackageElement> downloadElements, Set<? extends org.opencastproject.mediapackage.MediaPackageElement> streamingElements, Set<org.opencastproject.mediapackage.MediaPackageElementFlavor> retractDownloadFlavors, Set<org.opencastproject.mediapackage.MediaPackageElementFlavor> retractStreamingFlavors, Set<? extends org.opencastproject.mediapackage.Publication> publications, boolean checkAvailability) throws PublicationException
      Updates the given media package in the Oai-Pmh storage incrementally, i.e. without retracting the whole media package.
      Parameters:
      mediaPackage - The media package to publish the element for
      repository - The OAI-PMH repository
      downloadElements - the download elements to publish
      streamingElements - the streaming elements to publish
      retractDownloadFlavors - 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 update
      checkAvailability - 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

      org.opencastproject.mediapackage.Publication replaceSync(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<? extends org.opencastproject.mediapackage.MediaPackageElement> downloadElements, Set<? extends org.opencastproject.mediapackage.MediaPackageElement> streamingElements, Set<org.opencastproject.mediapackage.MediaPackageElementFlavor> retractDownloadFlavors, Set<org.opencastproject.mediapackage.MediaPackageElementFlavor> retractStreamingFlavors, Set<? extends org.opencastproject.mediapackage.Publication> publications, boolean checkAvailability) throws PublicationException, org.opencastproject.mediapackage.MediaPackageException
      Synchronously updates the given media package in the Oai-Pmh storage incrementally, i.e. without retracting the whole media package.
      Parameters:
      mediaPackage - The media package to publish the element for
      repository - The OAI-PMH repository
      downloadElements - the download elements to publish
      streamingElements - the streaming elements to publish
      retractDownloadFlavors - 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 update
      checkAvailability - 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.
      org.opencastproject.mediapackage.MediaPackageException - if distribution failed.
    • retract

      org.opencastproject.job.api.Job retract(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository) throws PublicationException, org.opencastproject.util.NotFoundException
      Retract a media package from the publication channel.
      Parameters:
      mediaPackage - the media package
      repository - the OAI-PMH repository
      Throws:
      org.opencastproject.util.NotFoundException - if there was no mediapackage to retract from this channel
      PublicationException - if there was a problem retracting the mediapackage
    • updateMetadata

      org.opencastproject.job.api.Job updateMetadata(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> flavors, Set<String> tags, boolean checkAvailability) throws PublicationException, org.opencastproject.mediapackage.MediaPackageException
      Update all media package elements that match the flavors and tags. Also update the media package in the given OAI-PMH repository.
      Parameters:
      mediaPackage - media package with updated elements
      repository - OAI-PMH repository where to update the media package
      flavors - updated media package element flavors
      tags - updated media package element tags
      checkAvailability - 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
      org.opencastproject.mediapackage.MediaPackageException - if there was a problem with the media package element