-
- All Implemented Interfaces:
-
org.readium.r2.shared.publication.services.ContentProtectionService.UserRights
public interface LcpLicense implements ContentProtectionService.UserRightsOpened license, used to decipher a protected publication and manage its license.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceLcpLicense.RenewListenerUX delegate for the loan renew LSD interaction.
If your application fits Material Design guidelines, take a look at MaterialRenewListener for a default implementation.
-
Method Summary
Modifier and Type Method Description abstract Try<Date, LcpException>renewLoan(LcpLicense.RenewListener listener, Boolean prefersWebPage)Renews the loan by starting a renew LSD interaction. Try<Unit, LcpException>renewLoan(DateTime end, SuspendFunction1<URL, Unit> urlPresenter)UnitrenewLoan(DateTime end, Function2<URL, Function0<Unit>, Unit> present, Function1<LcpException, Unit> completion)abstract Try<Unit, LcpException>returnPublication()Returns the publication to its provider. UnitreturnPublication(Function1<LcpException, Unit> completion)abstract Try<ByteArray, LcpException>decrypt(ByteArray data)Decrypts the given data encrypted with the license's content key. ByteArraydecipher(ByteArray data)abstract LicenseDocumentgetLicense()License Document information. abstract StatusDocumentgetStatus()License Status Document information. abstract IntegergetCharactersToCopyLeft()Number of remaining characters allowed to be copied by the user. abstract IntegergetPagesToPrintLeft()Number of pages allowed to be printed by the user. abstract BooleangetCanRenewLoan()Can the user renew the loaned publication? abstract DategetMaxRenewDate()The maximum potential date to renew to. abstract BooleangetCanReturnPublication()Can the user return the loaned publication? StringgetEncryptionProfile()-
Methods inherited from class org.readium.r2.shared.publication.services.ContentProtectionService.UserRights
canCopy, canPrint, copy, getCanCopy, getCanPrint, print -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
renewLoan
abstract Try<Date, LcpException> renewLoan(LcpLicense.RenewListener listener, Boolean prefersWebPage)
Renews the loan by starting a renew LSD interaction.
- Parameters:
prefersWebPage- Indicates whether the loan should be renewed through a web page if available, instead of programmatically.
-
renewLoan
@Deprecated(message = "Use `renewLoan` with `RenewListener` instead", replaceWith = @ReplaceWith(imports = {}, expression = "renewLoan(LcpLicense.RenewListener)"), level = DeprecationLevel.ERROR) Try<Unit, LcpException> renewLoan(DateTime end, SuspendFunction1<URL, Unit> urlPresenter)
-
renewLoan
@Deprecated(message = "Use `renewLoan` with `RenewListener` instead", replaceWith = @ReplaceWith(imports = {}, expression = "renewLoan(LcpLicense.RenewListener)"), level = DeprecationLevel.ERROR) Unit renewLoan(DateTime end, Function2<URL, Function0<Unit>, Unit> present, Function1<LcpException, Unit> completion)
-
returnPublication
abstract Try<Unit, LcpException> returnPublication()
Returns the publication to its provider.
-
returnPublication
@Deprecated(message = "Use `returnPublication()` with coroutines instead", replaceWith = @ReplaceWith(imports = {}, expression = "returnPublication"))@DelicateCoroutinesApi() Unit returnPublication(Function1<LcpException, Unit> completion)
-
decrypt
abstract Try<ByteArray, LcpException> decrypt(ByteArray data)
Decrypts the given data encrypted with the license's content key.
-
decipher
@Deprecated(message = "Use `decrypt()` with coroutines instead", replaceWith = @ReplaceWith(imports = {}, expression = "decrypt(data)")) ByteArray decipher(ByteArray data)
-
getLicense
abstract LicenseDocument getLicense()
License Document information. https://readium.org/lcp-specs/releases/lcp/latest.html
-
getStatus
abstract StatusDocument getStatus()
License Status Document information. https://readium.org/lcp-specs/releases/lsd/latest.html
-
getCharactersToCopyLeft
abstract Integer getCharactersToCopyLeft()
Number of remaining characters allowed to be copied by the user. If null, there's no limit.
-
getPagesToPrintLeft
abstract Integer getPagesToPrintLeft()
Number of pages allowed to be printed by the user. If null, there's no limit.
-
getCanRenewLoan
abstract Boolean getCanRenewLoan()
Can the user renew the loaned publication?
-
getMaxRenewDate
abstract Date getMaxRenewDate()
The maximum potential date to renew to. If null, then the renew date might not be customizable.
-
getCanReturnPublication
abstract Boolean getCanReturnPublication()
Can the user return the loaned publication?
-
getEncryptionProfile
String getEncryptionProfile()
-
-
-
-