Interface MediaPackageElementBuilderPlugin
- All Known Implementing Classes:
AbstractAttachmentBuilderPlugin,AbstractElementBuilderPlugin,AttachmentBuilderPlugin,CatalogBuilderPlugin,PublicationBuilderPlugin,TrackBuilderPlugin
Implementation note: Builder plugins may be stateful. They are intended to be used as throw-away objects.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(URI uri, MediaPackageElement.Type type, MediaPackageElementFlavor flavor) Deprecated.This method is called on every registered media package builder plugin until one of these plugins returnstrue.booleanaccept(MediaPackageElement.Type type, MediaPackageElementFlavor flavor) Deprecated.This method is called if the media package builder tries to create a new media package element of typeelementType.booleanDeprecated.This method is called while the media package builder parses a media package manifest.voiddestroy()Deprecated.This method is called before the plugin is abandoned by the element builder.elementFromManifest(Node elementNode, MediaPackageSerializer serializer) Deprecated.Creates a media package element from the DOM element.elementFromURI(URI uri) Deprecated.Creates a media package element from the given url that was previously accepted.voidinit()Deprecated.This method is called once in a plugin's life cycle.newElement(MediaPackageElement.Type type, MediaPackageElementFlavor flavor) Deprecated.Creates a new media package element of the specified type.
-
Method Details
-
init
Deprecated.This method is called once in a plugin's life cycle. When this method is called, the plugin can make sure that everything is in place for it to work properly. If this isn't the case, it should throw an exception so it will no longer be bothered by the element builder.- Throws:
Exception- if some unrecoverable state is reached
-
destroy
void destroy()Deprecated.This method is called before the plugin is abandoned by the element builder. -
accept
Deprecated.This method is called if the media package builder tries to create a new media package element of typeelementType.Every registered builder plugin will then be asked whether it is able to create a media package element from the given element type. If this is the case for a plugin, it will then be asked to create such an element by a call to
newElement(org.opencastproject.mediapackage.MediaPackageElement.Type,MediaPackageElementFlavor).- Parameters:
type- the typeflavor- the element flavor- Returns:
trueif the plugin is able to create such an element
-
accept
Deprecated.This method is called on every registered media package builder plugin until one of these plugins returnstrue. If no plugin recognises the file, it is rejected.The parameters
typeandflavormay be taken as strong hints and may both benull.Implementers schould return the correct mime type for the given file if they are absolutely sure about the file. Otherwise,
nullshould be returned.- Parameters:
uri- the element locationtype- the element typeflavor- the element flavor- Returns:
trueif the plugin can handle the element
-
accept
Deprecated.This method is called while the media package builder parses a media package manifest.Every registered builder plugin will then be asked, whether it is able to create a media package element from the given element definition.
The element must then be constructed and returned in the call to
elementFromManifest(Node, MediaPackageSerializer).- Parameters:
elementNode- the node- Returns:
trueif the plugin is able to create such an element
-
elementFromURI
Deprecated.Creates a media package element from the given url that was previously accepted.- Parameters:
uri- the element location- Returns:
- the new media package element
- Throws:
UnsupportedElementException- if creating the media package element fails
-
elementFromManifest
MediaPackageElement elementFromManifest(Node elementNode, MediaPackageSerializer serializer) throws UnsupportedElementException Deprecated.Creates a media package element from the DOM element.- Parameters:
elementNode- the DOM nodeserializer- the media package serializer- Returns:
- the media package element
- Throws:
UnsupportedElementException
-
newElement
Deprecated.Creates a new media package element of the specified type.- Parameters:
type- the element typeflavor- the element flavor- Returns:
- the new media package element
-