Package com.google.appengine.api.taskqueue

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


    return taskHandles;
  }

  private TaskOptions toTaskOptions(Task task) {
    final QueueSettings queueSettings = task.getQueueSettings();
    TaskOptions taskOptions = TaskOptions.Builder.withUrl(TaskHandler.HANDLE_TASK_URL);
    if (queueSettings.getOnBackend() != null) {
      taskOptions.header("Host", BackendServiceFactory.getBackendService().getBackendAddress(
          queueSettings.getOnBackend()));
    } else {

      String versionHostname = RetryHelper.runWithRetries(new Callable<String>() {
        @Override
        public String call() {
          ModulesService service = ModulesServiceFactory.getModulesService();
          String module = queueSettings.getOnModule();
          String version = queueSettings.getModuleVersion();
          if (module == null) {
            module = service.getCurrentModule();
            version = service.getCurrentVersion();
          }
          return service.getVersionHostname(module, version);
        }
      }, RetryParams.getDefaultInstance(), MODULES_EXCEPTION_HANDLER);
      taskOptions.header("Host", versionHostname);
    }

    Long delayInSeconds = queueSettings.getDelayInSeconds();
    if (null != delayInSeconds) {
      taskOptions.countdownMillis(delayInSeconds * 1000L);
      queueSettings.setDelayInSeconds(null);
    }
    addProperties(taskOptions, task.toProperties());
    String taskName = task.getName();
    if (null != taskName) {
      taskOptions.taskName(taskName);
    }
    return taskOptions;
  }
View Full Code Here


        logger.info("Scheduling price set update tasks");
        List<PriceSet> characterPriceSets = priceSetDao.getAll(new Key<User>(User.class, userID), character.getCharacterID());
        for (PriceSet priceSet : characterPriceSets) {
            logger.info("Scheduling price set update task for priceSetID: {}, userID: {}", priceSet.getId(), userID);
            Queue queue = appEngineServices.getQueue(queueName);
            TaskOptions taskOptions = withUrl(TASK_UPDATE_PRICE_SET).param("userID", String.valueOf(userID))
                    .param("priceSetID", String.valueOf(priceSet.getId()))
                    .param("characterID", String.valueOf(character.getCharacterID()))
                    .param("characterName", character.getName());
            if (character.getCorporationID() != null) {
                taskOptions.param("corporationID", String.valueOf(character.getCorporationID()))
                        .param("corporationName", character.getCorporationName())
                        .param("corporationTicker", character.getCorporationTicker());
            }
            if (character.getAllianceID() != null) {
                taskOptions.param("allianceID", String.valueOf(character.getAllianceID()))
                        .param("allianceName", character.getAllianceName());
            }
            queue.add(taskOptions);
        }
    }
View Full Code Here

        logger.info("Scheduling price set update for detach tasks");
        List<PriceSet> characterPriceSets = priceSetDao.getAll(new Key<User>(User.class, userID), character.getCharacterID());
        for (PriceSet priceSet : characterPriceSets) {
            logger.info("Scheduling price set update for detach task for priceSetID: {}, userID: {}", priceSet.getId(), userID);
            Queue queue = appEngineServices.getQueue(queueName);
            TaskOptions taskOptions = withUrl(TASK_UPDATE_PRICE_SET).param("userID", String.valueOf(userID))
                    .param("priceSetID", String.valueOf(priceSet.getId()))
                    .param("characterID", String.valueOf(character.getCharacterID()))
                    .param("characterName", character.getName());
            queue.add(taskOptions);
        }
View Full Code Here

        logger.info("Scheduling price set update for delete tasks");
        List<PriceSet> characterPriceSets = priceSetDao.getAll(new Key<User>(User.class, userID), characterID);
        for (PriceSet priceSet : characterPriceSets) {
            logger.info("Scheduling price set update for delete task for priceSetID: {}, userID: {}", priceSet.getId(), userID);
            Queue queue = appEngineServices.getQueue(queueName);
            TaskOptions taskOptions = withUrl(TASK_UPDATE_PRICE_SET).param("userID", String.valueOf(userID))
                    .param("priceSetID", String.valueOf(priceSet.getId()));
            queue.add(taskOptions);
        }
    }
View Full Code Here

    }

    public void launch(Long userID, Long blueprintTypeID, Long itemID, Integer meLevel, Integer peLevel, Long attachedCharacterID, String sharingLevel) {
        logger.info("Scheduling blueprint add task");
        Queue queue = appEngineServices.getQueue(queueName);
        TaskOptions taskOptions = withUrl(TASK_ADD_BLUEPRINT).param("userID", String.valueOf(userID))
                .param("blueprintTypeID", String.valueOf(blueprintTypeID))
                .param("meLevel", String.valueOf(meLevel))
                .param("peLevel", String.valueOf(peLevel))
                .param("sharingLevel", sharingLevel);
        if (itemID != null) {
            taskOptions.param("itemID", String.valueOf(itemID));
        }
        if (attachedCharacterID != null) {
            taskOptions.param("attachedCharacterID", String.valueOf(attachedCharacterID));
        }
        queue.add(taskOptions);
    }
View Full Code Here

    }

    public void launch(Long userID, String blueprintTypeName, Long itemID, Integer meLevel, Integer peLevel, Long attachedCharacterID, String sharingLevel) {
        logger.info("Scheduling blueprint add task");
        Queue queue = appEngineServices.getQueue(queueName);
        TaskOptions taskOptions = withUrl(TASK_ADD_BLUEPRINT).param("userID", String.valueOf(userID))
                .param("blueprintTypeName", String.valueOf(blueprintTypeName))
                .param("meLevel", String.valueOf(meLevel))
                .param("peLevel", String.valueOf(peLevel))
                .param("sharingLevel", sharingLevel);
        if (itemID != null) {
            taskOptions.param("itemID", String.valueOf(itemID));
        }
        if (attachedCharacterID != null) {
            taskOptions.param("attachedCharacterID", String.valueOf(attachedCharacterID));
        }
        queue.add(taskOptions);
    }
View Full Code Here

        logger.info("Scheduling blueprint update tasks");
        List<Blueprint> characterBlueprints = blueprintDao.getAll(new Key<User>(User.class, userID), character.getCharacterID());
        for (Blueprint blueprint : characterBlueprints) {
            logger.info("Scheduling blueprint update task for blueprintID: {}, userID: {}", blueprint.getId(), userID);
            Queue queue = appEngineServices.getQueue(queueName);
            TaskOptions taskOptions = withUrl(TASK_UPDATE_BLUEPRINT).param("userID", String.valueOf(userID))
                    .param("blueprintID", String.valueOf(blueprint.getId()))
                    .param("characterID", String.valueOf(character.getCharacterID()))
                    .param("characterName", character.getName());
            if (character.getCorporationID() != null) {
                taskOptions.param("corporationID", String.valueOf(character.getCorporationID()))
                        .param("corporationName", character.getCorporationName())
                        .param("corporationTicker", character.getCorporationTicker());
            }
            if (character.getAllianceID() != null) {
                taskOptions.param("allianceID", String.valueOf(character.getAllianceID()))
                        .param("allianceName", character.getAllianceName());
            }
            queue.add(taskOptions);
        }
    }
View Full Code Here

        logger.info("Scheduling blueprint update for detach tasks");
        List<Blueprint> characterBlueprints = blueprintDao.getAll(new Key<User>(User.class, userID), character.getCharacterID());
        for (Blueprint blueprint : characterBlueprints) {
            logger.info("Scheduling blueprint update for detach task for blueprintID: {}, userID: {}", blueprint.getId(), userID);
            Queue queue = appEngineServices.getQueue(queueName);
            TaskOptions taskOptions = withUrl(TASK_UPDATE_BLUEPRINT).param("userID", String.valueOf(userID))
                    .param("blueprintID", String.valueOf(blueprint.getId()))
                    .param("characterID", String.valueOf(character.getCharacterID()))
                    .param("characterName", character.getName());
            queue.add(taskOptions);
        }
View Full Code Here

        logger.info("Scheduling blueprint update for delete tasks");
        List<Blueprint> characterBlueprints = blueprintDao.getAll(new Key<User>(User.class, userID), characterID);
        for (Blueprint blueprint : characterBlueprints) {
            logger.info("Scheduling blueprint update for delete task for blueprintID: {}, userID: {}", blueprint.getId(), userID);
            Queue queue = appEngineServices.getQueue(queueName);
            TaskOptions taskOptions = withUrl(TASK_UPDATE_BLUEPRINT).param("userID", String.valueOf(userID))
                    .param("blueprintID", String.valueOf(blueprint.getId()));
            queue.add(taskOptions);
        }
    }
View Full Code Here

        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>");
View Full Code Here

TOP

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

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.