Skip to content
This repository has been archived by the owner on Jun 12, 2019. It is now read-only.

Commit

Permalink
resubmission: expose the updated report ID
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Apr 15, 2019
1 parent 58e4ad1 commit 2b64086
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/io/ooni/mk/MKCollectorResubmitResults.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public class MKCollectorResubmitResults {

final static native String Content(long handle);

final static native String ReportID(long handle);

final static native String Logs(long handle);

final static native void Delete(long handle);
Expand All @@ -33,6 +35,11 @@ public String getUpdatedSerializedMeasurement() {
return Content(handle);
}

/** getUpdatedReportID returns the updated report ID. */
public String getUpdatedReportID() {
return ReportID(handle);
}

/** getLogs returns the logs as one-or-more newline-separated
* lines containing only UTF-8 characters. */
public String getLogs() {
Expand Down
4 changes: 4 additions & 0 deletions src/mkall/cpp/collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ MKALL_GET_STRING(MKCollectorResubmitResults_Content,
mk_collector_resubmit_response_content,
mk_collector_resubmit_response_t)

MKALL_GET_STRING(MKCollectorResubmitResults_ReportID,
mk_collector_resubmit_response_report_id,
mk_collector_resubmit_response_t)

MKALL_GET_LOGS(MKCollectorResubmitResults_Logs,
mk_collector_resubmit_response_logs_size,
mk_collector_resubmit_response_logs_at,
Expand Down
1 change: 1 addition & 0 deletions src/test/java/io/ooni/mk/MKCollectorResubmitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static void main(String[] args) {
MKCollectorResubmitResults results = settings.perform();
System.out.println("Good : " + results.isGood());
System.out.println("Measurement : " + results.getUpdatedSerializedMeasurement());
System.out.println("Report ID : " + results.getUpdatedReportID());
System.out.print(results.getLogs());
}
}

0 comments on commit 2b64086

Please sign in to comment.