@Override public final void createWorksheetTask( IForm form, MiscTasks miscTasks, long attemptCount, CallingContext cc) throws ODKFormNotFoundException, ODKDatastoreException { Map<String, String> params = miscTasks.getRequestParameters(); TaskOptionsBuilder b = new TaskOptionsBuilder(WorksheetServlet.ADDR); b.countdownMillis( Math.max( PersistConsts.MAX_SETTLE_MILLISECONDS, SpreadsheetConsts.WORKSHEET_CREATION_DELAY)); b.param(ServletConsts.FORM_ID, form.getFormId()); b.param( ExternalServiceConsts.EXT_SERV_ADDRESS, params.get(ExternalServiceConsts.EXT_SERV_ADDRESS)); b.param(ServletConsts.EXTERNAL_SERVICE_TYPE, params.get(ServletConsts.EXTERNAL_SERVICE_TYPE)); b.param(ServletConsts.MISC_TASKS_KEY, miscTasks.getSubmissionKey().toString()); b.param(ServletConsts.ATTEMPT_COUNT, Long.toString(attemptCount)); b.enqueue(); }
@Override public void createJsonFileTask( IForm form, SubmissionKey persistentResultsKey, long attemptCount, CallingContext cc) throws ODKDatastoreException { TaskOptionsBuilder b = new TaskOptionsBuilder(JsonGeneratorTaskServlet.ADDR); b.countdownMillis(PersistConsts.MAX_SETTLE_MILLISECONDS); b.param(ServletConsts.FORM_ID, form.getFormId()); b.param(ServletConsts.PERSISTENT_RESULTS_KEY, persistentResultsKey.toString()); b.param(ServletConsts.ATTEMPT_COUNT, Long.toString(attemptCount)); b.enqueue(); }