Class 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 the MediaMetaDataService. This implementation delegates metadata extraction to all MediaMetaDataProvider instances registered in the Spring Application Context. It furthermore maintains the MediaModel.METADATADATAPK flag whether meta data was extracted from the media or not.
    • Constructor Detail

      • DefaultMediaMetaDataService

        public DefaultMediaMetaDataService()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Scans the application context for all registered MediaMetaDataProvider to be used later on for extraction.
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
        See Also:
        InitializingBean.afterPropertiesSet()
      • getAllProviders

        protected java.util.Collection<MediaMetaDataProvider> getAllProviders()
        Accesses a MediaMetaDataProvider instances to be used to extract meta data. The default implementation return a Collection of beans queries from the ApplicationContext after bean initialization.
        Returns:
        all MediaMetaDataProvider instances to be used for meta data extraction.
      • 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 interface MediaMetaDataService
        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 interface MediaMetaDataService
        Returns:
        a Map (key = group name) of Maps (key = code; value = value) of Metadata entries attached to the given MediaModel
      • getApplicationContext

        public org.springframework.context.ApplicationContext getApplicationContext()
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
      • setModelService

        public void setModelService​(ModelService modelService)