Skip to content

Commit 5758458

Browse files
committed
Added java docs
1 parent ec54fd1 commit 5758458

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

opensrp-app/src/main/java/org/smartregister/repository/EventClientRepository.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -1471,11 +1471,15 @@ public void addEvent(String baseEntityId, JSONObject jsonObject, String syncStat
14711471
}
14721472
}
14731473

1474+
/**
1475+
* Flag an event as locally processed.
1476+
* This method only updates locally created and processed events and prevents reprocessing locally
1477+
* @param formSubmissionId
1478+
*/
14741479
public void markEventAsProcessed(String formSubmissionId) {
14751480
try {
14761481

14771482
ContentValues values = new ContentValues();
1478-
values.put(event_column.formSubmissionId.name(), formSubmissionId);
14791483
values.put(event_column.syncStatus.name(), BaseRepository.TYPE_Unsynced);
14801484
values.put(ROWID, getMaxRowId(Table.event) + 1);
14811485

@@ -1493,7 +1497,6 @@ public void markEventAsSynced(String formSubmissionId) {
14931497
try {
14941498

14951499
ContentValues values = new ContentValues();
1496-
values.put(event_column.formSubmissionId.name(), formSubmissionId);
14971500
values.put(event_column.syncStatus.name(), BaseRepository.TYPE_Synced);
14981501
values.put(ROWID, getMaxRowId(Table.event) + 1);
14991502

opensrp-app/src/main/java/org/smartregister/sync/ClientProcessorForJava.java

+5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public synchronized void processClient(List<EventClient> eventClientList) throws
7777
}
7878
}
7979

80+
/**
81+
* Call this method to flag the event as processed in the local repository.
82+
* All events valid or otherwise must be flagged to avoid re-processing
83+
* @param event
84+
*/
8085
public void completeProcessing(Event event) {
8186
if (event == null)
8287
return;

0 commit comments

Comments
 (0)