Interface MediaPackageElementBuilderPlugin

All Known Implementing Classes:
AbstractAttachmentBuilderPlugin, AbstractElementBuilderPlugin, AttachmentBuilderPlugin, CatalogBuilderPlugin, PublicationBuilderPlugin, TrackBuilderPlugin

@Deprecated public interface MediaPackageElementBuilderPlugin
Deprecated.
An element builder plugin is an object that is able to recognize one ore more filetypes slated for ingest into Opencast.

Implementation note: Builder plugins may be stateful. They are intended to be used as throw-away objects.

  • Method Details

    • init

      void init() throws Exception
      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

      boolean accept(MediaPackageElement.Type type, MediaPackageElementFlavor flavor)
      Deprecated.
      This method is called if the media package builder tries to create a new media package element of type elementType.

      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 type
      flavor - the element flavor
      Returns:
      true if the plugin is able to create such an element
    • accept

      boolean accept(URI uri, MediaPackageElement.Type type, MediaPackageElementFlavor flavor)
      Deprecated.
      This method is called on every registered media package builder plugin until one of these plugins returns true. If no plugin recognises the file, it is rejected.

      The parameters type and flavor may be taken as strong hints and may both be null.

      Implementers schould return the correct mime type for the given file if they are absolutely sure about the file. Otherwise, null should be returned.

      Parameters:
      uri - the element location
      type - the element type
      flavor - the element flavor
      Returns:
      true if the plugin can handle the element
    • accept

      boolean accept(Node elementNode)
      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:
      true if 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 node
      serializer - 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 type
      flavor - the element flavor
      Returns:
      the new media package element