Class UrlSigningServiceImpl

java.lang.Object
org.opencastproject.security.urlsigning.service.impl.UrlSigningServiceImpl
All Implemented Interfaces:
UrlSigningService

public class UrlSigningServiceImpl extends Object implements UrlSigningService
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accepts(String baseUrl)
    Returns true if the signing service accepts to sign the baseUrl.
    sign(String baseUrl, Long validUntilDuration, Long validFromDuration, String ipAddr)
    Create a secure signature for a resource by adding the validUntilDuration to the current time and optionally adding the validFromDuration to the current time to create the available and expiry dates for the signature.
    sign(String baseUrl, org.joda.time.DateTime validUntil, org.joda.time.DateTime validFrom, String ipAddr)
    Create a secure signature for a resource using DateTime objects.

    Methods inherited from class java.lang.Object

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

    • UrlSigningServiceImpl

      public UrlSigningServiceImpl()
  • Method Details

    • accepts

      public boolean accepts(String baseUrl)
      Description copied from interface: UrlSigningService
      Returns true if the signing service accepts to sign the baseUrl.
      Specified by:
      accepts in interface UrlSigningService
      Parameters:
      baseUrl - The base URL of the resource that needs to be signed
      Returns:
      True, if the signing service accepts to sign the URL; false otherwise.
    • sign

      public String sign(String baseUrl, Long validUntilDuration, Long validFromDuration, String ipAddr) throws UrlSigningException
      Description copied from interface: UrlSigningService
      Create a secure signature for a resource by adding the validUntilDuration to the current time and optionally adding the validFromDuration to the current time to create the available and expiry dates for the signature.
      Specified by:
      sign in interface UrlSigningService
      Parameters:
      baseUrl - The required url that refers to the resource.
      validUntilDuration - The required number of seconds from now that the resource will expire.
      validFromDuration - The number of seconds after now that the resource will become available; may be null (optional).
      ipAddr - The IP address of the client that is allowed to view the resource; may be null (optional).
      Returns:
      A query string signature for this resource.
      Throws:
      UrlSigningException - Thrown if unable to sign the resource.
    • sign

      public String sign(String baseUrl, org.joda.time.DateTime validUntil, org.joda.time.DateTime validFrom, String ipAddr) throws UrlSigningException
      Description copied from interface: UrlSigningService
      Create a secure signature for a resource using DateTime objects.
      Specified by:
      sign in interface UrlSigningService
      Parameters:
      baseUrl - The required url that refers to the resource.
      validUntil - The required date and time this signature will expire.
      validFrom - The date and time the resource will become available; may be null (optional).
      ipAddr - The IP address of the client that is allowed to view the resource; may be null (optional).
      Returns:
      A query string signature for this resource.
      Throws:
      UrlSigningException - Thrown if unable to sign the resource.