Class DefaultMediaMetaDataService
- java.lang.Object
-
- de.hybris.platform.mediaconversion.metadata.DefaultMediaMetaDataService
-
- All Implemented Interfaces:
MediaMetaDataService,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class DefaultMediaMetaDataService extends java.lang.Object implements MediaMetaDataService, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
Default implementation of theMediaMetaDataService. This implementation delegates metadata extraction to allMediaMetaDataProviderinstances registered in the Spring Application Context. It furthermore maintains theMediaModel.METADATADATAPKflag whether meta data was extracted from the media or not.
-
-
Constructor Summary
Constructors Constructor Description DefaultMediaMetaDataService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Scans the application context for all registeredMediaMetaDataProviderto be used later on for extraction.voiddeleteAllMetaData(MediaModel media)Deletes allMediaMetaDataModelinstances associated with the givenmodel.voidextractAllMetaData(MediaModel media)Extracts the given medias metadata and stores it to database.java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>getAllMetaData(MediaModel media)Fetches all (currently persisted) properties mapped by group.protected java.util.Collection<MediaMetaDataProvider>getAllProviders()Accesses aMediaMetaDataProviderinstances to be used to extract meta data.org.springframework.context.ApplicationContextgetApplicationContext()MediaMetaDataServiceDaogetDao()java.util.Map<java.lang.String,java.lang.String>getMetaData(MediaModel media, java.lang.String group)Fetches all (currently persisted) meta data of one group.ModelServicegetModelService()voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetDao(MediaMetaDataServiceDao dao)voidsetModelService(ModelService modelService)
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.ExceptionScans the application context for all registeredMediaMetaDataProviderto be used later on for extraction.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception- See Also:
InitializingBean.afterPropertiesSet()
-
extractAllMetaData
public void extractAllMetaData(MediaModel media)
Extracts the given medias metadata and stores it to database.The implementation should call all
MediaMetaDataProvider.extractMetaData(MediaModel)methods to do this.- Specified by:
extractAllMetaDatain interfaceMediaMetaDataService- Parameters:
media- The MediaModel for which the MetaData is to be extracted.- See Also:
MediaMetaDataService.extractAllMetaData(MediaModel)
-
getAllProviders
protected java.util.Collection<MediaMetaDataProvider> getAllProviders()
Accesses aMediaMetaDataProviderinstances to be used to extract meta data. The default implementation return aCollectionof beans queries from theApplicationContextafter bean initialization.- Returns:
- all
MediaMetaDataProviderinstances to be used for meta data extraction.
-
deleteAllMetaData
public void deleteAllMetaData(MediaModel media)
Deletes allMediaMetaDataModelinstances associated with the givenmodel.- Specified by:
deleteAllMetaDatain interfaceMediaMetaDataService- Parameters:
media- theMediaModelto delete the metadata from.- See Also:
MediaMetaDataService.deleteAllMetaData(MediaModel)
-
getMetaData
public java.util.Map<java.lang.String,java.lang.String> getMetaData(MediaModel media, java.lang.String group)
Description copied from interface:MediaMetaDataServiceFetches all (currently persisted) meta data of one group.- Specified by:
getMetaDatain interfaceMediaMetaDataService- Returns:
- a
Mapof key value pairs.
-
getAllMetaData
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getAllMetaData(MediaModel media)
Description copied from interface:MediaMetaDataServiceFetches all (currently persisted) properties mapped by group.- Specified by:
getAllMetaDatain interfaceMediaMetaDataService- Returns:
- a
Map(key = group name) ofMaps (key = code; value = value) of Metadata entries attached to the givenMediaModel
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
getModelService
public ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getDao
public MediaMetaDataServiceDao getDao()
-
setDao
public void setDao(MediaMetaDataServiceDao dao)
-
-