Class AssetManagerJobProducer

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

public class AssetManagerJobProducer extends AbstractJobProducer
  • 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 AbstractJobProducer
      Parameters:
      cc - the component context
    • datastoreExists

      public boolean datastoreExists(String storeId)
    • process

      protected String process(Job job) throws ServiceRegistryException
      Description copied from class: AbstractJobProducer
      Asks the overriding class to process the arguments using the given operation. The result will be added to the associated job as the payload.
      Specified by:
      process in class AbstractJobProducer
      Parameters:
      job - the job to process
      Returns:
      the operation result
      Throws:
      ServiceRegistryException
    • moveByIdAndVersion

      public Job moveByIdAndVersion(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(Version version, String mpId, String targetStorage) throws 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:
      NotFoundException
    • moveById

      public 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 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 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(ServiceRegistry serviceRegistry)
    • getServiceRegistry

      protected ServiceRegistry getServiceRegistry()
      Description copied from class: AbstractJobProducer
      Returns a reference to the service registry.
      Specified by:
      getServiceRegistry in class AbstractJobProducer
      Returns:
      the service registry
    • setAssetManager

      protected void setAssetManager(AssetManager assetManager)
    • setSecurityService

      protected void setSecurityService(SecurityService securityService)
    • getSecurityService

      protected SecurityService getSecurityService()
      Description copied from class: AbstractJobProducer
      Returns a reference to the security service
      Specified by:
      getSecurityService in class AbstractJobProducer
      Returns:
      the security service
    • setUserDirectoryService

      protected void setUserDirectoryService(UserDirectoryService uds)
    • getUserDirectoryService

      protected UserDirectoryService getUserDirectoryService()
      Description copied from class: AbstractJobProducer
      Returns a reference to the user directory service
      Specified by:
      getUserDirectoryService in class AbstractJobProducer
      Returns:
      the user directory service
    • setOrganizationDirectoryService

      protected void setOrganizationDirectoryService(OrganizationDirectoryService os)
    • getOrganizationDirectoryService

      protected OrganizationDirectoryService getOrganizationDirectoryService()
      Description copied from class: AbstractJobProducer
      Returns a reference to the organization directory service.
      Specified by:
      getOrganizationDirectoryService in class AbstractJobProducer
      Returns:
      the organization directory service