Class TextAnalyzerServiceImpl
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.textanalyzer.impl.TextAnalyzerServiceImpl
- All Implemented Interfaces:
JobProducer,TextAnalyzerService,org.osgi.service.cm.ManagedService
public class TextAnalyzerServiceImpl
extends AbstractJobProducer
implements TextAnalyzerService, org.osgi.service.cm.ManagedService
Media analysis service that takes takes an image and returns text as extracted from that image.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key to look for in the service configuration file to override theDEFAULT_ANALYSIS_JOB_LOADstatic final StringResulting collection in the working file repositorystatic final floatThe approximate load placed on the system by creating a text analysis jobprotected DictionaryServiceThe dictionary serviceprotected Mpeg7CatalogServiceThe mpeg-7 serviceprotected OrganizationDirectoryServiceThe organization directory serviceprotected SecurityServiceThe security serviceprotected UserDirectoryServiceThe user directory serviceFields 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.textanalyzer.api.TextAnalyzerService
JOB_TYPE, OPERATION -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the text analyzer service. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) OSGi callback on component activation.protected VideoText[]Returns the video text element for the given image.extract(Attachment image) Takes the given image and returns a receipt that can be used to get the resulting catalog.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 StringAsks the overriding class to process the arguments using the given operation.protected voidsetDictionaryService(DictionaryService dictionaryService) Sets the dictionary serviceprotected voidsetMpeg7CatalogService(Mpeg7CatalogService mpeg7CatalogService) Sets the mpeg7CatalogServicevoidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectory) Sets a reference to the organization directory service.voidsetReadinessIndicator(ReadinessIndicator readinessIndicator) voidsetSecurityService(SecurityService securityService) Callback for setting the security service.protected voidsetServiceRegistry(ServiceRegistry serviceRegistry) Sets the receipt serviceprotected voidsetTextExtractor(TextExtractor textExtractor) Sets the text extractor.voidsetUserDirectoryService(UserDirectoryService userDirectoryService) Callback for setting the user directory service.protected voidsetWorkspace(Workspace workspace) Sets the workspacevoidupdated(Dictionary properties) Methods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
COLLECTION_ID
Resulting collection in the working file repository- See Also:
-
DEFAULT_ANALYSIS_JOB_LOAD
public static final float DEFAULT_ANALYSIS_JOB_LOADThe approximate load placed on the system by creating a text analysis job- See Also:
-
ANALYSIS_JOB_LOAD_KEY
The key to look for in the service configuration file to override theDEFAULT_ANALYSIS_JOB_LOAD- See Also:
-
mpeg7CatalogService
The mpeg-7 service -
dictionaryService
The dictionary service -
securityService
The security service -
userDirectoryService
The user directory service -
organizationDirectoryService
The organization directory service
-
-
Constructor Details
-
TextAnalyzerServiceImpl
public TextAnalyzerServiceImpl()Creates a new instance of the text analyzer service.
-
-
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
-
extract
Takes the given image and returns a receipt that can be used to get the resulting catalog.- Specified by:
extractin interfaceTextAnalyzerService- Parameters:
image- element to analyze- Returns:
- the metadata
- Throws:
TextAnalyzerException- if the text in this image can not be analyzedMediaPackageException- if this attachment is not valid- See Also:
-
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:
-
analyze
Returns the video text element for the given image.- Parameters:
imageFile- the imageid- the video text id- Returns:
- the video text found on the image
- Throws:
TextAnalyzerException- if accessing the image fails
-
setServiceRegistry
Sets the receipt service- Parameters:
serviceRegistry- the service registry
-
getServiceRegistry
Returns a reference to the service registry.- Specified by:
getServiceRegistryin classAbstractJobProducer- Returns:
- the service registry
- See Also:
-
setTextExtractor
Sets the text extractor.- Parameters:
textExtractor- a text extractor implementation
-
setWorkspace
Sets the workspace- Parameters:
workspace- an instance of the workspace
-
setMpeg7CatalogService
Sets the mpeg7CatalogService- Parameters:
mpeg7CatalogService- an instance of the mpeg7 catalog service
-
setDictionaryService
Sets the dictionary service- Parameters:
dictionaryService- an instance of the dicitonary service
-
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:
-
updated
- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-
setReadinessIndicator
-