Interface MediaContainerService

  • All Known Implementing Classes:
    DefaultMediaContainerService

    public interface MediaContainerService
    Provides functionality for handling media items related objects. Allows to find, remove and add media containers, formats and mappings items.
    • Method Detail

      • addMediaToContainer

        void addMediaToContainer​(MediaContainerModel mediaContainerModel,
                                 java.util.List<MediaModel> mediaModels)
                          throws java.lang.IllegalArgumentException
        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.
        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
        Throws:
        java.lang.IllegalArgumentException - the illegal argument exception - thrown when any argument is null or any media has no format specified
      • removeMediaFromContainer

        void removeMediaFromContainer​(MediaContainerModel mediaContainerModel,
                                      java.util.List<MediaModel> mediaModels)
                               throws java.lang.IllegalArgumentException
        Removes the medias from given container.
        Parameters:
        mediaContainerModel - the media container
        mediaModels - the medias that will be removed from the container
        Throws:
        java.lang.IllegalArgumentException - the illegal argument exception when any argument is null
      • getMediaFormatForSourceFormat

        MediaFormatModel getMediaFormatForSourceFormat​(MediaContextModel contextModel,
                                                       MediaFormatModel sourceFormatModel)
                                                throws java.lang.IllegalArgumentException,
                                                       ModelNotFoundException
        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.
        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
        Throws:
        java.lang.IllegalArgumentException - the illegal argument exception when any argument is null
        ModelNotFoundException - if the format for specified parameters was not found