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 allMediaMetaDataProvider
instances registered in the Spring Application Context. It furthermore maintains theMediaModel.METADATADATAPK
flag 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 void
afterPropertiesSet()
Scans the application context for all registeredMediaMetaDataProvider
to be used later on for extraction.void
deleteAllMetaData(MediaModel media)
Deletes allMediaMetaDataModel
instances associated with the givenmodel
.void
extractAllMetaData(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 aMediaMetaDataProvider
instances to be used to extract meta data.org.springframework.context.ApplicationContext
getApplicationContext()
MediaMetaDataServiceDao
getDao()
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.ModelService
getModelService()
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setDao(MediaMetaDataServiceDao dao)
void
setModelService(ModelService modelService)
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
Scans the application context for all registeredMediaMetaDataProvider
to be used later on for extraction.- Specified by:
afterPropertiesSet
in 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:
extractAllMetaData
in 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 aMediaMetaDataProvider
instances to be used to extract meta data. The default implementation return aCollection
of beans queries from theApplicationContext
after bean initialization.- Returns:
- all
MediaMetaDataProvider
instances to be used for meta data extraction.
-
deleteAllMetaData
public void deleteAllMetaData(MediaModel media)
Deletes allMediaMetaDataModel
instances associated with the givenmodel
.- Specified by:
deleteAllMetaData
in interfaceMediaMetaDataService
- Parameters:
media
- theMediaModel
to 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:MediaMetaDataService
Fetches all (currently persisted) meta data of one group.- Specified by:
getMetaData
in interfaceMediaMetaDataService
- Returns:
- a
Map
of 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:MediaMetaDataService
Fetches all (currently persisted) properties mapped by group.- Specified by:
getAllMetaData
in interfaceMediaMetaDataService
- Returns:
- a
Map
(key = group name) ofMap
s (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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
getModelService
public ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getDao
public MediaMetaDataServiceDao getDao()
-
setDao
public void setDao(MediaMetaDataServiceDao dao)
-
-