public interface MediaPackage extends Cloneable
| Modifier and Type | Method and Description |
|---|---|
void |
add(Attachment attachment)
Adds an attachment to this media package.
|
void |
add(Catalog catalog)
Adds catalog information to this media package.
|
void |
add(MediaPackageElement element)
Adds an arbitrary
MediaPackageElement to this media package. |
void |
add(Track track)
Adds a track to this media package, actually moving the underlying file in the filesystem.
|
MediaPackageElement |
add(URI uri)
Adds an arbitrary
URI to this media package, utilizing a MediaPackageBuilder to create a suitable
media package element out of the url. |
MediaPackageElement |
add(URI uri,
MediaPackageElement.Type type,
MediaPackageElementFlavor flavor)
Adds an arbitrary
URI to this media package, utilizing a MediaPackageBuilder to create a suitable
media package element out of the url. |
void |
addContributor(String contributor) |
void |
addCreator(String creator) |
void |
addDerived(MediaPackageElement derivedElement,
MediaPackageElement sourceElement)
Adds an element to this media package that represents a derived version of
sourceElement. |
void |
addDerived(MediaPackageElement derivedElement,
MediaPackageElement sourceElement,
Map<String,String> properties)
Adds an element to this media package that represents a derived version of
sourceElement. |
void |
addObserver(MediaPackageObserver observer)
Adds
observer to the list of observers of this media package. |
void |
addSubject(String subject) |
Object |
clone()
Creates a deep copy of the media package.
|
boolean |
contains(MediaPackageElement element)
Returns
true if the given element is part of the media package. |
Iterable<MediaPackageElement> |
elements()
Returns an iteration of the media package elements.
|
Attachment |
getAttachment(String attachmentId)
Returns the attachment identified by
attachmentId or null if that attachment doesn't
exists. |
Attachment[] |
getAttachments()
Returns the attachments that are part of this media package.
|
Attachment[] |
getAttachments(MediaPackageElementFlavor flavor)
Returns the attachments that are part of this media package and match the specified flavor.
|
Attachment[] |
getAttachments(MediaPackageElementFlavor flavor,
MediaPackageReference reference)
Returns the attachments that are part of this media package and are refering to the element identified by
reference. |
Attachment[] |
getAttachments(MediaPackageReference reference)
Returns the attachments that are part of this media package and are refering to the element identified by
reference. |
Attachment[] |
getAttachments(MediaPackageReference reference,
boolean includeDerived)
Returns the attachments that are part of this media package and are refering to the element identified by
reference. |
Attachment[] |
getAttachmentsByTag(String tag)
Returns the attachments that are tagged with the given tag or an empty array if no such attachments are found.
|
Attachment[] |
getAttachmentsByTags(Collection<String> tags)
Returns the attachments that are tagged with any of the given tags or an empty array if no such attachments are
found.
|
Catalog |
getCatalog(String catalogId)
Returns the catalog identified by
catalogId or null if that catalog doesn't exists. |
Catalog[] |
getCatalogs()
Returns the catalogs associated with this media package.
|
Catalog[] |
getCatalogs(MediaPackageElementFlavor flavor)
Returns the catalogs associated with this media package that matches the specified flavor.
|
Catalog[] |
getCatalogs(MediaPackageElementFlavor flavor,
MediaPackageReference reference)
Returns the catalogs that are part of this media package and are refering to the element identified by
reference. |
Catalog[] |
getCatalogs(MediaPackageReference reference)
Returns the catalogs that are part of this media package and are refering to the element identified by
reference. |
Catalog[] |
getCatalogs(MediaPackageReference reference,
boolean includeDerived)
Returns the catalogs that are part of this media package and are refering to the element identified by
reference. |
Catalog[] |
getCatalogsByTag(String tag)
Returns the catalogs that are tagged with the given tag or an empty array if no such catalogs are found.
|
Catalog[] |
getCatalogsByTags(Collection<String> tags)
Returns the catalogs that are tagged with any of the given tags or an empty array if no such elements are found.
|
String[] |
getContributors()
Returns the names of the institutions or people who contributed to the content within this mediapackage
|
String[] |
getCreators()
Returns the names of the institutions or people who created this mediapackage
|
Date |
getDate()
Returns the media package start time.
|
MediaPackageElement[] |
getDerived(MediaPackageElement sourceElement,
MediaPackageElementFlavor derivateFlavor)
Returns those media package elements that are derivates of
sourceElement and feature the flavor
derivateFlavor. |
Long |
getDuration()
Returns the media package duration in milliseconds or
null if no duration is available. |
MediaPackageElement |
getElementById(String id)
Returns the element that is identified by the given identifier or
null if no such element exists. |
MediaPackageElement |
getElementByReference(MediaPackageReference reference)
Returns the element that is identified by the given reference or
null if no such element exists. |
MediaPackageElement[] |
getElements()
Returns all of the elements.
|
MediaPackageElement[] |
getElementsByFlavor(MediaPackageElementFlavor flavor)
Returns all elements of this media package with the given flavor.
|
MediaPackageElement[] |
getElementsByTag(String tag)
Returns the elements that are tagged with the given tag or an empty array if no such elements are found.
|
MediaPackageElement[] |
getElementsByTags(Collection<String> tags)
Returns the elements that are tagged with any of the given tags or an empty array if no such elements are found.
|
Id |
getIdentifier()
Returns the media package identifier.
|
String |
getLanguage()
Returns the language written and/or spoken in the media content of this mediapackage
|
String |
getLicense()
The license for the content in this mediapackage
|
Publication[] |
getPublications()
Returns the presentations that are part of this media package.
|
String |
getSeries()
Returns the series, if any, to which this mediapackage belongs
|
String |
getSeriesTitle()
Returns the title for the associated series, if any.
|
String[] |
getSubjects()
The keywords describing the subject(s) or categories describing the content of this mediapackage
|
String |
getTitle()
Returns the title of the episode that this mediapackage represents.
|
Track |
getTrack(String trackId)
Returns the track identified by
trackId or null if that track doesn't exists. |
Track[] |
getTracks()
Returns the tracks that are part of this media package.
|
Track[] |
getTracks(MediaPackageElementFlavor flavor)
Returns the tracks that are part of this media package and match the given flavor as defined in
Track. |
Track[] |
getTracks(MediaPackageElementFlavor flavor,
MediaPackageReference reference)
Returns the tracks that are part of this media package and are refering to the element identified by
reference. |
Track[] |
getTracks(MediaPackageReference reference)
Returns the tracks that are part of this media package and are refering to the element identified by
reference. |
Track[] |
getTracks(MediaPackageReference reference,
boolean includeDerived)
Returns the tracks that are part of this media package and are refering to the element identified by
reference. |
Track[] |
getTracksByTag(String tag)
Returns the tracks that are tagged with the given tag or an empty array if no such tracks are found.
|
Track[] |
getTracksByTags(Collection<String> tags)
Returns the tracks that are tagged with any of the given tags or an empty array if no such elements are found.
|
MediaPackageElement[] |
getUnclassifiedElements()
Returns media package elements that are neither, attachments, catalogs nor tracks.
|
MediaPackageElement[] |
getUnclassifiedElements(MediaPackageElementFlavor flavor)
Returns media package elements that are neither, attachments, catalogs nor tracks but have the given element
flavor.
|
boolean |
hasAttachments()
Returns
true if the media package contains attachments of any kind. |
boolean |
hasCatalogs()
Returns
true if the media package contains catalogs of any kind. |
boolean |
hasTracks()
Returns
true if the media package contains media tracks of any kind. |
boolean |
hasUnclassifiedElements()
Returns
true if the media package contains unclassified elements. |
boolean |
hasUnclassifiedElements(MediaPackageElementFlavor flavor)
Returns
true if the media package contains unclassified elements matching the specified element type. |
void |
remove(Attachment attachment)
Removes the attachment from the media package.
|
void |
remove(Catalog catalog)
Removes the catalog from the media package.
|
void |
remove(MediaPackageElement element)
Removes an arbitrary media package element.
|
void |
remove(Track track)
Removes the track from the media package.
|
void |
removeContributor(String contributor) |
void |
removeCreator(String creator) |
MediaPackageElement |
removeElementById(String id)
Removes the element with the given identifier from the mediapackage and returns it.
|
void |
removeObserver(MediaPackageObserver observer)
Removes
observer from the list of observers of this media package. |
void |
removeSubject(String subject) |
void |
renameTo(Id identifier)
Renames the media package to the new identifier.
|
void |
setDate(Date date) |
void |
setDuration(Long duration)
Sets the duration of the media package in milliseconds.
|
void |
setIdentifier(Id id) |
void |
setLanguage(String language) |
void |
setLicense(String license) |
void |
setSeries(String identifier) |
void |
setSeriesTitle(String seriesTitle) |
void |
setTitle(String title) |
void |
verify()
Verifies the media package consistency by checking the media package elements for mimetypes and checksums.
|
Id getIdentifier()
void setIdentifier(Id id)
void setTitle(String title)
String getSeriesTitle()
void setSeriesTitle(String seriesTitle)
String getTitle()
void addCreator(String creator)
void removeCreator(String creator)
String[] getCreators()
void setSeries(String identifier)
String getSeries()
void setLicense(String license)
String getLicense()
void addContributor(String contributor)
void removeContributor(String contributor)
String[] getContributors()
void setLanguage(String language)
String getLanguage()
void addSubject(String subject)
void removeSubject(String subject)
String[] getSubjects()
void setDate(Date date)
Date getDate()
Long getDuration()
null if no duration is available.void setDuration(Long duration) throws IllegalStateException
IllegalStateException if
tracks have been added to the mediapackage already. Also note that as soon as the first track is added, the
duration will be udpated according to the track's length.duration - the duration in millisecondsIllegalStateException - if the mediapackage already contains a trackboolean contains(MediaPackageElement element)
true if the given element is part of the media package.element - the elementtrue if the element belongs to the media packageIterable<MediaPackageElement> elements()
MediaPackageElement[] getElements()
MediaPackageElement getElementByReference(MediaPackageReference reference)
null if no such element exists.reference - the referenceMediaPackageElement getElementById(String id)
null if no such element exists.id - the element identifierMediaPackageElement[] getElementsByTag(String tag)
tag - the tagMediaPackageElement[] getElementsByTags(Collection<String> tags)
tags collection start with a '-' character, any elements matching the tag will
be excluded from the returned MediaPackageElement[]. If tags is empty or null, all elements are
returned.tags - the tagsMediaPackageElement[] getElementsByFlavor(MediaPackageElementFlavor flavor)
Track getTrack(String trackId)
trackId or null if that track doesn't exists.trackId - the track identifierTrack[] getTracks()
Track[] getTracksByTag(String tag)
tag - the tagTrack[] getTracksByTags(Collection<String> tags)
tags collection start with a '-' character, any elements matching the tag will
be excluded from the returned Track[]. If tags is empty or null, all tracks are returned.tags - the tagsTrack[] getTracks(MediaPackageElementFlavor flavor)
Track.flavor - the track's flavorTrack[] getTracks(MediaPackageReference reference)
reference.reference - the referenceTrack[] getTracks(MediaPackageReference reference, boolean includeDerived)
reference.reference - the referenceincludeDerived - true to also include derived elementsTrack[] getTracks(MediaPackageElementFlavor flavor, MediaPackageReference reference)
reference.flavor - the element flavorreference - the referenceboolean hasTracks()
true if the media package contains media tracks of any kind.true if the media package contains tracksAttachment getAttachment(String attachmentId)
attachmentId or null if that attachment doesn't
exists.attachmentId - the attachment identifierAttachment[] getAttachments()
Attachment[] getAttachmentsByTag(String tag)
tag - the tagAttachment[] getAttachmentsByTags(Collection<String> tags)
tags collection start with a '-' character, any elements matching the
tag will be excluded from the returned Attachment[]. If tags is empty or null, all attachments are
returned.tags - the tagsAttachment[] getAttachments(MediaPackageElementFlavor flavor)
flavor - the attachment flavorAttachment[] getAttachments(MediaPackageReference reference)
reference.reference - the referenceAttachment[] getAttachments(MediaPackageReference reference, boolean includeDerived)
reference.reference - the referenceincludeDerived - true to also include derived elementsAttachment[] getAttachments(MediaPackageElementFlavor flavor, MediaPackageReference reference)
reference.flavor - the element flavorreference - the referencePublication[] getPublications()
boolean hasAttachments()
true if the media package contains attachments of any kind.true if the media package contains attachmentsCatalog getCatalog(String catalogId)
catalogId or null if that catalog doesn't exists.catalogId - the catalog identifierCatalog[] getCatalogs()
Catalog[] getCatalogsByTag(String tag)
tag - the tagCatalog[] getCatalogsByTags(Collection<String> tags)
tags collection start with a '-' character, any elements matching the tag will
be excluded from the returned Catalog[]. If tags is empty or null, all catalogs are returned.tags - the tagsCatalog[] getCatalogs(MediaPackageElementFlavor flavor)
flavor - the catalog typeCatalog[] getCatalogs(MediaPackageReference reference)
reference.reference - the referenceCatalog[] getCatalogs(MediaPackageReference reference, boolean includeDerived)
reference.reference - the referenceincludeDerived - true to also include derived elementsCatalog[] getCatalogs(MediaPackageElementFlavor flavor, MediaPackageReference reference)
reference.flavor - the element flavorreference - the referenceboolean hasCatalogs()
true if the media package contains catalogs of any kind.true if the media package contains catalogsMediaPackageElement[] getUnclassifiedElements()
MediaPackageElement[] getUnclassifiedElements(MediaPackageElementFlavor flavor)
flavor - the element flavorboolean hasUnclassifiedElements()
true if the media package contains unclassified elements.true if the media package contains unclassified elementsboolean hasUnclassifiedElements(MediaPackageElementFlavor flavor)
true if the media package contains unclassified elements matching the specified element type.flavor - element flavor of the unclassified elementtrue if the media package contains unclassified elementsMediaPackageElement add(URI uri)
URI to this media package, utilizing a MediaPackageBuilder to create a suitable
media package element out of the url. If the content cannot be recognized as being either a metadata catalog or
multimedia track, it is added as an attachment.uri - the element locationMediaPackageElement add(URI uri, MediaPackageElement.Type type, MediaPackageElementFlavor flavor)
URI to this media package, utilizing a MediaPackageBuilder to create a suitable
media package element out of the url. If the content cannot be recognized as being either a metadata catalog or
multimedia track, it is added as an attachment.uri - the element locationtype - the element typeflavor - the element flavorvoid add(MediaPackageElement element)
MediaPackageElement to this media package.element - the elementvoid add(Track track)
Depending on the implementation, this method may provide significant performance benefits over copying the track.
track - the trackMediaPackageElement removeElementById(String id)
id - the element identifiervoid remove(Track track)
track - the trackvoid add(Catalog catalog)
catalog - the catalogvoid remove(Catalog catalog)
catalog - the catalogvoid add(Attachment attachment)
attachment - the attachmentvoid remove(MediaPackageElement element)
element - the media package elementvoid remove(Attachment attachment)
attachment - the attachmentvoid addDerived(MediaPackageElement derivedElement, MediaPackageElement sourceElement)
sourceElement. Examples of
a derived element could be an encoded version of a track or a converted version of a time text captions file.
This method will add derviedElement to the media package and add a reference to the original element
sourceElement. Make sure that derivedElement features the right flavor, so that you are
later able to look up derived work using getDerived(MediaPackageElement, MediaPackageElementFlavor).
derivedElement - the derived elementsourceElement - the source elementvoid addDerived(MediaPackageElement derivedElement, MediaPackageElement sourceElement, Map<String,String> properties)
sourceElement. Examples of
a derived element could be an encoded version of a track or a converted version of a time text captions file.
This method will add derviedElement to the media package and add a reference to the original element
sourceElement. Make sure that derivedElement features the right flavor, so that you are
later able to look up derived work using getDerived(MediaPackageElement, MediaPackageElementFlavor).
derivedElement - the derived elementsourceElement - the source elementproperties - properties for the reference that is being createdMediaPackageElement[] getDerived(MediaPackageElement sourceElement, MediaPackageElementFlavor derivateFlavor)
sourceElement and feature the flavor
derivateFlavor. Using this method, you could easily look up e. g. flash-encoded versions of the
presenter track or converted versions of a time text captions file.sourceElement - the original track, catalog or attachmentderivateFlavor - the derivate flavor you are looking forvoid addObserver(MediaPackageObserver observer)
observer to the list of observers of this media package.observer - the observervoid removeObserver(MediaPackageObserver observer)
observer from the list of observers of this media package.observer - the observervoid verify()
throws MediaPackageException
MediaPackageException - if an error occurs while checking the media packagevoid renameTo(Id identifier)
identifier - the identifier TODO @return true if the media package could be renamedObject clone()
Copyright © 2009–2020 Opencast Project. All rights reserved.