Interface MediaPackageElement
- All Superinterfaces:
Cloneable,Comparable<MediaPackageElement>,ManifestContributor
- All Known Subinterfaces:
AdaptivePlaylist,Attachment,Catalog,Publication,Track
- All Known Implementing Classes:
AbstractMediaPackageElement,AttachmentImpl,CatalogImpl,PublicationImpl,TrackImpl,XMLCatalogImpl
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe element type todo is the type definitely needed or can the flavor take its responsibilities? -
Method Summary
Modifier and TypeMethodDescriptionvoidTags the media package element with the given tag.voidRemoves any reference.voidRemoves all tags associated with this elementclone()Create a deep copy of this object.booleancontainsTag(String tag) Returnstrueif the media package element contains the given tag.booleancontainsTag(Collection<String> tags) Returnstrueif the media package element contains at least one of the given tags.Generate a new random identifier for this element.Returns the file's checksum.Returns a human readable name for this media package element.Returns the element's manifest type.Returns the element's type as defined for the specific media package element.Returns the element identifier.Returns the media package if the element has been added,nullotherwise.Returns the element's mimetype as found in the ISO Mime Type Registrations.Returns a reference to another entitiy, both inside or outside the media package.longgetSize()Returns the number of bytes that are occupied by this media package element.String[]getTags()Returns the tags for this media package element or an empty array if there are no tags.getURI()Returns a reference to the element location.voidreferTo(MediaPackageElement element) Adds a reference to the media package elementelement.voidreferTo(MediaPackageReference reference) Adds an arbitrary reference.voidRemoves the tag from the media package element.voidsetChecksum(Checksum checksum) Sets the new checksum on this media package element.voidsetElementDescription(String description) Sets the element description of this media package element.voidsetFlavor(MediaPackageElementFlavor flavor) Sets the flavor on this media package element.voidsetIdentifier(String id) Sets the element identifier.voidsetMimeType(MimeType mimeType) Sets the mime type on this media package element.voidsetReference(MediaPackageReference reference) Sets the element reference.voidsetSize(long size) Sets the file size in bytesvoidSets the given tags for the media package element, overwriting any that may have been set previously.voidSets the elements location.voidverify()Verifies the integrity of the media package element.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.opencastproject.mediapackage.ManifestContributor
toManifest
-
Method Details
-
getIdentifier
String getIdentifier()Returns the element identifier.- Returns:
- the element identifier, may be null
-
setIdentifier
Sets the element identifier.- Parameters:
id- the new element identifier
-
generateIdentifier
String generateIdentifier()Generate a new random identifier for this element.- Returns:
- The new identifier.
-
getElementType
MediaPackageElement.Type getElementType()Returns the element's manifest type.- Returns:
- the manifest type
-
getElementDescription
String getElementDescription()Returns a human readable name for this media package element. If no name was provided, the filename is returned instead.- Returns:
- the element name
-
setElementDescription
Sets the element description of this media package element.- Parameters:
description- the new element description
-
setTags
Sets the given tags for the media package element, overwriting any that may have been set previously.- Parameters:
tags- array of tags
-
addTag
Tags the media package element with the given tag.- Parameters:
tag- the tag
-
removeTag
Removes the tag from the media package element.- Parameters:
tag- the tag
-
containsTag
Returnstrueif the media package element contains the given tag.- Parameters:
tag- the tag- Returns:
trueif the element is tagged
-
containsTag
Returnstrueif the media package element contains at least one of the given tags. If there are no tags contained in the set, then the element is considered to match as well.- Parameters:
tags- the set of tag- Returns:
trueif the element is tagged accordingly
-
getTags
String[] getTags()Returns the tags for this media package element or an empty array if there are no tags.- Returns:
- the tags
-
clearTags
void clearTags()Removes all tags associated with this element -
getMediaPackage
MediaPackage getMediaPackage()Returns the media package if the element has been added,nullotherwise.- Returns:
- the media package
-
getReference
MediaPackageReference getReference()Returns a reference to another entitiy, both inside or outside the media package.- Returns:
- the reference
-
setReference
Sets the element reference.- Parameters:
reference- the reference
-
getURI
URI getURI()Returns a reference to the element location.- Returns:
- the element location
-
setURI
Sets the elements location.- Parameters:
uri- the element location
-
getChecksum
Checksum getChecksum()Returns the file's checksum.- Returns:
- the checksum
-
setChecksum
Sets the new checksum on this media package element.- Parameters:
checksum- the checksum
-
getMimeType
MimeType getMimeType()Returns the element's mimetype as found in the ISO Mime Type Registrations.For example, in case of motion jpeg slides, this method will return the mime type for
video/mj2.- Returns:
- the mime type
-
setMimeType
Sets the mime type on this media package element.- Parameters:
mimeType- the new mime type
-
getFlavor
MediaPackageElementFlavor getFlavor()Returns the element's type as defined for the specific media package element.For example, in case of a video track, the type could be
video/x-presentation.- Returns:
- the element flavor
-
setFlavor
Sets the flavor on this media package element.- Parameters:
flavor- the new flavor
-
getSize
long getSize()Returns the number of bytes that are occupied by this media package element.- Returns:
- the size
-
setSize
void setSize(long size) Sets the file size in bytes- Parameters:
size-
-
verify
Verifies the integrity of the media package element.- Throws:
MediaPackageException- if the media package element is in an incosistant state
-
referTo
Adds a reference to the media package elementelement.Note that an element can only refere to one object. Therefore, any existing reference will be replaced. Also note that if this element is part of a media package, a consistency check will be made making sure the refered element is also part of the same media package. If not, a
MediaPackageExceptionwill be thrown.- Parameters:
element- the element to refere to
-
referTo
Adds an arbitrary reference.Note that an element can only have one reference. Therefore, any existing reference will be replaced. Also note that if this element is part of a media package, a consistency check will be made making sure the refered element is also part of the same media package. If not, a
MediaPackageExceptionwill be thrown.- Parameters:
reference- the reference
-
clearReference
void clearReference()Removes any reference. -
clone
Object clone()Create a deep copy of this object.- Returns:
- The copy
-