Package com.google.appengine.api.taskqueue

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


        if (globalTransactionKey == null) {
            throw new NullPointerException(
                "The globalTransactionKey parameter must not be null.");
        }
        String encodedKey = KeyFactory.keyToString(globalTransactionKey);
        Queue queue = QueueFactory.getQueue(QUEUE_NAME);
        queue.add(tx, TaskOptions.Builder.withUrl(
            GlobalTransactionServlet.SERVLET_PATH).param(
            GlobalTransactionServlet.COMMAND_NAME,
            GlobalTransactionServlet.ROLLFORWARD_COMMAND).param(
            GlobalTransactionServlet.KEY_NAME,
            encodedKey).countdownMillis(countdownMillis));
View Full Code Here


        if (globalTransactionKey == null) {
            throw new NullPointerException(
                "The globalTransactionKey parameter must not be null.");
        }
        String encodedKey = KeyFactory.keyToString(globalTransactionKey);
        Queue queue = QueueFactory.getQueue(QUEUE_NAME);
        queue.add(null, TaskOptions.Builder.withUrl(
            GlobalTransactionServlet.SERVLET_PATH).param(
            GlobalTransactionServlet.COMMAND_NAME,
            GlobalTransactionServlet.ROLLBACK_COMMAND).param(
            GlobalTransactionServlet.KEY_NAME,
            encodedKey));
View Full Code Here

                      HttpServletResponse resp)
        throws IOException {
        resp.setContentType("text/html");
        PrintWriter out = resp.getWriter();

        Queue queue = QueueFactory.getDefaultQueue();
        queue.add();
        queue.add();
        queue.add();
        out.println("<p>Enqueued 3 tasks to the default queue.</p>");

        TaskOptions taskOptions =
            TaskOptions.Builder.withUrl("/send_invitation_task")
            .param("address", "juliet@example.com")
            .param("firstname", "Juliet");
        queue.add(taskOptions);
        out.println("<p>Enqueued 1 task to the default queue with parameters.</p>");

        SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSSSSS");
        fmt.setTimeZone(new SimpleTimeZone(0, ""));
        out.println("<p>The time is: " + fmt.format(new Date()) + "</p>");
View Full Code Here

        // would necessitate a retry here. Right now we won't retry if we get null back.
        if (uploadUrl != null) {
          photoEntry.setResumableUploadUrl(uploadUrl);
          photoSubmissionDao.save(photoEntry);

          Queue queue = QueueFactory.getDefaultQueue();
          String namespace = NamespaceManager.get();
          if (namespace == null) {
            namespace = "";
          }
          queue.add(withUrl("/tasks/PicasaUpload").method(Method.POST)
            .param("id", photoEntry.getId()).param("ns", namespace)
            .countdownMillis(TASK_DELAY));
        }
      }
    } catch (IllegalArgumentException e) {
View Full Code Here

        notification.owner = receiver;
        notification.type = Notification.NotificationType.INBOX;
        notification.insert();
       
        // Creating a task for send an email with the notification.
        Queue queue = QueueFactory.getDefaultQueue();
        String residenceDomain = null;
        String username = Session.current().get(SessionConstants.USER);
        if(username.contains("@")){
          residenceDomain = username.substring(username.indexOf("@")+1);
        } else {
          residenceDomain = "";
        }
       
          queue.add(withUrl("/task/notificate/mail").method(Method.POST).
              param("fromId", String.valueOf(from.id)).
              param("dstId", String.valueOf(receiver.id)).
              param("msgContent", message.text).
              param("numberAttach", String.valueOf(sharedContents.size())).
              param("residenceDomain", residenceDomain));
View Full Code Here

public class NewAccess implements ITaskAccess{

  private final static String CONN_URL = "/appwrench/queuehandler";
 
  public void addTaskToQueue(Map<String, String> params){
    Queue tq = QueueFactory.getQueue("onPositiveQueue");
    TaskOptions to = TaskOptions.Builder.withUrl(CONN_URL);
    for (String k : params.keySet()) {
      String val = params.get(k);
      to = to.param(k, val);
    }
    to = to.method(Method.POST);
    // to = to.taskName("task" + INIT + "count" + (-1));
    tq.add(to);
  }
View Full Code Here

        if (globalTransactionKey == null) {
            throw new NullPointerException(
                "The globalTransactionKey parameter must not be null.");
        }
        String encodedKey = KeyFactory.keyToString(globalTransactionKey);
        Queue queue = QueueFactory.getQueue(QUEUE_NAME);
        queue.add(tx, TaskOptions.Builder.withUrl(
            GlobalTransactionServlet.SERVLET_PATH).param(
            GlobalTransactionServlet.COMMAND_NAME,
            GlobalTransactionServlet.ROLLFORWARD_COMMAND).param(
            GlobalTransactionServlet.KEY_NAME,
            encodedKey).countdownMillis(countdownMillis));
View Full Code Here

        if (globalTransactionKey == null) {
            throw new NullPointerException(
                "The globalTransactionKey parameter must not be null.");
        }
        String encodedKey = KeyFactory.keyToString(globalTransactionKey);
        Queue queue = QueueFactory.getQueue(QUEUE_NAME);
        queue.add(null, TaskOptions.Builder.withUrl(
            GlobalTransactionServlet.SERVLET_PATH).param(
            GlobalTransactionServlet.COMMAND_NAME,
            GlobalTransactionServlet.ROLLBACK_COMMAND).param(
            GlobalTransactionServlet.KEY_NAME,
            encodedKey));
View Full Code Here

     * @throws Exception
     *
     */
    @Test
    public void taskQueueForDefaultQueue() throws Exception {
        Queue queue = QueueFactory.getDefaultQueue();
        queue
            .add(TaskOptions.Builder.withUrl("/tqHandler").param("key", "aaa"));
        assertThat(tester.tasks.size(), is(1));
        TaskQueueAddRequest task = tester.tasks.get(0);
        assertThat(task.getUrl(), is("/tqHandler"));
        assertThat(task.getBody(), is("key=aaa"));
View Full Code Here

     * @throws Exception
     *
     */
    @Test
    public void taskQueueForNamedQueue() throws Exception {
        Queue queue = QueueFactory.getQueue("test-queue");
        queue
            .add(TaskOptions.Builder.withUrl("/tqHandler").param("key", "aaa"));
        assertThat(tester.tasks.size(), is(1));
        TaskQueueAddRequest task = tester.tasks.get(0);
        assertThat(task.getUrl(), is("/tqHandler"));
        assertThat(task.getBody(), is("key=aaa"));
View Full Code Here

TOP

Related Classes of com.google.appengine.api.taskqueue.Queue

Copyright © 2018 www.massapicom. 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.