Class SigningMediaPackageSerializer

java.lang.Object
org.opencastproject.security.urlsigning.SigningMediaPackageSerializer
All Implemented Interfaces:
MediaPackageSerializer, org.osgi.service.cm.ManagedService

public class SigningMediaPackageSerializer extends Object implements MediaPackageSerializer, org.osgi.service.cm.ManagedService
Implementation of a MediaPackageSerializer that will securely sign urls of a Mediapackage.
  • Field Details

    • RANKING

      public static final int RANKING
      Signing of the URL should probably be something of the last things to do
      See Also:
  • Constructor Details

    • SigningMediaPackageSerializer

      public SigningMediaPackageSerializer()
      Creates a new and unconfigured package serializer that will not be able to perform any redirecting.
  • Method Details

    • setUrlSigningService

      public void setUrlSigningService(UrlSigningService urlSigningService)
      OSGi callback for UrlSigningService
    • unsetUrlSigningService

      public void unsetUrlSigningService(UrlSigningService urlSigningService)
    • updated

      public void updated(Dictionary properties) throws org.osgi.service.cm.ConfigurationException
      OSGi callback if properties file is present
      Specified by:
      updated in interface org.osgi.service.cm.ManagedService
      Throws:
      org.osgi.service.cm.ConfigurationException
    • 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.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getExpirationSeconds

      protected Long getExpirationSeconds()