Class MediaInspectionServiceImpl
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.inspection.ffmpeg.MediaInspectionServiceImpl
- All Implemented Interfaces:
MediaInspectionService,JobProducer
public class MediaInspectionServiceImpl
extends AbstractJobProducer
implements MediaInspectionService
Inspects media via ffprobe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatThe load introduced on the system by creating an enrich jobstatic final floatThe load introduced on the system by creating an inspect jobstatic final StringThe key to look for in the service configuration file to override theDEFAULT_ENRICH_JOB_LOADstatic final StringThe key to look for in the service configuration file to override theDEFAULT_INSPECT_JOB_LOADFields inherited from class org.opencastproject.job.api.AbstractJobProducer
ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobTypeFields inherited from interface org.opencastproject.inspection.api.MediaInspectionService
JOB_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new media inspection service instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) OSGI activate method.enrich(MediaPackageElement element, boolean override) Equip an existing media package element with automatically generated metadataenrich(MediaPackageElement element, boolean override, Map<String, String> options) Equip an existing media package element with automatically generated metadataprotected 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 serviceInspect a track based on a given uri to the track and put the gathered data into the trackInspect a track based on a given uri to the track and put the gathered data into the trackvoidmodified(org.osgi.service.component.ComponentContext cc) protected StringAsks the overriding class to process the arguments using the given operation.voidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectory) Sets a reference to the organization directory service.voidsetSecurityService(SecurityService securityService) Callback for setting the security service.protected voidsetServiceRegistry(ServiceRegistry jobManager) voidsetUserDirectoryService(UserDirectoryService userDirectoryService) Callback for setting the user directory service.protected voidsetWorkspace(Workspace workspace) Methods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
DEFAULT_INSPECT_JOB_LOAD
public static final float DEFAULT_INSPECT_JOB_LOADThe load introduced on the system by creating an inspect job- See Also:
-
DEFAULT_ENRICH_JOB_LOAD
public static final float DEFAULT_ENRICH_JOB_LOADThe load introduced on the system by creating an enrich job- See Also:
-
INSPECT_JOB_LOAD_KEY
The key to look for in the service configuration file to override theDEFAULT_INSPECT_JOB_LOAD- See Also:
-
ENRICH_JOB_LOAD_KEY
The key to look for in the service configuration file to override theDEFAULT_ENRICH_JOB_LOAD- See Also:
-
-
Constructor Details
-
MediaInspectionServiceImpl
public MediaInspectionServiceImpl()Creates a new media inspection service instance.
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) Description copied from class:AbstractJobProducerOSGI activate method.- Overrides:
activatein classAbstractJobProducer- Parameters:
cc- OSGI component context
-
modified
public void modified(org.osgi.service.component.ComponentContext cc) -
process
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:
processin classAbstractJobProducer- Parameters:
job- the job to process- Returns:
- the operation result
- Throws:
Exception- See Also:
-
inspect
Inspect a track based on a given uri to the track and put the gathered data into the track- Specified by:
inspectin interfaceMediaInspectionService- Parameters:
uri- the uri to a track in a media package- Returns:
- the receipt of this job, that can be used to check the current status of inspect method and retrieve track with added metadata when done
- Throws:
MediaInspectionException- if there is a failure during media package update- See Also:
-
inspect
Inspect a track based on a given uri to the track and put the gathered data into the track- Specified by:
inspectin interfaceMediaInspectionService- Parameters:
uri- the uri to a track in a media packageoptions- Options in form of key/value pairs that are passed to the Media Inspection Service implementation. Those options may be implementation specific. The implementation is supposed to raise an exception in case unsupported options are encountered. Value may not be null.- Returns:
- the receipt of this job, that can be used to check the current status of inspect method and retrieve track with added metadata when done
- Throws:
MediaInspectionException- if there is a failure during media package update- See Also:
-
enrich
public Job enrich(MediaPackageElement element, boolean override) throws MediaInspectionException, MediaPackageException Equip an existing media package element with automatically generated metadata- Specified by:
enrichin interfaceMediaInspectionService- Parameters:
element- The original media package element that will be inspectedoverride- In case of conflict between existing and automatically obtained metadata this switch selects preference. False..The original metadata will be kept, True..The new metadata will be used.- Returns:
- the receipt of this job, that can be used to check the current status of enrich method and retrieve enriched element when done
- Throws:
MediaInspectionException- if there is a failure during media package updateMediaPackageException- if the element is invalid- See Also:
-
enrich
public Job enrich(MediaPackageElement element, boolean override, Map<String, String> options) throws MediaInspectionException, MediaPackageExceptionEquip an existing media package element with automatically generated metadata- Specified by:
enrichin interfaceMediaInspectionService- Parameters:
element- The original media package element that will be inspectedoverride- In case of conflict between existing and automatically obtained metadata this switch selects preference. False..The original metadata will be kept, True..The new metadata will be used.options- Options in form of key/value pairs that are passed to the MediaInspectionService implementation. Those options may be implementation specific. The implementation is supposed to raise an exception in case unsupported options are encountered. Value may not be null.- Returns:
- the receipt of this job, that can be used to check the current status of enrich method and retrieve enriched element when done
- Throws:
MediaInspectionException- if there is a failure during media package updateMediaPackageException- if the element is invalid- See Also:
-
setWorkspace
-
setServiceRegistry
-
getServiceRegistry
Returns a reference to the service registry.- Specified by:
getServiceRegistryin classAbstractJobProducer- Returns:
- the service registry
- See Also:
-
setSecurityService
Callback for setting the security service.- Parameters:
securityService- the securityService to set
-
setUserDirectoryService
Callback for setting the user directory service.- Parameters:
userDirectoryService- the userDirectoryService to set
-
setOrganizationDirectoryService
Sets a reference to the organization directory service.- Parameters:
organizationDirectory- the organization directory
-
getSecurityService
Returns a reference to the security service- Specified by:
getSecurityServicein classAbstractJobProducer- Returns:
- the security service
- See Also:
-
getUserDirectoryService
Returns a reference to the user directory service- Specified by:
getUserDirectoryServicein classAbstractJobProducer- Returns:
- the user directory service
- See Also:
-
getOrganizationDirectoryService
Returns a reference to the organization directory service.- Specified by:
getOrganizationDirectoryServicein classAbstractJobProducer- Returns:
- the organization directory service
- See Also:
-