Class ChainingMediaPackageSerializer

java.lang.Object
org.opencastproject.mediapackage.ChainingMediaPackageSerializer
All Implemented Interfaces:
MediaPackageSerializer

public class ChainingMediaPackageSerializer extends Object implements MediaPackageSerializer
This class was created to allow more than one MediaPackageSerializer to be applied to the same MediaPackage. For example if you enabled a redirect serializer to move urls from an old server to a new one and a stream security serializer then the urls could be redirected and then signed.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    This serializer should never be chained again and zero as a neutral ranking therefore seems to be appropriate
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    This method is called every time a url is being read from a media package manifest.
    This method is called every time a url is being written to a media package manifest.
    int
    Identifies the serializer ranking number.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • RANKING

      public static final int RANKING
      This serializer should never be chained again and zero as a neutral ranking therefore seems to be appropriate
      See Also:
  • Constructor Details

    • ChainingMediaPackageSerializer

      public ChainingMediaPackageSerializer()
  • Method Details

    • encodeURI

      public URI encodeURI(URI uri) throws URISyntaxException
      Description copied from interface: MediaPackageSerializer
      This method is called every time a url is being written to a media package manifest. By implementing this method, serializers are able to store package elements in directories relative to some common root folder, thereby making it movable.
      Specified by:
      encodeURI in interface MediaPackageSerializer
      Parameters:
      uri - the url to encode
      Returns:
      the encoded path
      Throws:
      URISyntaxException - if the resulting URI contains syntax errors
    • decodeURI

      public URI decodeURI(URI uri) throws URISyntaxException
      Description copied from interface: MediaPackageSerializer
      This method is called every time a url is being read from a media package manifest. By implementing this method, serializers are able to redirect urls to local caches which might make sense when it comes to dealing with huge media files.
      Specified by:
      decodeURI in interface MediaPackageSerializer
      Parameters:
      uri - the original path from the manifest
      Returns:
      the resolved url
      Throws:
      URISyntaxException - if the path cannot be converted into a url
      URISyntaxException - if the resulting URI contains syntax errors
    • getRanking

      public int getRanking()
      Description copied from interface: MediaPackageSerializer
      Identifies the serializer ranking number. The ranking is respected when multiple serializers are chained. When encoding an URI, the serializer with the highest ranking is used first. If an URI needs to be decoded, the ranking is used in the opposite direction.
      Specified by:
      getRanking in interface MediaPackageSerializer
      Returns:
      The service ranking number.