Android Open Source - couchdbsyncer-android Download Policy






From Project

Back to project page couchdbsyncer-android.

License

The source code is released under:

Apache License

If you think the Android project couchdbsyncer-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package au.com.team2moro.couchdbsyncer;
//from  w  ww . ja  v  a  2s. c o  m
public interface DownloadPolicy {

  /**
   * Return the download policy for the given attachment. The default policy is to download all attachments.
   * @param document the document containing the attachment to be downloaded
   * @param attachment the attachment to be downloaded
   * @return true to download the attachment, false otherwise.  If false, metadata for the attachment is still saved and available locally, but the content is not downloaded from the server.
   */
  public boolean getAttachmentDownload(Document document, Attachment attachment);

  /**
   * Return the download policy for the given document. The default policy is to download all documents except design documents.
   * @param document the document to be downloaded
   * @return true to download the document, false otherwise.  If false, no data is stored locally for this document.
   */
  public boolean getDocumentDownload(Document document);
  
  /**
   * Return the download thread priority for the given attachment
   * @param document the document containing the attachment to be downloaded
   * @param attachment the attachment to be downloaded
   * @return an integer between Thread.MIN_PRIORITY and Thread.MAX_PRIORITY
   */
  public int getAttachmentPriority(Document document, Attachment attachment);

  /**
   * Return the download thread priority for the given document
   * @param document the document to be downloaded
   * @return an integer between Thread.MIN_PRIORITY and Thread.MAX_PRIORITY
   */
  public int getDocumentPriority(Document document);

  // TODO: some interface so that shipped databases can be installed.
  //public String defaultStoreDatabasePath();
}




Java Source Code List

au.com.team2moro.couchdbsyncer.Attachment.java
au.com.team2moro.couchdbsyncer.BulkFetcher.java
au.com.team2moro.couchdbsyncer.ConnectionSettingsTrustAll.java
au.com.team2moro.couchdbsyncer.ConnectionSettings.java
au.com.team2moro.couchdbsyncer.DatabaseStore.java
au.com.team2moro.couchdbsyncer.Database.java
au.com.team2moro.couchdbsyncer.Document.java
au.com.team2moro.couchdbsyncer.DownloadPolicy.java
au.com.team2moro.couchdbsyncer.Fetcher.java
au.com.team2moro.couchdbsyncer.SequencedDocument.java
au.com.team2moro.couchdbsyncer.SyncerService.java
au.com.team2moro.couchdbsyncer.Syncer.java
au.com.team2moro.couchdbsyncer.package-info.java