Interface UrlSigningService
- All Known Implementing Classes:
UrlSigningServiceImpl
public interface UrlSigningService
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the signing service accepts to sign thebaseUrl.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.
-
Method Details
-
accepts
Returns true if the signing service accepts to sign thebaseUrl.- 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
String sign(String baseUrl, Long validUntilDuration, Long validFromDuration, String ipAddr) throws UrlSigningException 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.- 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 benull(optional).ipAddr- The IP address of the client that is allowed to view the resource; may benull(optional).- Returns:
- A query string signature for this resource.
- Throws:
UrlSigningException- Thrown if unable to sign the resource.
-
sign
String sign(String baseUrl, org.joda.time.DateTime validUntil, org.joda.time.DateTime validFrom, String ipAddr) throws UrlSigningException Create a secure signature for a resource using DateTime objects.- 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 benull(optional).ipAddr- The IP address of the client that is allowed to view the resource; may benull(optional).- Returns:
- A query string signature for this resource.
- Throws:
UrlSigningException- Thrown if unable to sign the resource.
-