Class AssetManagerJobProducer
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.assetmanager.impl.AssetManagerJobProducer
- All Implemented Interfaces:
JobProducer
-
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 OrganizationDirectoryServiceReturns a reference to the organization directory service.protected SecurityServiceReturns a reference to the security serviceprotected ServiceRegistryReturns a reference to the service registry.protected UserDirectoryServiceReturns a reference to the user directory serviceprotected 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(Version version, String mpId, String targetStorage) Triggers the move operation inside theAssetManagermoveByDate(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 locationSpawns a job to move a all snapshots of a mediapackage from their current storage to a new target storage locationmoveByIdAndDate(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 locationmoveByIdAndVersion(Version version, String mpId, String targetStorage) Spawns a job to move a single snapshot from its current storage to a new target storage locationprotected StringAsks the overriding class to process the arguments using the given operation.protected voidsetAssetManager(AssetManager assetManager) protected voidprotected voidsetSecurityService(SecurityService securityService) protected voidsetServiceRegistry(ServiceRegistry serviceRegistry) protected voidMethods 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 classAbstractJobProducer- Parameters:
cc- the component context
-
datastoreExists
-
process
Description copied from class:AbstractJobProducerAsks 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:
processin classAbstractJobProducer- Parameters:
job- the job to process- Returns:
- the operation result
- Throws:
ServiceRegistryException
-
moveByIdAndVersion
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(Version version, String mpId, String targetStorage) throws 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:
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- Parameters:
start- The startDateend- The endDatetargetStorage- TheRemoteAssetStoreID where the snapshot should be moved- Returns:
- The
Job
-
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- Parameters:
start- The startDateend- The endDatetargetStorage- TheRemoteAssetStoreID where the snapshot should be moved- Returns:
- The number of subjobs spawned
-
moveByIdAndDate
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 movestart- The startDateend- The endDatetargetStorage- TheRemoteAssetStoreID where the snapshot should be moved- Returns:
- The
Job
-
internalMoveByIdAndDate
Moves all the appropriate snapshots to their new home- Parameters:
mpId- The mediapackage ID of the snapshot to movestart- The startDateend- The endDatetargetStorage- TheRemoteAssetStoreID where the snapshot should be moved- Returns:
- The JSON String containing the number of successful and failed moves {"OK": 0,"FAIL": 0}
-
setServiceRegistry
-
getServiceRegistry
Description copied from class:AbstractJobProducerReturns a reference to the service registry.- Specified by:
getServiceRegistryin classAbstractJobProducer- Returns:
- the service registry
-
setAssetManager
-
setSecurityService
-
getSecurityService
Description copied from class:AbstractJobProducerReturns a reference to the security service- Specified by:
getSecurityServicein classAbstractJobProducer- Returns:
- the security service
-
setUserDirectoryService
-
getUserDirectoryService
Description copied from class:AbstractJobProducerReturns a reference to the user directory service- Specified by:
getUserDirectoryServicein classAbstractJobProducer- Returns:
- the user directory service
-
setOrganizationDirectoryService
-
getOrganizationDirectoryService
Description copied from class:AbstractJobProducerReturns a reference to the organization directory service.- Specified by:
getOrganizationDirectoryServicein classAbstractJobProducer- Returns:
- the organization directory service
-