Examples of TaskOptions


Examples of com.google.appengine.api.labs.taskqueue.TaskOptions

     *            ignored.
     * @return a newly created {@link TaskOptions} instance containing data from
     *         <code>exchange</code>.
     */
    public TaskOptions writeRequest(GTaskEndpoint endpoint, Exchange exchange, TaskOptions request) {
        TaskOptions answer = TaskOptions.Builder.url(getWorkerRoot(endpoint) + endpoint.getPath());
        writeRequestHeaders(endpoint, exchange, answer);
        writeRequestBody(endpoint, exchange, answer);
        // TODO: consider TaskOptions method (POST, GET, ...)
        return answer;
    }
View Full Code Here

Examples of com.google.appengine.api.labs.taskqueue.TaskOptions

        }
    }

  @Override
  public void generateReport(String address) {
    TaskOptions task = method(Method.GET).param("to", address);//(8)
    QueueFactory.getDefaultQueue().add(task); //(9)
  }
View Full Code Here

Examples of com.google.appengine.api.taskqueue.TaskOptions

    // find default queue
    Queue q = QueueFactory.getDefaultQueue();

    //build task options
    TaskOptions options = withUrl(ins.getUrl()).method(Method.GET);

    // add parameters to task
    for (String name : ins.getParams().keySet()) {
      String value = ins.getParams().get(name);
      options = options.param(name, value);
    }

    //actually add to GAE Queue
    q.add(options);
View Full Code Here

Examples of com.google.appengine.api.taskqueue.TaskOptions

  public static void enqueueTask(String baseUrl, BuiltinDatastoreExportConfiguration exporterConfig, long timestamp) {
    enqueueTask(baseUrl, exporterConfig, timestamp, 0);
 
 
  private static void enqueueTask(String baseUrl, BuiltinDatastoreExportConfiguration exporterConfig, long timestamp, long countdownMillis) {
    TaskOptions t = TaskOptions.Builder.withUrl(baseUrl + BUILTIN_DATASTORE_TO_BIGQUERY_INGESTOR_TASK_PATH);
    t.param(AnalysisConstants.TIMESTAMP_PARAM, Long.toString(timestamp));
    t.param(AnalysisConstants.BUILTIN_DATASTORE_EXPORT_CONFIG, exporterConfig.getClass().getName());
   
    t.method(Method.GET);
    if (countdownMillis > 0) {
      t.countdownMillis(countdownMillis);
    }
    Queue queue;
    if (!AnalysisUtility.areParametersValid(exporterConfig.getQueueName())) {
      queue = QueueFactory.getDefaultQueue();
    }
View Full Code Here

Examples of com.google.appengine.api.taskqueue.TaskOptions

    }
   
    String backupName = AnalysisUtility.getPreBackupName(timestamp, exporterConfig.getBackupNamePrefix());
   
    // start the backup task
    TaskOptions t = createBackupTaskOptions(backupName, exporterConfig.getEntityKindsToExport(), bucketName, queue.getQueueName());       
    queue.add(t);
   
    // start another task to do the actual import into bigquery
    if (!exporterConfig.shouldSkipExportToBigquery()) {
      BuiltinDatastoreToBigqueryIngesterTask.enqueueTask(AnalysisUtility.getRequestBaseName(req), exporterConfig, timestamp);
View Full Code Here

Examples of com.google.appengine.api.taskqueue.TaskOptions

           
    resp.getWriter().println(AnalysisUtility.successJson("successfully kicked off backup job: " + backupName + ", export to bigquery will begin once backup is complete."));
  }
 
  private TaskOptions createBackupTaskOptions(String backupName, List<String> kindsToExport, String bucketName, String queueName) {
    TaskOptions t = TaskOptions.Builder.withUrl("/_ah/datastore_admin/backup.create");
    t.param("name", backupName);
    for (String kind : kindsToExport) {
      t.param("kind", kind);
    }
    t.param("filesystem", "gs");
    t.param("gs_bucket_name", bucketName);
    t.param("run_as_a_service", Boolean.TRUE.toString());
   
    t.param("queue", queueName);
   
    t.method(Method.GET);
    t.header("Host", BackendServiceFactory.getBackendService().getBackendAddress(AH_BUILTIN_PYTHON_BUNDLE));
   
    return t;
  }
View Full Code Here

Examples of com.google.appengine.api.taskqueue.TaskOptions

        queue = QueueFactory.getDefaultQueue();
      }
      else {
        queue = QueueFactory.getQueue(config.getQueueName());
      }
      TaskOptions t = TaskOptions.Builder.withUrl(TASK_URL);
     
      t.param(AnalysisConstants.LOGS_EXPORTER_CONFIGURATION_PARAM, logsExporterConfigurationClassName);
      t.param(AnalysisConstants.LOG_RANGE_START_MS, Long.toString(logRangeStartMs));
      t.param(AnalysisConstants.LOG_RANGE_END_MS, Long.toString(logRangeEndMs));
      t.etaMillis(logRangeEndMs + AnalysisConstants.MILLIS_TO_DELAY_TASKS_BEFORE_RUNNING);
      t.method(Method.GET);
     
      String name = LogExportDirectToBigqueryTask.class.getSimpleName() + "_" + Long.toString(logRangeStartMs) + "_" + Long.toString(logRangeEndMs);
      log.warning("exportTaskName: " + name);
     
      t.taskName(name);
     
      try {
        queue.addAsync(t);
      }
      catch (TaskAlreadyExistsException te) {
View Full Code Here

Examples of com.google.appengine.api.taskqueue.TaskOptions

          int partialSize = partialDevices.size();
          if (partialSize == Datastore.MULTICAST_SIZE || counter == total) {
            String multicastKey = Datastore.createMulticast(partialDevices);
            logger.fine("Queuing " + partialSize + " devices on multicast " +
                multicastKey);
            TaskOptions taskOptions = TaskOptions.Builder
                .withUrl("/send")
                .param(SendMessageServlet.PARAMETER_MULTICAST, multicastKey)
                .method(Method.POST);
            queue.add(taskOptions);
            partialDevices.clear();
View Full Code Here

Examples of com.google.appengine.api.taskqueue.TaskOptions

              || counter == total) {
            String multicastKey = Datastore
                .createMulticast(partialDevices);
            logger.fine("Queuing " + partialSize
                + " devices on multicast " + multicastKey);
            TaskOptions taskOptions = TaskOptions.Builder
                .withUrl("/send")
                .param(SendMessageServlet.PARAMETER_MULTICAST,
                    multicastKey).method(Method.POST);
            queue.add(taskOptions);
            partialDevices.clear();
View Full Code Here

Examples of com.google.appengine.api.taskqueue.TaskOptions

    Queue queue = QueueFactory.getDefaultQueue();
   
    for(String id: ids) {
      if(taskNameDAO.getTaskName(id) == null) {
        String name = id+"-"+date.getTime();
        TaskOptions taskOpt = TaskOptions.Builder.withUrl("/automatedupdate");
        taskOpt.param("mensa", id);
        taskOpt.method(Method.GET);
        taskOpt.taskName(name);
        queue.add(taskOpt);
        TaskName taskName = new TaskName();
        taskName.setIdentifier(id);
        taskName.setTaskName(name);
        taskNameDAO.saveTaskName(taskName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.