public interface

CustomService

com.pdftron.collab.service.CustomService
Known Indirect Subclasses

Class Overview

Interface for functions required to observe incoming and outgoing annotation changes. Default implementation is provided for merging incoming changes.

Summary

Public Methods
abstract void addAnnotation(CollabDatabase db, AnnotationEntity annotation)
From remote: add annotation Must run on background thread
abstract void addAnnotations(CollabDatabase db, HashMap<String, AnnotationEntity> annotations)
From remote: add annotations, commonly used for syncing initial annotations Must run on background thread
abstract void addDocument(CollabDatabase db, String documentId)
Set current document Must run on background thread
abstract void addDocument(CollabDatabase db, DocumentEntity entity)
Set current document Must run on background thread
abstract void addUser(CollabDatabase db, String userId, String userName)
Add a user Must run on background thread
abstract void cleanup(CollabDatabase db)
Cleanup all local cache Must run on background thread
abstract void deleteAnnotation(CollabDatabase db, AnnotationEntity annotation)
From remote: delete annotation Must run on background thread
abstract void deleteAnnotation(CollabDatabase db, String annotId)
From remote: delete annotation Must run on background thread
abstract void importAnnotationCommand(CollabDatabase db, String documentId, String xfdfCommand, boolean isInitialLoad)
Imports the XFDF command string to the document
abstract void importAnnotations(CollabDatabase db, String documentId, String xfdf, boolean isInitialLoad)
Imports the XFDF string to the document
abstract void modifyAnnotation(CollabDatabase db, AnnotationEntity annotation)
From remote: modify annotation Must run on background thread
abstract void sendAnnotation(String action, String xfdfCommand, ArrayList<AnnotationEntity> annotations, String documentId, String userName)
Send local change
abstract void setCurrentUser(CollabDatabase db, String userId, String userName)
Set the current user Must run on background thread

Public Methods

public abstract void addAnnotation (CollabDatabase db, AnnotationEntity annotation)

From remote: add annotation Must run on background thread

Parameters
db the CollabDatabase
annotation the AnnotationEntity

public abstract void addAnnotations (CollabDatabase db, HashMap<String, AnnotationEntity> annotations)

From remote: add annotations, commonly used for syncing initial annotations Must run on background thread

Parameters
db the CollabDatabase
annotations map of key=id, value=AnnotationEntity

public abstract void addDocument (CollabDatabase db, String documentId)

Set current document Must run on background thread

Parameters
db the CollabDatabase
documentId the unique identifier of the document

public abstract void addDocument (CollabDatabase db, DocumentEntity entity)

Set current document Must run on background thread

Parameters
db the CollabDatabase
entity the DocumentEntity

public abstract void addUser (CollabDatabase db, String userId, String userName)

Add a user Must run on background thread

Parameters
db the CollabDatabase
userId the unique identifier of the user
userName the name of the user

public abstract void cleanup (CollabDatabase db)

Cleanup all local cache Must run on background thread

public abstract void deleteAnnotation (CollabDatabase db, AnnotationEntity annotation)

From remote: delete annotation Must run on background thread

Parameters
db the CollabDatabase
annotation the AnnotationEntity

public abstract void deleteAnnotation (CollabDatabase db, String annotId)

From remote: delete annotation Must run on background thread

Parameters
db the CollabDatabase
annotId the unique identification of the annotation

public abstract void importAnnotationCommand (CollabDatabase db, String documentId, String xfdfCommand, boolean isInitialLoad)

Imports the XFDF command string to the document

Parameters
db the CollabDatabase
documentId the unique identification of the document
xfdfCommand the XFDF command string
isInitialLoad whether this is the initial load XFDF string

public abstract void importAnnotations (CollabDatabase db, String documentId, String xfdf, boolean isInitialLoad)

Imports the XFDF string to the document

Parameters
db the CollabDatabase
documentId the unique identification of the document
xfdf the XFDF string
isInitialLoad whether this is the initial load XFDF string

public abstract void modifyAnnotation (CollabDatabase db, AnnotationEntity annotation)

From remote: modify annotation Must run on background thread

Parameters
db the CollabDatabase
annotation the AnnotationEntity

public abstract void sendAnnotation (String action, String xfdfCommand, ArrayList<AnnotationEntity> annotations, String documentId, String userName)

Send local change

Parameters
action one of add/modify/delete
xfdfCommand the annotation XFDF command string
annotations the annotation XFDF information
documentId the document identifier
userName optional user name, user unique identifier should be part of the XFDF command instead

public abstract void setCurrentUser (CollabDatabase db, String userId, String userName)

Set the current user Must run on background thread

Parameters
db the CollabDatabase
userId the unique identifier of the user
userName the name of the user