Class SimpleInstantDocumentListener
-
- All Implemented Interfaces:
-
com.pspdfkit.instant.listeners.InstantDocumentListener
public class SimpleInstantDocumentListener implements InstantDocumentListener
Empty implementation of InstantDocumentListener.
-
-
Constructor Summary
Constructors Constructor Description SimpleInstantDocumentListener()
-
Method Summary
Modifier and Type Method Description void
onAuthenticationFailed(@NonNull() InstantPdfDocument instantDocument, @NonNull() InstantException error)
Called when authentication with Instant Server (PSPDFKit Document Engine) has failed. void
onAuthenticationFinished(@NonNull() InstantPdfDocument instantDocument, @NonNull() String validJwt)
Called when authentication with Instant Server (PSPDFKit Document Engine) has successfully finished. void
onSyncStarted(@NonNull() InstantPdfDocument instantDocument)
Called when annotation sync has been started. void
onSyncError(@NonNull() InstantPdfDocument instantDocument, @NonNull() InstantException error)
Called when annotation sync has been finished with an error. void
onSyncFinished(@NonNull() InstantPdfDocument instantDocument)
Called when annotation sync has been finished successfully. void
onDocumentStateChanged(@NonNull() InstantPdfDocument instantDocument, @NonNull() InstantDocumentState state)
Called when the document changes its state. void
onDocumentCorrupted(@NonNull() InstantPdfDocument instantDocument)
Called when InstantPdfDocument has detected data corruption. void
onDocumentInvalidated(@NonNull() InstantPdfDocument instantPdfDocument)
Called when InstantPdfDocument becomes invalid. -
-
Method Detail
-
onAuthenticationFailed
void onAuthenticationFailed(@NonNull() InstantPdfDocument instantDocument, @NonNull() InstantException error)
Called when authentication with Instant Server (PSPDFKit Document Engine) has failed.
- Parameters:
instantDocument
- Document that we were authenticating for.error
- Authentication error.
-
onAuthenticationFinished
void onAuthenticationFinished(@NonNull() InstantPdfDocument instantDocument, @NonNull() String validJwt)
Called when authentication with Instant Server (PSPDFKit Document Engine) has successfully finished.
- Parameters:
instantDocument
- Document that we were authenticating for.validJwt
- JWT that was used for this authentication request.
-
onSyncStarted
void onSyncStarted(@NonNull() InstantPdfDocument instantDocument)
Called when annotation sync has been started.
- Parameters:
instantDocument
- Document that is syncing the annotations.
-
onSyncError
void onSyncError(@NonNull() InstantPdfDocument instantDocument, @NonNull() InstantException error)
Called when annotation sync has been finished with an error.
The most likely reason is network failure REQUEST_FAILED. Other common reasons are expiration of your authentication token AUTHENTICATION_FAILED, and cancellation USER_CANCELLED.
- Parameters:
instantDocument
- Document that was syncing the annotations.error
- Error thrown while syncing annotations.
-
onSyncFinished
void onSyncFinished(@NonNull() InstantPdfDocument instantDocument)
Called when annotation sync has been finished successfully.
- Parameters:
instantDocument
- Document that was syncing the annotations.
-
onDocumentStateChanged
void onDocumentStateChanged(@NonNull() InstantPdfDocument instantDocument, @NonNull() InstantDocumentState state)
Called when the document changes its state.
Note: After onSyncStarted, this method may be called multiple times during the sync process.
- Parameters:
instantDocument
- Document which state has changed.state
- New document state.
-
onDocumentCorrupted
void onDocumentCorrupted(@NonNull() InstantPdfDocument instantDocument)
Called when InstantPdfDocument has detected data corruption.
Receiving this callback means any further interaction with the sender’s document are destined to fail. You can copy the document package aside for forensic purposes, but you will — eventually — have to purge its storage, and download it anew.
Because this situation means the document has become unusable, it will invalidate itself immediately after this method returns.
- Parameters:
instantDocument
- Document that has detected data corruption.
-
onDocumentInvalidated
void onDocumentInvalidated(@NonNull() InstantPdfDocument instantPdfDocument)
Called when InstantPdfDocument becomes invalid. Any future instant operations on this document will fail.
-
-
-
-