Class OaiPmhPublicationServiceImpl

java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.publication.oaipmh.OaiPmhPublicationServiceImpl
All Implemented Interfaces:
org.opencastproject.job.api.JobProducer, org.opencastproject.publication.api.OaiPmhPublicationService

public class OaiPmhPublicationServiceImpl extends org.opencastproject.job.api.AbstractJobProducer implements org.opencastproject.publication.api.OaiPmhPublicationService
Publishes a recording to an OAI-PMH publication repository.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields inherited from class org.opencastproject.job.api.AbstractJobProducer

    ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobType

    Fields inherited from interface org.opencastproject.publication.api.OaiPmhPublicationService

    JOB_TYPE, PUBLICATION_CHANNEL_PREFIX, SEPARATOR
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    checkInputArguments(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository)
     
    protected org.opencastproject.mediapackage.Publication
    Create a new publication element.
    protected org.opencastproject.security.api.OrganizationDirectoryService
    protected String
     
    protected org.opencastproject.security.api.SecurityService
    protected org.opencastproject.serviceregistry.api.ServiceRegistry
     
    protected org.opencastproject.security.api.UserDirectoryService
    static org.opencastproject.mediapackage.MediaPackage
    merge(org.opencastproject.mediapackage.MediaPackage updatedMp, org.opencastproject.mediapackage.MediaPackage publishedMp)
    Merges the updated media package with the one that is currently published in a way where the updated elements replace existing ones in the published media package based on their flavor.
    protected String
    process(org.opencastproject.job.api.Job job)
     
    protected org.opencastproject.mediapackage.Publication
    publish(org.opencastproject.job.api.Job job, org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> downloadElementIds, Set<String> streamingElementIds, boolean checkAvailability)
     
    org.opencastproject.job.api.Job
    publish(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> downloadElementIds, Set<String> streamingElementIds, boolean checkAvailability)
     
    static org.opencastproject.mediapackage.MediaPackage
    removeMatchingNonExistantElements(org.opencastproject.mediapackage.MediaPackage updatedMp, org.opencastproject.mediapackage.MediaPackage publishedMp, Set<org.opencastproject.mediapackage.MediaPackageElementFlavor> flavors, Set<String> tags)
    Remove all these elements from publishedMp, that matches the given flavors and tags but are not in the updatedMp.
    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)
     
    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)
     
    protected org.opencastproject.mediapackage.Publication
    retract(org.opencastproject.job.api.Job job, org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository)
     
    org.opencastproject.job.api.Job
    retract(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository)
     
    void
    setDownloadDistributionService(org.opencastproject.distribution.api.DownloadDistributionService downloadDistributionService)
    OSGI DI
    void
    setOaiPmhDatabase(org.opencastproject.oaipmh.persistence.OaiPmhDatabase oaiPmhDatabase)
    OSGI DI
    void
    setOaiPmhServerInfo(org.opencastproject.oaipmh.server.OaiPmhServerInfo oaiPmhServerInfo)
    OSGI DI
    void
    setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService)
    OSGI DI
    void
    setSecurityService(org.opencastproject.security.api.SecurityService securityService)
    OSGI DI
    void
    setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
    OSGI DI
    void
    setStreamingDistributionService(org.opencastproject.distribution.api.StreamingDistributionService streamingDistributionService)
    OSGI DI
    void
    setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
    OSGI DI
    protected org.opencastproject.mediapackage.Publication
    updateMetadata(org.opencastproject.job.api.Job job, org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> flavors, Set<String> tags, boolean checkAvailability)
     
    org.opencastproject.job.api.Job
    updateMetadata(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> flavors, Set<String> tags, boolean checkAvailability)
     

    Methods inherited from class org.opencastproject.job.api.AbstractJobProducer

    acceptJob, activate, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OaiPmhPublicationServiceImpl

      public OaiPmhPublicationServiceImpl()
  • Method Details

    • process

      protected String process(org.opencastproject.job.api.Job job) throws Exception
      Specified by:
      process in class org.opencastproject.job.api.AbstractJobProducer
      Throws:
      Exception
    • replace

      public 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 org.opencastproject.publication.api.PublicationException
      Specified by:
      replace in interface org.opencastproject.publication.api.OaiPmhPublicationService
      Throws:
      org.opencastproject.publication.api.PublicationException
    • replaceSync

      public 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 org.opencastproject.publication.api.PublicationException, org.opencastproject.mediapackage.MediaPackageException
      Specified by:
      replaceSync in interface org.opencastproject.publication.api.OaiPmhPublicationService
      Throws:
      org.opencastproject.publication.api.PublicationException
      org.opencastproject.mediapackage.MediaPackageException
    • publish

      public org.opencastproject.job.api.Job publish(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> downloadElementIds, Set<String> streamingElementIds, boolean checkAvailability) throws org.opencastproject.publication.api.PublicationException, org.opencastproject.mediapackage.MediaPackageException
      Specified by:
      publish in interface org.opencastproject.publication.api.OaiPmhPublicationService
      Throws:
      org.opencastproject.publication.api.PublicationException
      org.opencastproject.mediapackage.MediaPackageException
    • retract

      public org.opencastproject.job.api.Job retract(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository) throws org.opencastproject.publication.api.PublicationException, org.opencastproject.util.NotFoundException
      Specified by:
      retract in interface org.opencastproject.publication.api.OaiPmhPublicationService
      Throws:
      org.opencastproject.publication.api.PublicationException
      org.opencastproject.util.NotFoundException
    • updateMetadata

      public org.opencastproject.job.api.Job updateMetadata(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> flavors, Set<String> tags, boolean checkAvailability) throws org.opencastproject.publication.api.PublicationException, org.opencastproject.mediapackage.MediaPackageException
      Specified by:
      updateMetadata in interface org.opencastproject.publication.api.OaiPmhPublicationService
      Throws:
      org.opencastproject.publication.api.PublicationException
      org.opencastproject.mediapackage.MediaPackageException
    • publish

      protected org.opencastproject.mediapackage.Publication publish(org.opencastproject.job.api.Job job, org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> downloadElementIds, Set<String> streamingElementIds, boolean checkAvailability) throws org.opencastproject.publication.api.PublicationException, org.opencastproject.mediapackage.MediaPackageException
      Throws:
      org.opencastproject.publication.api.PublicationException
      org.opencastproject.mediapackage.MediaPackageException
    • retract

      protected org.opencastproject.mediapackage.Publication retract(org.opencastproject.job.api.Job job, org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository) throws org.opencastproject.publication.api.PublicationException, org.opencastproject.util.NotFoundException
      Throws:
      org.opencastproject.publication.api.PublicationException
      org.opencastproject.util.NotFoundException
    • updateMetadata

      protected org.opencastproject.mediapackage.Publication updateMetadata(org.opencastproject.job.api.Job job, org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository, Set<String> flavors, Set<String> tags, boolean checkAvailability) throws org.opencastproject.publication.api.PublicationException
      Throws:
      org.opencastproject.publication.api.PublicationException
    • checkInputArguments

      protected void checkInputArguments(org.opencastproject.mediapackage.MediaPackage mediaPackage, String repository)
    • getPublicationChannelName

      protected String getPublicationChannelName(String repository)
    • createPublicationElement

      protected org.opencastproject.mediapackage.Publication createPublicationElement(String mpId, String repository) throws org.opencastproject.publication.api.PublicationException
      Create a new publication element.
      Throws:
      org.opencastproject.publication.api.PublicationException
    • removeMatchingNonExistantElements

      public static org.opencastproject.mediapackage.MediaPackage removeMatchingNonExistantElements(org.opencastproject.mediapackage.MediaPackage updatedMp, org.opencastproject.mediapackage.MediaPackage publishedMp, Set<org.opencastproject.mediapackage.MediaPackageElementFlavor> flavors, Set<String> tags)
      Remove all these elements from publishedMp, that matches the given flavors and tags but are not in the updatedMp.
      Parameters:
      updatedMp - the updated media package
      publishedMp - the media package that is currently published
      flavors - flavors of elements to update
      tags - tags of elements to update
      Returns:
      published media package without elements, that matches the flavors and tags but are not in the updated media package
    • merge

      public static org.opencastproject.mediapackage.MediaPackage merge(org.opencastproject.mediapackage.MediaPackage updatedMp, org.opencastproject.mediapackage.MediaPackage publishedMp)
      Merges the updated media package with the one that is currently published in a way where the updated elements replace existing ones in the published media package based on their flavor.

      If publishedMp is null, this method returns the updated media package without any modifications.

      Parameters:
      updatedMp - the updated media package
      publishedMp - the media package that is currently published
      Returns:
      the merged media package
    • getServiceRegistry

      protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()
      Specified by:
      getServiceRegistry in class org.opencastproject.job.api.AbstractJobProducer
    • getSecurityService

      protected org.opencastproject.security.api.SecurityService getSecurityService()
      Specified by:
      getSecurityService in class org.opencastproject.job.api.AbstractJobProducer
      See Also:
      • AbstractJobProducer.getSecurityService()
    • getUserDirectoryService

      protected org.opencastproject.security.api.UserDirectoryService getUserDirectoryService()
      Specified by:
      getUserDirectoryService in class org.opencastproject.job.api.AbstractJobProducer
      See Also:
      • AbstractJobProducer.getUserDirectoryService()
    • getOrganizationDirectoryService

      protected org.opencastproject.security.api.OrganizationDirectoryService getOrganizationDirectoryService()
      Specified by:
      getOrganizationDirectoryService in class org.opencastproject.job.api.AbstractJobProducer
      See Also:
      • AbstractJobProducer.getOrganizationDirectoryService()
    • setServiceRegistry

      public void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
      OSGI DI
    • setSecurityService

      public void setSecurityService(org.opencastproject.security.api.SecurityService securityService)
      OSGI DI
    • setUserDirectoryService

      public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
      OSGI DI
    • setOrganizationDirectoryService

      public void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService)
      OSGI DI
    • setDownloadDistributionService

      public void setDownloadDistributionService(org.opencastproject.distribution.api.DownloadDistributionService downloadDistributionService)
      OSGI DI
    • setStreamingDistributionService

      public void setStreamingDistributionService(org.opencastproject.distribution.api.StreamingDistributionService streamingDistributionService)
      OSGI DI
    • setOaiPmhServerInfo

      public void setOaiPmhServerInfo(org.opencastproject.oaipmh.server.OaiPmhServerInfo oaiPmhServerInfo)
      OSGI DI
    • setOaiPmhDatabase

      public void setOaiPmhDatabase(org.opencastproject.oaipmh.persistence.OaiPmhDatabase oaiPmhDatabase)
      OSGI DI