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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addMediaToContainer(MediaContainerModel mediaContainerModel, java.util.List<MediaModel> mediaModels)
Adds the medias to the given container.MediaContainerModel
getMediaContainerForQualifier(java.lang.String qualifier)
Gets the media container for qualifier.MediaContextModel
getMediaContextForQualifier(java.lang.String qualifier)
Gets the media context for the specified qualifier.MediaModel
getMediaForFormat(MediaContainerModel mediaContainerModel, MediaFormatModel mediaFormatModel)
Gets the media for the given format from the given container.MediaFormatModel
getMediaFormatForSourceFormat(MediaContextModel contextModel, MediaFormatModel sourceFormatModel)
Gets the media format for source format from the given media context.void
removeMediaFromContainer(MediaContainerModel mediaContainerModel, java.util.List<MediaModel> mediaModels)
Removes the medias from given container.
-
-
-
Method Detail
-
getMediaForFormat
MediaModel getMediaForFormat(MediaContainerModel mediaContainerModel, MediaFormatModel mediaFormatModel) throws ModelNotFoundException
Gets the media for the given format from the given container. Returns null if the container does not contain given format.- Parameters:
mediaContainerModel
- the media container object to look given formatmediaFormatModel
- 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
- Throws:
ModelNotFoundException
- if no media model for given parameters was found- See Also:
MediaService.getMediaByFormat(MediaContainerModel, MediaFormatModel)
-
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 tomediaModels
- the media list that will be added to the container. If media has no format specifiedIllegalArgumentException
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 containermediaModels
- 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 forsourceFormatModel
- 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 nullModelNotFoundException
- if the format for specified parameters was not found
-
getMediaContainerForQualifier
MediaContainerModel getMediaContainerForQualifier(java.lang.String qualifier) throws UnknownIdentifierException, AmbiguousIdentifierException
Gets the media container for qualifier.- Parameters:
qualifier
- the qualifier- Returns:
- the media container for qualifier
- Throws:
UnknownIdentifierException
- the unknown identifier exceptionAmbiguousIdentifierException
- the ambiguous identifier exception
-
getMediaContextForQualifier
MediaContextModel getMediaContextForQualifier(java.lang.String qualifier) throws UnknownIdentifierException, AmbiguousIdentifierException
Gets the media context for the specified qualifier.- Parameters:
qualifier
- the qualifier- Returns:
- the media context for qualifier
- Throws:
UnknownIdentifierException
- the unknown identifier exceptionAmbiguousIdentifierException
- the ambiguous identifier exception
-
-