Class PresignedUrlMediaPackageSerializer

java.lang.Object
org.opencastproject.distribution.aws.s3.PresignedUrlMediaPackageSerializer
All Implemented Interfaces:
MediaPackageSerializer

public class PresignedUrlMediaPackageSerializer extends Object implements MediaPackageSerializer
Implementation of a MediaPackageSerializer that will support presigned URL feature for a Mediapackage
  • Field Details

  • Constructor Details

    • PresignedUrlMediaPackageSerializer

      public PresignedUrlMediaPackageSerializer()
  • Method Details

    • setService

      public void setService(AwsS3DistributionService service)
    • decodeURI

      public URI decodeURI(URI uri) throws URISyntaxException
      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. Generate a presigned URI for the given URI if AwsS3DistributionService is enabled.
      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
    • encodeURI

      public URI encodeURI(URI uri) throws URISyntaxException
      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
    • getRanking

      public int getRanking()
      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.