Package org.opencastproject.caption.impl
Class CaptionServiceImpl
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.caption.impl.CaptionServiceImpl
- All Implemented Interfaces:
org.opencastproject.caption.api.CaptionService,org.opencastproject.job.api.JobProducer,org.osgi.service.cm.ManagedService
public class CaptionServiceImpl
extends org.opencastproject.job.api.AbstractJobProducer
implements org.opencastproject.caption.api.CaptionService, org.osgi.service.cm.ManagedService
Implementation of
CaptionService. Uses ComponentContext to get all registered
CaptionConverters. Converters are searched based on caption.format property. If there is no
match for specified input or output format UnsupportedCaptionFormatException is thrown.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key to look for in the service configuration file to override theDEFAULT_CAPTION_JOB_LOADstatic final StringThe collection nameprotected org.osgi.service.component.ComponentContextComponent context needed for retrieving Converter Enginesstatic final floatThe load introduced on the system by creating a caption jobprotected org.opencastproject.security.api.OrganizationDirectoryServiceThe organization directory serviceprotected org.opencastproject.security.api.SecurityServiceThe security serviceprotected org.opencastproject.serviceregistry.api.ServiceRegistryReference to remote service managerprotected org.opencastproject.security.api.UserDirectoryServiceThe user directory serviceprotected org.opencastproject.workspace.api.WorkspaceReference to workspaceFields 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.caption.api.CaptionService
JOB_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext componentContext) Activate this service implementation via the OSGI service component runtime.protected org.opencastproject.mediapackage.MediaPackageElementconvert(org.opencastproject.job.api.Job job, org.opencastproject.mediapackage.MediaPackageElement input, String inputFormat, String outputFormat, String language) Converts the captions and returns them in a new catalog.org.opencastproject.job.api.Jobconvert(org.opencastproject.mediapackage.MediaPackageElement input, String inputFormat, String outputFormat) org.opencastproject.job.api.Jobconvert(org.opencastproject.mediapackage.MediaPackageElement input, String inputFormat, String outputFormat, String language) Returns all registered CaptionFormats.protected org.opencastproject.caption.api.CaptionConvertergetCaptionConverter(String formatName) Returns specificCaptionConverter.String[]getLanguageList(org.opencastproject.mediapackage.MediaPackageElement input, String format) 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) voidsetOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectory) Sets a reference to the organization directory service.voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) Callback for setting the security service.protected voidsetServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) Setter for remote service manager via declarative activationvoidsetUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) Callback for setting the user directory service.protected voidsetWorkspace(org.opencastproject.workspace.api.Workspace workspace) Setter for workspace via declarative activationvoidupdated(Dictionary properties) Methods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
COLLECTION
The collection name- See Also:
-
DEFAULT_CAPTION_JOB_LOAD
public static final float DEFAULT_CAPTION_JOB_LOADThe load introduced on the system by creating a caption job- See Also:
-
CAPTION_JOB_LOAD_KEY
The key to look for in the service configuration file to override theDEFAULT_CAPTION_JOB_LOAD- See Also:
-
workspace
protected org.opencastproject.workspace.api.Workspace workspaceReference to workspace -
serviceRegistry
protected org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistryReference to remote service manager -
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 -
componentContext
protected org.osgi.service.component.ComponentContext componentContextComponent context needed for retrieving Converter Engines
-
-
Constructor Details
-
CaptionServiceImpl
public CaptionServiceImpl()Creates a new caption service.
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext componentContext) Activate this service implementation via the OSGI service component runtime.- Overrides:
activatein classorg.opencastproject.job.api.AbstractJobProducer- Parameters:
componentContext- the component context
-
convert
public org.opencastproject.job.api.Job convert(org.opencastproject.mediapackage.MediaPackageElement input, String inputFormat, String outputFormat) throws org.opencastproject.caption.api.UnsupportedCaptionFormatException, org.opencastproject.caption.api.CaptionConverterException, org.opencastproject.mediapackage.MediaPackageException - Specified by:
convertin interfaceorg.opencastproject.caption.api.CaptionService- Throws:
org.opencastproject.caption.api.UnsupportedCaptionFormatExceptionorg.opencastproject.caption.api.CaptionConverterExceptionorg.opencastproject.mediapackage.MediaPackageException- See Also:
-
convert
public org.opencastproject.job.api.Job convert(org.opencastproject.mediapackage.MediaPackageElement input, String inputFormat, String outputFormat, String language) throws org.opencastproject.caption.api.UnsupportedCaptionFormatException, org.opencastproject.caption.api.CaptionConverterException, org.opencastproject.mediapackage.MediaPackageException - Specified by:
convertin interfaceorg.opencastproject.caption.api.CaptionService- Throws:
org.opencastproject.caption.api.UnsupportedCaptionFormatExceptionorg.opencastproject.caption.api.CaptionConverterExceptionorg.opencastproject.mediapackage.MediaPackageException- See Also:
-
convert
protected org.opencastproject.mediapackage.MediaPackageElement convert(org.opencastproject.job.api.Job job, org.opencastproject.mediapackage.MediaPackageElement input, String inputFormat, String outputFormat, String language) throws org.opencastproject.caption.api.UnsupportedCaptionFormatException, org.opencastproject.caption.api.CaptionConverterException, org.opencastproject.mediapackage.MediaPackageException Converts the captions and returns them in a new catalog.- Returns:
- the converted catalog
- Throws:
org.opencastproject.caption.api.UnsupportedCaptionFormatExceptionorg.opencastproject.caption.api.CaptionConverterExceptionorg.opencastproject.mediapackage.MediaPackageException
-
getLanguageList
public String[] getLanguageList(org.opencastproject.mediapackage.MediaPackageElement input, String format) throws org.opencastproject.caption.api.UnsupportedCaptionFormatException, org.opencastproject.caption.api.CaptionConverterException - Specified by:
getLanguageListin interfaceorg.opencastproject.caption.api.CaptionService- Throws:
org.opencastproject.caption.api.UnsupportedCaptionFormatExceptionorg.opencastproject.caption.api.CaptionConverterException
-
getAvailableCaptionConverters
protected HashMap<String,org.opencastproject.caption.api.CaptionConverter> getAvailableCaptionConverters()Returns all registered CaptionFormats. -
getCaptionConverter
Returns specificCaptionConverter. Registry is searched based on formatName, so in order forCaptionConverterto be found, it has to havecaption.formatproperty set withCaptionConverterformat. If none is found, null is returned, if more than one is found then the first reference is returned.- Parameters:
formatName- name of the caption format- Returns:
CaptionConverteror null if none is found
-
process
- Specified by:
processin classorg.opencastproject.job.api.AbstractJobProducer- Throws:
Exception- See Also:
-
setWorkspace
protected void setWorkspace(org.opencastproject.workspace.api.Workspace workspace) Setter for workspace via declarative activation -
setServiceRegistry
protected void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) Setter for remote service manager via declarative activation -
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:
-
getOrganizationDirectoryService
protected org.opencastproject.security.api.OrganizationDirectoryService getOrganizationDirectoryService()- Specified by:
getOrganizationDirectoryServicein 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:
-
getServiceRegistry
protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()- Specified by:
getServiceRegistryin classorg.opencastproject.job.api.AbstractJobProducer- See Also:
-
updated
- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-