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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intSigning of the URL should probably be something of the last things to do -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new and unconfigured package serializer that will not be able to perform any redirecting. -
Method Summary
Modifier and TypeMethodDescriptionThis 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.protected LongintIdentifies the serializer ranking number.voidsetUrlSigningService(UrlSigningService urlSigningService) OSGi callback for UrlSigningServicetoString()voidunsetUrlSigningService(UrlSigningService urlSigningService) voidupdated(Dictionary properties) OSGi callback if properties file is present
-
Field Details
-
RANKING
public static final int RANKINGSigning 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
OSGi callback for UrlSigningService -
unsetUrlSigningService
-
updated
OSGi callback if properties file is present- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException
-
encodeURI
Description copied from interface:MediaPackageSerializerThis 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:
encodeURIin interfaceMediaPackageSerializer- Parameters:
uri- the url to encode- Returns:
- the encoded path
- Throws:
URISyntaxException- if the resulting URI contains syntax errors
-
decodeURI
Description copied from interface:MediaPackageSerializerThis 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:
decodeURIin interfaceMediaPackageSerializer- Parameters:
uri- the original path from the manifest- Returns:
- the resolved url
- Throws:
URISyntaxException- if the path cannot be converted into a urlURISyntaxException- if the resulting URI contains syntax errors
-
getRanking
public int getRanking()Description copied from interface:MediaPackageSerializerIdentifies 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:
getRankingin interfaceMediaPackageSerializer- Returns:
- The service ranking number.
-
toString
-
getExpirationSeconds
-