Class DefaultMediaContainerService

All Implemented Interfaces:
MediaContainerService, Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean

public class DefaultMediaContainerService extends AbstractBusinessService implements MediaContainerService
Default implementation of MediaContainerService
See Also:
  • Constructor Details

    • DefaultMediaContainerService

      public DefaultMediaContainerService()
  • Method Details

    • getMediaForFormat

      public MediaModel getMediaForFormat(MediaContainerModel mediaContainerModel, MediaFormatModel mediaFormatModel)
      Gets the media for the given format from the given container. Returns null if the container does not contain given format.
      Specified by:
      getMediaForFormat in interface MediaContainerService
      Parameters:
      mediaContainerModel - the media container object to look given format
      mediaFormatModel - the media format that we are looking for in the container
      Returns:
      the media for the specified format or null if no media in given format found
      See Also:
    • addMediaToContainer

      public void addMediaToContainer(MediaContainerModel mediaContainerModel, List<MediaModel> mediaModels)
      Adds the medias to the given container. If the media with the same format already exists in the container the existent media will be replaced.
      Specified by:
      addMediaToContainer in interface MediaContainerService
      Parameters:
      mediaContainerModel - the media container object that we will add media to
      mediaModels - the media list that will be added to the container. If media has no format specified IllegalArgumentException will be thrown
    • removeMediaFromContainer

      public void removeMediaFromContainer(MediaContainerModel mediaContainerModel, List<MediaModel> mediaModels)
      Removes the medias from given container.
      Specified by:
      removeMediaFromContainer in interface MediaContainerService
      Parameters:
      mediaContainerModel - the media container
      mediaModels - the medias that will be removed from the container
    • getMediaFormatForSourceFormat

      public MediaFormatModel getMediaFormatForSourceFormat(MediaContextModel contextModel, MediaFormatModel sourceFormatModel)
      Gets the media format for source format from the given media context. Returns null if the required source media format does not exist in the context.
      Specified by:
      getMediaFormatForSourceFormat in interface MediaContainerService
      Parameters:
      contextModel - the context model that should contain target media format we are looking for
      sourceFormatModel - the source format model that we are looking for target
      Returns:
      the media format for source format or null if the specified source format has no target mapping assigned
    • getMediaContextForQualifier

      public MediaContextModel getMediaContextForQualifier(String qualifier)
      Gets the media context for the specified qualifier.
      Specified by:
      getMediaContextForQualifier in interface MediaContainerService
      Parameters:
      qualifier - the qualifier
      Returns:
      the media context for qualifier
    • getMediaContainerForQualifier

      public MediaContainerModel getMediaContainerForQualifier(String qualifier)
      Gets the media container for qualifier.
      Specified by:
      getMediaContainerForQualifier in interface MediaContainerService
      Parameters:
      qualifier - the qualifier
      Returns:
      the media container for qualifier
    • getMediaContainerDao

      @Deprecated(since="4.4", forRemoval=true) protected MediaContainerDao getMediaContainerDao()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 4.4
    • setMediaContainerDao

      public void setMediaContainerDao(MediaContainerDao mediaContainerDao)
    • getMediaService

      public MediaService getMediaService()
      Returns:
      the mediaService
    • setMediaService

      public void setMediaService(MediaService mediaService)
      Parameters:
      mediaService - the mediaService to set