diff --git a/appengine/pom.xml b/appengine/pom.xml index 68f64300a6a..667fc4c3242 100644 --- a/appengine/pom.xml +++ b/appengine/pom.xml @@ -82,8 +82,7 @@ sockets static-files - - taskqueue-push + taskqueue twilio urlfetch users diff --git a/taskqueue/deferred/README.md b/appengine/taskqueue/defer-samples/README.md similarity index 100% rename from taskqueue/deferred/README.md rename to appengine/taskqueue/defer-samples/README.md diff --git a/taskqueue/deferred/pom.xml b/appengine/taskqueue/defer-samples/pom.xml similarity index 97% rename from taskqueue/deferred/pom.xml rename to appengine/taskqueue/defer-samples/pom.xml index eff7bca920e..3cdf0801626 100644 --- a/taskqueue/deferred/pom.xml +++ b/appengine/taskqueue/defer-samples/pom.xml @@ -22,7 +22,7 @@ - doc-samples + appengine-doc-samples com.google.cloud 1.0.0 ../.. @@ -31,7 +31,7 @@ 1.7 1.7 - 1.9.59 + 1.9.59 2.5 3.2.0 diff --git a/taskqueue/deferred/src/main/java/com/google/cloud/taskqueue/samples/DeferSampleServlet.java b/appengine/taskqueue/defer-samples/src/main/java/com/google/cloud/taskqueue/samples/DeferSampleServlet.java similarity index 100% rename from taskqueue/deferred/src/main/java/com/google/cloud/taskqueue/samples/DeferSampleServlet.java rename to appengine/taskqueue/defer-samples/src/main/java/com/google/cloud/taskqueue/samples/DeferSampleServlet.java diff --git a/taskqueue/deferred/src/main/webapp/WEB-INF/appengine-web.xml b/appengine/taskqueue/defer-samples/src/main/webapp/WEB-INF/appengine-web.xml similarity index 100% rename from taskqueue/deferred/src/main/webapp/WEB-INF/appengine-web.xml rename to appengine/taskqueue/defer-samples/src/main/webapp/WEB-INF/appengine-web.xml diff --git a/taskqueue/deferred/src/main/webapp/WEB-INF/logging.properties b/appengine/taskqueue/defer-samples/src/main/webapp/WEB-INF/logging.properties similarity index 100% rename from taskqueue/deferred/src/main/webapp/WEB-INF/logging.properties rename to appengine/taskqueue/defer-samples/src/main/webapp/WEB-INF/logging.properties diff --git a/taskqueue/deferred/src/main/webapp/WEB-INF/web.xml b/appengine/taskqueue/defer-samples/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from taskqueue/deferred/src/main/webapp/WEB-INF/web.xml rename to appengine/taskqueue/defer-samples/src/main/webapp/WEB-INF/web.xml diff --git a/taskqueue/deferred/src/main/webapp/guestbook.jsp b/appengine/taskqueue/defer-samples/src/main/webapp/guestbook.jsp similarity index 100% rename from taskqueue/deferred/src/main/webapp/guestbook.jsp rename to appengine/taskqueue/defer-samples/src/main/webapp/guestbook.jsp diff --git a/appengine/taskqueue/pom.xml b/appengine/taskqueue/pom.xml new file mode 100644 index 00000000000..9b9512d3b2e --- /dev/null +++ b/appengine/taskqueue/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + 1.0.0 + + com.google.cloud + taskqueue-doc-samples + pom + + + + appengine-doc-samples + com.google.cloud + 1.0.0 + .. + + + + push-samples + pull-samples + defer-samples + + + diff --git a/appengine/taskqueue/pull/README.md b/appengine/taskqueue/pull-samples/README.md similarity index 100% rename from appengine/taskqueue/pull/README.md rename to appengine/taskqueue/pull-samples/README.md diff --git a/appengine/taskqueue/pull/pom.xml b/appengine/taskqueue/pull-samples/pom.xml similarity index 95% rename from appengine/taskqueue/pull/pom.xml rename to appengine/taskqueue/pull-samples/pom.xml index 162ffb2b03c..e5ec216253d 100644 --- a/appengine/taskqueue/pull/pom.xml +++ b/appengine/taskqueue/pull-samples/pom.xml @@ -23,11 +23,12 @@ Copyright 2016 Google Inc. taskqueue - appengine-doc-samples - com.google.cloud - 1.0.0 - ../.. + appengine-doc-samples + com.google.cloud + 1.0.0 + ../.. + diff --git a/appengine/taskqueue/pull/src/main/java/com/example/taskqueue/TaskqueueServlet.java b/appengine/taskqueue/pull-samples/src/main/java/com/example/taskqueue/TaskqueueServlet.java similarity index 100% rename from appengine/taskqueue/pull/src/main/java/com/example/taskqueue/TaskqueueServlet.java rename to appengine/taskqueue/pull-samples/src/main/java/com/example/taskqueue/TaskqueueServlet.java diff --git a/appengine/taskqueue/pull/src/main/webapp/WEB-INF/appengine-web.xml b/appengine/taskqueue/pull-samples/src/main/webapp/WEB-INF/appengine-web.xml similarity index 100% rename from appengine/taskqueue/pull/src/main/webapp/WEB-INF/appengine-web.xml rename to appengine/taskqueue/pull-samples/src/main/webapp/WEB-INF/appengine-web.xml diff --git a/appengine/taskqueue/pull/src/main/webapp/WEB-INF/logging.properties b/appengine/taskqueue/pull-samples/src/main/webapp/WEB-INF/logging.properties similarity index 100% rename from appengine/taskqueue/pull/src/main/webapp/WEB-INF/logging.properties rename to appengine/taskqueue/pull-samples/src/main/webapp/WEB-INF/logging.properties diff --git a/appengine/taskqueue/pull/src/main/webapp/WEB-INF/queue.xml b/appengine/taskqueue/pull-samples/src/main/webapp/WEB-INF/queue.xml similarity index 100% rename from appengine/taskqueue/pull/src/main/webapp/WEB-INF/queue.xml rename to appengine/taskqueue/pull-samples/src/main/webapp/WEB-INF/queue.xml diff --git a/appengine/taskqueue/pull/src/main/webapp/WEB-INF/web.xml b/appengine/taskqueue/pull-samples/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from appengine/taskqueue/pull/src/main/webapp/WEB-INF/web.xml rename to appengine/taskqueue/pull-samples/src/main/webapp/WEB-INF/web.xml diff --git a/appengine/taskqueue/pull/src/main/webapp/tasks.jsp b/appengine/taskqueue/pull-samples/src/main/webapp/tasks.jsp similarity index 100% rename from appengine/taskqueue/pull/src/main/webapp/tasks.jsp rename to appengine/taskqueue/pull-samples/src/main/webapp/tasks.jsp diff --git a/appengine/taskqueue-push/README.md b/appengine/taskqueue/push-samples/README.md similarity index 100% rename from appengine/taskqueue-push/README.md rename to appengine/taskqueue/push-samples/README.md diff --git a/appengine/taskqueue-push/pom.xml b/appengine/taskqueue/push-samples/pom.xml similarity index 98% rename from appengine/taskqueue-push/pom.xml rename to appengine/taskqueue/push-samples/pom.xml index 0a28b20f3cb..43a3da4366c 100644 --- a/appengine/taskqueue-push/pom.xml +++ b/appengine/taskqueue/push-samples/pom.xml @@ -22,11 +22,12 @@ Copyright 2016 Google Inc. taskqueue-push - com.google.cloud appengine-doc-samples + com.google.cloud 1.0.0 - .. + ../.. + javax.servlet diff --git a/appengine/taskqueue-push/src/main/java/com/example/appengine/taskqueue/push/Enqueue.java b/appengine/taskqueue/push-samples/src/main/java/com/example/appengine/taskqueue/push/Enqueue.java similarity index 100% rename from appengine/taskqueue-push/src/main/java/com/example/appengine/taskqueue/push/Enqueue.java rename to appengine/taskqueue/push-samples/src/main/java/com/example/appengine/taskqueue/push/Enqueue.java diff --git a/appengine/taskqueue-push/src/main/java/com/example/appengine/taskqueue/push/Worker.java b/appengine/taskqueue/push-samples/src/main/java/com/example/appengine/taskqueue/push/Worker.java similarity index 100% rename from appengine/taskqueue-push/src/main/java/com/example/appengine/taskqueue/push/Worker.java rename to appengine/taskqueue/push-samples/src/main/java/com/example/appengine/taskqueue/push/Worker.java diff --git a/appengine/taskqueue-push/src/main/webapp/WEB-INF/appengine-web.xml b/appengine/taskqueue/push-samples/src/main/webapp/WEB-INF/appengine-web.xml similarity index 100% rename from appengine/taskqueue-push/src/main/webapp/WEB-INF/appengine-web.xml rename to appengine/taskqueue/push-samples/src/main/webapp/WEB-INF/appengine-web.xml diff --git a/appengine/taskqueue-push/src/main/webapp/WEB-INF/web.xml b/appengine/taskqueue/push-samples/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from appengine/taskqueue-push/src/main/webapp/WEB-INF/web.xml rename to appengine/taskqueue/push-samples/src/main/webapp/WEB-INF/web.xml diff --git a/appengine/taskqueue-push/src/main/webapp/index.html b/appengine/taskqueue/push-samples/src/main/webapp/index.html similarity index 100% rename from appengine/taskqueue-push/src/main/webapp/index.html rename to appengine/taskqueue/push-samples/src/main/webapp/index.html diff --git a/appengine/taskqueue-push/src/test/java/com/example/appengine/taskqueue/push/WorkerTest.java b/appengine/taskqueue/push-samples/src/test/java/com/example/appengine/taskqueue/push/WorkerTest.java similarity index 100% rename from appengine/taskqueue-push/src/test/java/com/example/appengine/taskqueue/push/WorkerTest.java rename to appengine/taskqueue/push-samples/src/test/java/com/example/appengine/taskqueue/push/WorkerTest.java diff --git a/pom.xml b/pom.xml index 8957fedce88..881222883dc 100644 --- a/pom.xml +++ b/pom.xml @@ -84,8 +84,6 @@ storage/xml-api/cmdline-sample storage/xml-api/serviceaccount-appengine-sample - taskqueue/deferred - translate translate/cloud-client diff --git a/taskqueue/README.md b/taskqueue/README.md deleted file mode 100644 index a8cda57b7a3..00000000000 --- a/taskqueue/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Task Queue Java Snippets - -These are Java samples for using the [Task Queue](https://cloud.google.com/appengine/docs/java/taskqueue/) - - diff --git a/taskqueue/pull/README.md b/taskqueue/pull/README.md deleted file mode 100644 index ce77b24924e..00000000000 --- a/taskqueue/pull/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# Pull Task Queue REST API sample -This sample command line application demonstrates how to access App Engine pull task queues using the Task -Queue REST API and the Google Java API Client Library. - -Important Note: This sample requires an existing App Engine Pull Task Queue. -Deploy this -[sample App Engine pull task queue app](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine/taskqueue/pull) -to create one first and then come back and run this sample. - -## Setup Instructions -1. Create or select a project in the Google Cloud Console: - 1. Visit the [Cloud Console][2] - 1. If this is your first time then click "Create Project," otherwise you can -reuse an existing project by clicking on it. - 1. Note: You will need to enable billing for the project to use Compute - Engine. - -1. Authentication instructions to run the sample (on your local machine or on a Compute Engine VM): - * Running the sample locally on your development machine: - 1. Install [Google Cloud SDK](https://cloud.google.com/sdk/) - 1. Run the following command to authorize the Cloud SDK and configure your project: -
gcloud init
- 1. Add your authenticated email account as '<user-email>' and '<writer-email>' elements to the queue.xml - file of the App Engine app that created the pull queue task you're trying to access. For more details, please see - [Defining Pull Queues](https://cloud.google.com/appengine/docs/java/taskqueue/overview-pull#Java_Defining_pull_queues). - * Running the sample on a Google Compute Engine VM using Default Application Credentials: - 1. Create a service account and add it to queue.xml - 1. In the API Manager > [Credentials](https://pantheon.corp.google.com/apis/credentials) - section click "Create credentials" and choose "Service account key". - 1. On the "Create service account key" page, select "Compute Engine default service account" from the "Service Account" drop-down menu. Leave the Key type set to JSON and click the "Create" button. - 1. Once the service account is created, click the "Manage service accounts" link and copy the "Service account ID" of the "Compute Engine default service account". - 1. Add the "Service account ID" as '<user-email>' and '<writer-email>' elements to the queue.xml file of the - App Engine app that created the pull queue task you're trying to access. For more details, please see - [Defining Pull Queues](https://cloud.google.com/appengine/docs/java/taskqueue/overview-pull#Java_Defining_pull_queues). - - 1. Create a Compute Engine VM Instance. - 1. In the [Cloud Console](https://console.cloud.google.com/project) - go to the Compute > Compute Engine section. - 1. Click the "Create instance" button. - 1. For the 'Boot Disk' select a Linux machine image like Debian or Ubuntu. - 1. In the "Indentity API and Access" section, select "Set access for each API" under the "Access Scopes" subsection and then select the - "Task queue" drop-down menu to set its scope. - * Set the "Task queue" access scope to be "Enabled". - 1. Click the "Create" button. - 1. Once the VM is created click the VM instance's "SSH" button to ssh in to the newly created VM instance. - -1. Code checkout instructions: - 1. Prerequisites: install [Java 7 or Java 8 JDK][1], [Git][3], and [Maven][4]. -You may need to set your `JAVA_HOME` environment variable as well. - * To install these prerequisites on a Linux (Debian or Ubuntu) based Compute Engine VM - instance, run these commands: -
-    sudo apt-get update
-    sudo apt-get install git maven openjdk-7-jdk -y
-    
- 1. Download the sample code by running the following commands: -
mkdir some_directory
-  cd some_directory
-  git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
-  cd java-docs-samples/taskqueue/cmdline
-  
- In a text editor open the `TaskQueueSample.java` file. For example, to edit the file with nano: -
nano src/main/java/TaskQueueSample.java
- - 1. Specify an 'Application Name' for your app by updating the following line of code: -
private static final String APPLICATION_NAME = "";
- 1. Save the changes to the file and exit the text editor. - -1. Compile and run the sample: - 1. Compile the sample code using Maven by running the following command: -
mvn compile
- 1. Execute the sample code using Maven by running the following command, - entering your specific values for the placeholder arguments: -
mvn -q exec:java -Dexec.args="<ProjectId> <TaskQueueName> <LeaseSeconds> <NumberOfTasksToLease>"
- 1. Running the sample will first list the pull task queue details and then it will lease, process and delete the number of tasks you specified. - - You can verify the details of the pull task queue and the leased tasks by visiting the [App Engine > Task queues](https://pantheon.corp.google.com/appengine/taskqueues) - section of the Developers Console. -1. Importing the code into Eclipse and running it from there: - 1. Prerequisites: install [Eclipse][5] and the [Maven plugin for Eclipse][6]. - 1. Download code as specified above. - 1. File -> Import -> Maven -> Existing Maven Projects -> Next. - 1. Select your project directory as your "Root Directory," and click "Finish." - 1. Right-click on project task-queue-rest-sample. - 1. Run As > Java Application. - 1. If asked, type or select "TaskQueueSample" and click OK. - 1. Application output will display in the Eclipse Console. - -[1]: http://java.com/en/download/faq/develop.xml -[2]: https://console.cloud.google.com/project -[3]: http://git-scm.com/downloads -[4]: http://maven.apache.org/download.html -[5]: http://www.eclipse.org/downloads/ -[6]: http://download.eclipse.org/technology/m2e/releases/ - diff --git a/taskqueue/pull/logging.properties b/taskqueue/pull/logging.properties deleted file mode 100644 index 4d8490a7c71..00000000000 --- a/taskqueue/pull/logging.properties +++ /dev/null @@ -1,9 +0,0 @@ - -# Properties file which configures the operation of the JDK logging facility. -# The system will look for this config file to be specified as a system property: -# -Djava.util.logging.config.file=${project_loc:task-queue-rest-sample}/logging.properties -# Set up the console handler (uncomment "level" to show more fine-grained messages) -handlers = java.util.logging.ConsoleHandler -#java.util.logging.ConsoleHandler.level = CONFIG -# Set up logging of HTTP requests and responses (uncomment "level" to show) -#com.google.api.client.http.level = CONFIG diff --git a/taskqueue/pull/pom.xml b/taskqueue/pull/pom.xml deleted file mode 100644 index d7217343837..00000000000 --- a/taskqueue/pull/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - 4.0.0 - com.google.cloud.samples - taskqueue - 1 - - - com.google.cloud - doc-samples - 1.0.0 - ../.. - - - - - maven-compiler-plugin - 3.5.1 - - 1.7 - 1.7 - - - - org.codehaus.mojo - exec-maven-plugin - 1.4.0 - - - - java - - - - - TaskQueueSample - - - java.util.logging.config.file - logging.properties - - - - - - org.codehaus.mojo - findbugs-maven-plugin - 3.0.3 - - false - - - - - check - - - - - - ${project.artifactId}-${project.version} - - - - com.google.api-client - google-api-client - 1.21.0 - - - com.google.apis - google-api-services-taskqueue - v1beta2-rev40-1.21.0 - - - commons-codec - commons-codec - 1.10 - - - - v1-rev105-1.21.0 - UTF-8 - - diff --git a/taskqueue/pull/src/main/java/TaskQueueSample.java b/taskqueue/pull/src/main/java/TaskQueueSample.java deleted file mode 100644 index de9c7bd39a3..00000000000 --- a/taskqueue/pull/src/main/java/TaskQueueSample.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright 2016 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// [START import_libraries] -import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; -import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; -import com.google.api.client.http.HttpTransport; -// [END import_libraries] -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; -import com.google.api.services.taskqueue.Taskqueue; -import com.google.api.services.taskqueue.TaskqueueRequest; -import com.google.api.services.taskqueue.TaskqueueRequestInitializer; -import com.google.api.services.taskqueue.TaskqueueScopes; -import com.google.api.services.taskqueue.model.Task; -import com.google.api.services.taskqueue.model.Tasks; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import org.apache.commons.codec.binary.Base64; -/** - * Command-line sample which leases tasks from a pull task queue, processes the payload - * of the task and then deletes the task. - */ -public class TaskQueueSample { - /** - * Be sure to specify the name of your application. If the application name is {@code null} or - * blank, the application will log a warning. Suggested format is "MyCompany-ProductName/1.0". - */ - private static final String APPLICATION_NAME = ""; - private static String projectId; - private static String taskQueueName; - private static int leaseSecs; - private static int numTasks; - /** Global instance of the HTTP transport. */ - // [START intialize_transport] - private static HttpTransport httpTransport; - // [END intialize_transport] - /** Global instance of the JSON factory. */ - private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance(); - private static void run() throws Exception { - httpTransport = GoogleNetHttpTransport.newTrustedTransport(); - // [START auth_and_intitalize_client] - // Authenticate using Google Application Default Credentials. - GoogleCredential credential = GoogleCredential.getApplicationDefault(); - if (credential.createScopedRequired()) { - List scopes = new ArrayList<>(); - // Set TaskQueue Scopes - scopes.add(TaskqueueScopes.TASKQUEUE); - scopes.add(TaskqueueScopes.TASKQUEUE_CONSUMER); - credential = credential.createScoped(scopes); - } - // Intialize Taskqueue object. - Taskqueue taskQueue = - new Taskqueue.Builder(httpTransport, JSON_FACTORY, credential) - .setApplicationName(APPLICATION_NAME) - .build(); - // [END auth_and_intitalize_client] - - /* Get the task queue using the name of an existing task queue - * listed in the App Engine Task Queue section of the Developers console. - * See the following sample for an example App Engine app that creates a - * pull task queue: - * https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine/taskqueue - */ - com.google.api.services.taskqueue.model.TaskQueue queue = getQueue(taskQueue); - System.out.println("================== Listing Task Queue details =================="); - System.out.println(queue); - // Lease, process and delete tasks - // [START lease_tasks] - Tasks tasks = getLeasedTasks(taskQueue); - if (tasks.getItems() == null || tasks.getItems().size() == 0) { - System.out.println("No tasks to lease, so now exiting"); - } else { - for (Task leasedTask : tasks.getItems()) { - processTask(leasedTask); - deleteTask(taskQueue, leasedTask); - } - } - // [END lease_tasks] - } - - public static boolean parseParams(String[] args) { - try { - projectId = args[0]; - taskQueueName = args[1]; - leaseSecs = Integer.parseInt(args[2]); - numTasks = Integer.parseInt(args[3]); - return true; - } catch (ArrayIndexOutOfBoundsException ae) { - System.out.println("Insufficient Arguments"); - return false; - } catch (NumberFormatException ae) { - System.out.println("Please specify lease seconds " - + "and Number of tasks to lease, in number " - + "format"); - return false; - } - } - public static void printUsage() { - System.out.println("mvn -q exec:java -Dexec.args=\"" - + " " - + " \""); - } - public static void main(String[] args) { - if (args.length != 4) { - System.out.println("Insuficient arguments"); - printUsage(); - System.exit(1); - } else if (!parseParams(args)) { - printUsage(); - System.exit(1); - } - try { - run(); - // success! - return; - } catch (IOException e) { - System.err.println(e.getMessage()); - } catch (Throwable t) { - t.printStackTrace(); - } - System.exit(1); - } - /** - * Method that sends a get request to get the queue. - * - * @param taskQueue The task queue that should be used to get the queue from. - * @return {@link com.google.api.services.taskqueue.model.TaskQueue} - * @throws IOException if the request fails. - */ - private static com.google.api.services.taskqueue.model.TaskQueue getQueue(Taskqueue taskQueue) - throws IOException { - //[START get_rest_queue] - Taskqueue.Taskqueues.Get request = taskQueue.taskqueues().get(projectId, taskQueueName); - request.setGetStats(true); - return request.execute(); - // [END get_rest_queue] - } - /** - * Method that sends a lease request to the specified task queue. - * - * @param taskQueue The task queue that should be used to lease tasks from. - * @return {@link Tasks} - * @throws IOException if the request fails. - */ - private static Tasks getLeasedTasks(Taskqueue taskQueue) throws IOException { - Taskqueue.Tasks.Lease leaseRequest = - taskQueue.tasks().lease(projectId, taskQueueName, numTasks, leaseSecs); - return leaseRequest.execute(); - } - /** - * This method actually performs the desired work on tasks. It can make use of payload of the - * task. By default, we are just printing the payload of the leased task after converting - * it from Base64 encoding. - * - * @param task The task that should be executed. - */ - private static void processTask(Task task) { - byte[] payload = Base64.decodeBase64(task.getPayloadBase64()); - if (payload != null) { - System.out.println("Payload for the task:"); - System.out.println(new String(payload)); - } else { - System.out.println("This task has no payload."); - } - } - /** - * Method that sends a delete request for the specified task object to the taskqueue service. - * - * @param taskQueue The task queue the specified task lies in. - * @param task The task that should be deleted. - * @throws IOException if the request fails - */ - private static void deleteTask(Taskqueue taskQueue, Task task) throws IOException { - System.out.println("Deleting task:" + task.getId()); - // [START delete_task] - String DeletePrefix = "s~"; - String projectIdFormattedForDelete = String.format("%s%s", DeletePrefix, projectId); - Taskqueue.Tasks.Delete request = - taskQueue.tasks().delete(projectIdFormattedForDelete, taskQueueName, task.getId()); - request.execute(); - // [END delete_task] - } -}