Android
android.content
public abstract class

android.content.AbstractTableMerger

java.lang.Object
android.content.AbstractTableMerger

Summary

Fields

protected      SQLiteDatabase  mDb   
protected      String  mDeletedTable   
protected      Uri  mDeletedTableURL   
protected  static    ContentValues  mSyncMarkValues   
protected      String  mTable   
protected      Uri  mTableURL   

Public Constructors

            AbstractTableMerger(SQLiteDatabase database, String table, Uri tableURL, String deletedTable, Uri deletedTableURL)

Public Methods

          void  deleteRow(Cursor localCursor)
This is called when it is determined that a row should be deleted from the ContentProvider.
abstract          void  insertRow(ContentProvider diffs, Cursor diffsCursor)
          void  merge(SyncContext context, String account, SyncableContentProvider serverDiffs, TempProviderSyncResult result, SyncResult syncResult, SyncableContentProvider temporaryInstanceFactory)
Carry out a merge of the given diffs, and add the results to the given MergeResult.
          void  onMergeCancelled()
abstract          void  resolveRow(long localPersonID, String syncID, ContentProvider diffs, Cursor diffsCursor)
abstract          void  updateRow(long localPersonID, ContentProvider diffs, Cursor diffsCursor)

Protected Methods

          void  cursorRowToContentValues(Cursor cursor, ContentValues map)
Converts cursor into a Map, using the correct types for the values.
abstract          void  notifyChanges()
After merge(SyncContext, String, SyncableContentProvider, TempProviderSyncResult, SyncResult, SyncableContentProvider) has completed, this method is called to send notifications to ContentObservers of changes to the containing ContentProvider.
Methods inherited from class java.lang.Object

Details

Fields

protected SQLiteDatabase mDb

protected String mDeletedTable

protected Uri mDeletedTableURL

protected static ContentValues mSyncMarkValues

protected String mTable

protected Uri mTableURL

Public Constructors

public AbstractTableMerger(SQLiteDatabase database, String table, Uri tableURL, String deletedTable, Uri deletedTableURL)

Public Methods

public void deleteRow(Cursor localCursor)

This is called when it is determined that a row should be deleted from the ContentProvider. The localCursor is on a table from the local ContentProvider and its current position is of the row that should be deleted. The localCursor contains the complete projection of the table.

It is the responsibility of the implementation of this method to ensure that the cursor points to the next row when this method returns, either by calling Cursor.deleteRow() or Cursor.next().

Parameters

localCursor The Cursor into the local table, which points to the row that is to be deleted.

public abstract void insertRow(ContentProvider diffs, Cursor diffsCursor)

public void merge(SyncContext context, String account, SyncableContentProvider serverDiffs, TempProviderSyncResult result, SyncResult syncResult, SyncableContentProvider temporaryInstanceFactory)

Carry out a merge of the given diffs, and add the results to the given MergeResult. If we are the first merge to find client-side diffs, we'll use the given ContentProvider to construct a temporary instance to hold them.

public void onMergeCancelled()

public abstract void resolveRow(long localPersonID, String syncID, ContentProvider diffs, Cursor diffsCursor)

public abstract void updateRow(long localPersonID, ContentProvider diffs, Cursor diffsCursor)

Protected Methods

protected void cursorRowToContentValues(Cursor cursor, ContentValues map)

Converts cursor into a Map, using the correct types for the values.

protected abstract void notifyChanges()

After merge(SyncContext, String, SyncableContentProvider, TempProviderSyncResult, SyncResult, SyncableContentProvider) has completed, this method is called to send notifications to ContentObservers of changes to the containing ContentProvider. These notifications likely do not want to request a sync back to the network.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56