From ac26863ab9cb8e84e1e9e653033459b14b9df7d8 Mon Sep 17 00:00:00 2001
From: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
Date: Mon, 4 Dec 2017 10:47:56 -0800
Subject: [PATCH] Removed TaskQueue samples using Restv1 API. (#933)
* Removed TaskQueue samples using Restv1 API.
* Consolidated taskqueue samples into a single appengine folder.
* Fixed pom hierarchy
* Removed older taskqueue module from parent pom
---
appengine/pom.xml | 3 +-
.../taskqueue/defer-samples}/README.md | 0
.../taskqueue/defer-samples}/pom.xml | 4 +-
.../taskqueue/samples/DeferSampleServlet.java | 0
.../src/main/webapp/WEB-INF/appengine-web.xml | 0
.../main/webapp/WEB-INF/logging.properties | 0
.../src/main/webapp/WEB-INF/web.xml | 0
.../src/main/webapp/guestbook.jsp | 0
appengine/taskqueue/pom.xml | 38 ++++
.../{pull => pull-samples}/README.md | 0
.../taskqueue/{pull => pull-samples}/pom.xml | 9 +-
.../example/taskqueue/TaskqueueServlet.java | 0
.../src/main/webapp/WEB-INF/appengine-web.xml | 0
.../main/webapp/WEB-INF/logging.properties | 0
.../src/main/webapp/WEB-INF/queue.xml | 0
.../src/main/webapp/WEB-INF/web.xml | 0
.../src/main/webapp/tasks.jsp | 0
.../push-samples}/README.md | 0
.../push-samples}/pom.xml | 5 +-
.../appengine/taskqueue/push/Enqueue.java | 0
.../appengine/taskqueue/push/Worker.java | 0
.../src/main/webapp/WEB-INF/appengine-web.xml | 0
.../src/main/webapp/WEB-INF/web.xml | 0
.../push-samples}/src/main/webapp/index.html | 0
.../appengine/taskqueue/push/WorkerTest.java | 0
pom.xml | 2 -
taskqueue/README.md | 5 -
taskqueue/pull/README.md | 95 ---------
taskqueue/pull/logging.properties | 9 -
taskqueue/pull/pom.xml | 95 ---------
.../pull/src/main/java/TaskQueueSample.java | 199 ------------------
31 files changed, 49 insertions(+), 415 deletions(-)
rename {taskqueue/deferred => appengine/taskqueue/defer-samples}/README.md (100%)
rename {taskqueue/deferred => appengine/taskqueue/defer-samples}/pom.xml (97%)
rename {taskqueue/deferred => appengine/taskqueue/defer-samples}/src/main/java/com/google/cloud/taskqueue/samples/DeferSampleServlet.java (100%)
rename {taskqueue/deferred => appengine/taskqueue/defer-samples}/src/main/webapp/WEB-INF/appengine-web.xml (100%)
rename {taskqueue/deferred => appengine/taskqueue/defer-samples}/src/main/webapp/WEB-INF/logging.properties (100%)
rename {taskqueue/deferred => appengine/taskqueue/defer-samples}/src/main/webapp/WEB-INF/web.xml (100%)
rename {taskqueue/deferred => appengine/taskqueue/defer-samples}/src/main/webapp/guestbook.jsp (100%)
create mode 100644 appengine/taskqueue/pom.xml
rename appengine/taskqueue/{pull => pull-samples}/README.md (100%)
rename appengine/taskqueue/{pull => pull-samples}/pom.xml (95%)
rename appengine/taskqueue/{pull => pull-samples}/src/main/java/com/example/taskqueue/TaskqueueServlet.java (100%)
rename appengine/taskqueue/{pull => pull-samples}/src/main/webapp/WEB-INF/appengine-web.xml (100%)
rename appengine/taskqueue/{pull => pull-samples}/src/main/webapp/WEB-INF/logging.properties (100%)
rename appengine/taskqueue/{pull => pull-samples}/src/main/webapp/WEB-INF/queue.xml (100%)
rename appengine/taskqueue/{pull => pull-samples}/src/main/webapp/WEB-INF/web.xml (100%)
rename appengine/taskqueue/{pull => pull-samples}/src/main/webapp/tasks.jsp (100%)
rename appengine/{taskqueue-push => taskqueue/push-samples}/README.md (100%)
rename appengine/{taskqueue-push => taskqueue/push-samples}/pom.xml (98%)
rename appengine/{taskqueue-push => taskqueue/push-samples}/src/main/java/com/example/appengine/taskqueue/push/Enqueue.java (100%)
rename appengine/{taskqueue-push => taskqueue/push-samples}/src/main/java/com/example/appengine/taskqueue/push/Worker.java (100%)
rename appengine/{taskqueue-push => taskqueue/push-samples}/src/main/webapp/WEB-INF/appengine-web.xml (100%)
rename appengine/{taskqueue-push => taskqueue/push-samples}/src/main/webapp/WEB-INF/web.xml (100%)
rename appengine/{taskqueue-push => taskqueue/push-samples}/src/main/webapp/index.html (100%)
rename appengine/{taskqueue-push => taskqueue/push-samples}/src/test/java/com/example/appengine/taskqueue/push/WorkerTest.java (100%)
delete mode 100644 taskqueue/README.md
delete mode 100644 taskqueue/pull/README.md
delete mode 100644 taskqueue/pull/logging.properties
delete mode 100644 taskqueue/pull/pom.xml
delete mode 100644 taskqueue/pull/src/main/java/TaskQueueSample.java
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 @@
socketsstatic-files
-
- taskqueue-push
+ taskqueuetwiliourlfetchusers
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-samplescom.google.cloud1.0.0../..
@@ -31,7 +31,7 @@
1.71.7
- 1.9.59
+ 1.9.592.53.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.cloudappengine-doc-samples
+ com.google.cloud1.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-samplestorage/xml-api/serviceaccount-appengine-sample
- taskqueue/deferred
-
translatetranslate/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:
-
- 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:
-