Class TextAnalyzerServiceImpl
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.textanalyzer.impl.TextAnalyzerServiceImpl
- All Implemented Interfaces:
org.opencastproject.job.api.JobProducer,org.opencastproject.textanalyzer.api.TextAnalyzerService,org.osgi.service.cm.ManagedService
public class TextAnalyzerServiceImpl
extends org.opencastproject.job.api.AbstractJobProducer
implements org.opencastproject.textanalyzer.api.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 org.opencastproject.dictionary.api.DictionaryServiceThe dictionary serviceprotected org.opencastproject.metadata.mpeg7.Mpeg7CatalogServiceThe mpeg-7 serviceprotected org.opencastproject.security.api.OrganizationDirectoryServiceThe organization directory serviceprotected org.opencastproject.security.api.SecurityServiceThe security serviceprotected org.opencastproject.security.api.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 org.opencastproject.metadata.mpeg7.VideoText[]Returns the video text element for the given image.org.opencastproject.job.api.Jobextract(org.opencastproject.mediapackage.Attachment image) protected org.opencastproject.security.api.OrganizationDirectoryServiceprotected org.opencastproject.security.api.SecurityServiceprotected org.opencastproject.serviceregistry.api.ServiceRegistryprotected org.opencastproject.security.api.UserDirectoryServiceprotected Stringprocess(org.opencastproject.job.api.Job job) protected voidsetDictionaryService(org.opencastproject.dictionary.api.DictionaryService dictionaryService) Sets the dictionary serviceprotected voidsetMpeg7CatalogService(org.opencastproject.metadata.mpeg7.Mpeg7CatalogService mpeg7CatalogService) Sets the mpeg7CatalogServicevoidsetOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectory) Sets a reference to the organization directory service.voidsetReadinessIndicator(org.opencastproject.util.ReadinessIndicator readinessIndicator) voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) Callback for setting the security service.protected voidsetServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) Sets the receipt serviceprotected voidsetTextExtractor(org.opencastproject.textextractor.api.TextExtractor textExtractor) Sets the text extractor.voidsetUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) Callback for setting the user directory service.protected voidsetWorkspace(org.opencastproject.workspace.api.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
protected org.opencastproject.metadata.mpeg7.Mpeg7CatalogService mpeg7CatalogServiceThe mpeg-7 service -
dictionaryService
protected org.opencastproject.dictionary.api.DictionaryService dictionaryServiceThe dictionary service -
securityService
protected org.opencastproject.security.api.SecurityService securityServiceThe security service -
userDirectoryService
protected org.opencastproject.security.api.UserDirectoryService userDirectoryServiceThe user directory service -
organizationDirectoryService
protected org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryServiceThe 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 classorg.opencastproject.job.api.AbstractJobProducer- Parameters:
cc- the component context
-
extract
public org.opencastproject.job.api.Job extract(org.opencastproject.mediapackage.Attachment image) throws org.opencastproject.textanalyzer.api.TextAnalyzerException, org.opencastproject.mediapackage.MediaPackageException - Specified by:
extractin interfaceorg.opencastproject.textanalyzer.api.TextAnalyzerService- Throws:
org.opencastproject.textanalyzer.api.TextAnalyzerExceptionorg.opencastproject.mediapackage.MediaPackageException- See Also:
-
process
- Specified by:
processin classorg.opencastproject.job.api.AbstractJobProducer- Throws:
Exception- See Also:
-
analyze
protected org.opencastproject.metadata.mpeg7.VideoText[] analyze(File imageFile, String id) throws org.opencastproject.textanalyzer.api.TextAnalyzerException 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:
org.opencastproject.textanalyzer.api.TextAnalyzerException- if accessing the image fails
-
setServiceRegistry
protected void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) Sets the receipt service- Parameters:
serviceRegistry- the service registry
-
getServiceRegistry
protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()- Specified by:
getServiceRegistryin classorg.opencastproject.job.api.AbstractJobProducer- See Also:
-
setTextExtractor
protected void setTextExtractor(org.opencastproject.textextractor.api.TextExtractor textExtractor) Sets the text extractor.- Parameters:
textExtractor- a text extractor implementation
-
setWorkspace
protected void setWorkspace(org.opencastproject.workspace.api.Workspace workspace) Sets the workspace- Parameters:
workspace- an instance of the workspace
-
setMpeg7CatalogService
protected void setMpeg7CatalogService(org.opencastproject.metadata.mpeg7.Mpeg7CatalogService mpeg7CatalogService) Sets the mpeg7CatalogService- Parameters:
mpeg7CatalogService- an instance of the mpeg7 catalog service
-
setDictionaryService
protected void setDictionaryService(org.opencastproject.dictionary.api.DictionaryService dictionaryService) Sets the dictionary service- Parameters:
dictionaryService- an instance of the dicitonary service
-
setSecurityService
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) Callback for setting the security service.- Parameters:
securityService- the securityService to set
-
setUserDirectoryService
public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) Callback for setting the user directory service.- Parameters:
userDirectoryService- the userDirectoryService to set
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectory) Sets a reference to the organization directory service.- Parameters:
organizationDirectory- the organization directory
-
getSecurityService
protected org.opencastproject.security.api.SecurityService getSecurityService()- Specified by:
getSecurityServicein classorg.opencastproject.job.api.AbstractJobProducer- See Also:
-
getUserDirectoryService
protected org.opencastproject.security.api.UserDirectoryService getUserDirectoryService()- Specified by:
getUserDirectoryServicein classorg.opencastproject.job.api.AbstractJobProducer- See Also:
-
getOrganizationDirectoryService
protected org.opencastproject.security.api.OrganizationDirectoryService getOrganizationDirectoryService()- Specified by:
getOrganizationDirectoryServicein classorg.opencastproject.job.api.AbstractJobProducer- See Also:
-
updated
- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-
setReadinessIndicator
public void setReadinessIndicator(org.opencastproject.util.ReadinessIndicator readinessIndicator)
-