Class AssetManagerJobProducer

java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.assetmanager.impl.AssetManagerJobProducer
All Implemented Interfaces:
org.opencastproject.job.api.JobProducer

public class AssetManagerJobProducer extends org.opencastproject.job.api.AbstractJobProducer
  • Nested Class Summary

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

    Fields
    Modifier and Type
    Field
    Description
    static final Float
     
    static final String
     
    static final Float
     

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

    ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobType
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(org.osgi.service.component.ComponentContext cc)
    OSGi callback on component activation.
    boolean
     
    protected org.opencastproject.security.api.OrganizationDirectoryService
     
    protected org.opencastproject.security.api.SecurityService
     
    protected org.opencastproject.serviceregistry.api.ServiceRegistry
     
    protected org.opencastproject.security.api.UserDirectoryService
     
    protected String
    internalMoveByDate(Date start, Date end, String targetStorage)
    Spawns subjobs on a per-snapshot level to move the appropriate snapshots to their new home Moves all the appropriate snapshots to their new home
    protected String
    internalMoveById(String mpId, String targetStorage)
    Moves all the appropriate snapshots to their new home
    protected String
    internalMoveByIdAndDate(String mpId, Date start, Date end, String targetStorage)
    Moves all the appropriate snapshots to their new home
    protected String
    internalMoveByIdAndVersion(org.opencastproject.assetmanager.api.Version version, String mpId, String targetStorage)
    Triggers the move operation inside the AssetManager
    org.opencastproject.job.api.Job
    moveByDate(Date start, Date end, String targetStorage)
    Spawns a job to move a all snapshots taken between two points from their current storage to a new target storage location
    org.opencastproject.job.api.Job
    moveById(String mpId, String targetStorage)
    Spawns a job to move a all snapshots of a mediapackage from their current storage to a new target storage location
    org.opencastproject.job.api.Job
    moveByIdAndDate(String mpId, Date start, Date end, String targetStorage)
    Spawns a job to move a all snapshots of a given mediapackage taken between two points from their current storage to a new target storage location
    org.opencastproject.job.api.Job
    moveByIdAndVersion(org.opencastproject.assetmanager.api.Version version, String mpId, String targetStorage)
    Spawns a job to move a single snapshot from its current storage to a new target storage location
    protected String
    process(org.opencastproject.job.api.Job job)
     
    protected void
    setAssetManager(org.opencastproject.assetmanager.api.AssetManager assetManager)
     
    protected void
    setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService os)
     
    protected void
    setSecurityService(org.opencastproject.security.api.SecurityService securityService)
     
    protected void
    setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
     
    protected void
    setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService uds)
     

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

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

    Methods inherited from class java.lang.Object

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

    • JOB_TYPE

      public static final String JOB_TYPE
      See Also:
    • JOB_LOAD

      public static final Float JOB_LOAD
    • NONTERMINAL_JOB_LOAD

      public static final Float NONTERMINAL_JOB_LOAD
  • Constructor Details

    • AssetManagerJobProducer

      public AssetManagerJobProducer()
  • Method Details

    • activate

      public void activate(org.osgi.service.component.ComponentContext cc)
      OSGi callback on component activation.
      Overrides:
      activate in class org.opencastproject.job.api.AbstractJobProducer
      Parameters:
      cc - the component context
    • datastoreExists

      public boolean datastoreExists(String storeId)
    • process

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

      public org.opencastproject.job.api.Job moveByIdAndVersion(org.opencastproject.assetmanager.api.Version version, String mpId, String targetStorage)
      Spawns a job to move a single snapshot from its current storage to a new target storage location
      Parameters:
      version - The Version to move
      mpId - The mediapackage ID of the snapshot to move
      targetStorage - The RemoteAssetStore ID where the snapshot should be moved
      Returns:
    • internalMoveByIdAndVersion

      protected String internalMoveByIdAndVersion(org.opencastproject.assetmanager.api.Version version, String mpId, String targetStorage) throws org.opencastproject.util.NotFoundException
      Triggers the move operation inside the AssetManager
      Parameters:
      version - The Version to move
      mpId - The mediapackage ID of the snapshot to move
      targetStorage - The RemoteAssetStore ID where the snapshot should be moved
      Returns:
      The string "OK"
      Throws:
      org.opencastproject.util.NotFoundException
    • moveById

      public org.opencastproject.job.api.Job moveById(String mpId, String targetStorage)
      Spawns a job to move a all snapshots of a mediapackage from their current storage to a new target storage location
      Parameters:
      mpId - The mediapackage ID of the snapshot to move
      targetStorage - The RemoteAssetStore ID where the snapshot should be moved
      Returns:
      The Job
    • internalMoveById

      protected String internalMoveById(String mpId, String targetStorage)
      Moves all the appropriate snapshots to their new home
      Parameters:
      mpId - The mediapackage ID of the snapshot to move
      targetStorage - The RemoteAssetStore ID where the snapshot should be moved
      Returns:
      The String containing the number of successful and failed moves [0 OK ][0 FAILED ]
    • moveByDate

      public org.opencastproject.job.api.Job moveByDate(Date start, Date end, String targetStorage)
      Spawns a job to move a all snapshots taken between two points from their current storage to a new target storage location
      Parameters:
      start - The start Date
      end - The end Date
      targetStorage - The RemoteAssetStore ID where the snapshot should be moved
      Returns:
      The Job
    • internalMoveByDate

      protected String internalMoveByDate(Date start, Date end, String targetStorage)
      Spawns subjobs on a per-snapshot level to move the appropriate snapshots to their new home Moves all the appropriate snapshots to their new home
      Parameters:
      start - The start Date
      end - The end Date
      targetStorage - The RemoteAssetStore ID where the snapshot should be moved
      Returns:
      The number of subjobs spawned
    • moveByIdAndDate

      public org.opencastproject.job.api.Job moveByIdAndDate(String mpId, Date start, Date end, String targetStorage)
      Spawns a job to move a all snapshots of a given mediapackage taken between two points from their current storage to a new target storage location
      Parameters:
      mpId - The mediapackage ID of the snapshot to move
      start - The start Date
      end - The end Date
      targetStorage - The RemoteAssetStore ID where the snapshot should be moved
      Returns:
      The Job
    • internalMoveByIdAndDate

      protected String internalMoveByIdAndDate(String mpId, Date start, Date end, String targetStorage)
      Moves all the appropriate snapshots to their new home
      Parameters:
      mpId - The mediapackage ID of the snapshot to move
      start - The start Date
      end - The end Date
      targetStorage - The RemoteAssetStore ID where the snapshot should be moved
      Returns:
      The JSON String containing the number of successful and failed moves {"OK": 0,"FAIL": 0}
    • setServiceRegistry

      protected void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
    • getServiceRegistry

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

      protected void setAssetManager(org.opencastproject.assetmanager.api.AssetManager assetManager)
    • setSecurityService

      protected void setSecurityService(org.opencastproject.security.api.SecurityService securityService)
    • getSecurityService

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

      protected void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService uds)
    • getUserDirectoryService

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

      protected void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService os)
    • getOrganizationDirectoryService

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