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 -
Field Summary
FieldsFields inherited from class org.opencastproject.job.api.AbstractJobProducer
ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) OSGi callback on component activation.booleandatastoreExists(String storeId) protected org.opencastproject.security.api.OrganizationDirectoryServiceprotected org.opencastproject.security.api.SecurityServiceprotected org.opencastproject.serviceregistry.api.ServiceRegistryprotected org.opencastproject.security.api.UserDirectoryServiceprotected StringinternalMoveByDate(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 homeprotected StringinternalMoveById(String mpId, String targetStorage) Moves all the appropriate snapshots to their new homeprotected StringinternalMoveByIdAndDate(String mpId, Date start, Date end, String targetStorage) Moves all the appropriate snapshots to their new homeprotected StringinternalMoveByIdAndVersion(org.opencastproject.assetmanager.api.Version version, String mpId, String targetStorage) Triggers the move operation inside theAssetManagerorg.opencastproject.job.api.JobmoveByDate(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 locationorg.opencastproject.job.api.JobSpawns a job to move a all snapshots of a mediapackage from their current storage to a new target storage locationorg.opencastproject.job.api.JobmoveByIdAndDate(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 locationorg.opencastproject.job.api.JobmoveByIdAndVersion(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 locationprotected Stringprocess(org.opencastproject.job.api.Job job) protected voidsetAssetManager(org.opencastproject.assetmanager.api.AssetManager assetManager) protected voidsetOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService os) protected voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) protected voidsetServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) protected voidsetUserDirectoryService(org.opencastproject.security.api.UserDirectoryService uds) Methods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
JOB_TYPE
- See Also:
-
JOB_LOAD
-
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:
activatein classorg.opencastproject.job.api.AbstractJobProducer- Parameters:
cc- the component context
-
datastoreExists
-
process
protected String process(org.opencastproject.job.api.Job job) throws org.opencastproject.serviceregistry.api.ServiceRegistryException - Specified by:
processin classorg.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- TheVersionto movempId- The mediapackage ID of the snapshot to movetargetStorage- TheRemoteAssetStoreID 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 theAssetManager- Parameters:
version- TheVersionto movempId- The mediapackage ID of the snapshot to movetargetStorage- TheRemoteAssetStoreID where the snapshot should be moved- Returns:
- The string "OK"
- Throws:
org.opencastproject.util.NotFoundException
-
moveById
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 movetargetStorage- TheRemoteAssetStoreID where the snapshot should be moved- Returns:
- The
Job
-
internalMoveById
Moves all the appropriate snapshots to their new home- Parameters:
mpId- The mediapackage ID of the snapshot to movetargetStorage- TheRemoteAssetStoreID where the snapshot should be moved- Returns:
- The String containing the number of successful and failed moves [0 OK ][0 FAILED ]
-
moveByDate
Spawns a job to move a all snapshots taken between two points from their current storage to a new target storage location -
internalMoveByDate
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 -
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 -
internalMoveByIdAndDate
Moves all the appropriate snapshots to their new home -
setServiceRegistry
protected void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) -
getServiceRegistry
protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()- Specified by:
getServiceRegistryin classorg.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:
getSecurityServicein classorg.opencastproject.job.api.AbstractJobProducer
-
setUserDirectoryService
protected void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService uds) -
getUserDirectoryService
protected org.opencastproject.security.api.UserDirectoryService getUserDirectoryService()- Specified by:
getUserDirectoryServicein classorg.opencastproject.job.api.AbstractJobProducer
-
setOrganizationDirectoryService
protected void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService os) -
getOrganizationDirectoryService
protected org.opencastproject.security.api.OrganizationDirectoryService getOrganizationDirectoryService()- Specified by:
getOrganizationDirectoryServicein classorg.opencastproject.job.api.AbstractJobProducer
-