From bd13489de40b8ab3cba29b3da1c67f28cade9272 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Fri, 28 Oct 2016 12:45:59 -0700 Subject: [PATCH] Remove references to gcloud-java. We were still using the old artifactId in some pom.xml files, so dpebot could not update these. Also, some READMEs needed updating from my grep search. --- bigquery/cloud-client/README.md | 2 +- bigquery/cloud-client/pom.xml | 4 +- datastore/pom.xml | 4 +- .../datastore/snippets/ConceptsTest.java | 2 +- flexible/cloudstorage/pom.xml | 4 +- flexible/datastore/pom.xml | 4 +- flexible/sparkjava/README.md | 96 +++++++++++++++---- flexible/sparkjava/pom.xml | 4 +- .../appengine/sparkdemo/UserController.java | 2 +- .../appengine/sparkdemo/UserService.java | 2 +- .../speech/StreamingRecognizeClient.java | 7 +- 11 files changed, 97 insertions(+), 34 deletions(-) diff --git a/bigquery/cloud-client/README.md b/bigquery/cloud-client/README.md index da277d3737e..d434fca760c 100644 --- a/bigquery/cloud-client/README.md +++ b/bigquery/cloud-client/README.md @@ -6,7 +6,7 @@ These sample Java applications demonstrate how to access the BigQuery API using the [Google Cloud Client Library for Java][google-cloud-java]. [BigQuery]: https://cloud.google.com/bigquery/ -[google-cloud-java]: https://github.com/GoogleCloudPlatform/gcloud-java +[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java ## Quickstart diff --git a/bigquery/cloud-client/pom.xml b/bigquery/cloud-client/pom.xml index 887e1446cbb..f1b70d13b96 100644 --- a/bigquery/cloud-client/pom.xml +++ b/bigquery/cloud-client/pom.xml @@ -36,8 +36,8 @@ com.google.cloud - gcloud-java - 0.2.8 + google-cloud-bigquery + 0.4.0 diff --git a/datastore/pom.xml b/datastore/pom.xml index 45a5255e489..89c27619ca5 100644 --- a/datastore/pom.xml +++ b/datastore/pom.xml @@ -34,8 +34,8 @@ com.google.cloud - gcloud-java-datastore - 0.2.8 + google-cloud-datastore + 0.4.0 diff --git a/datastore/src/test/java/com/google/datastore/snippets/ConceptsTest.java b/datastore/src/test/java/com/google/datastore/snippets/ConceptsTest.java index 764fa13385f..b518ffb5324 100644 --- a/datastore/src/test/java/com/google/datastore/snippets/ConceptsTest.java +++ b/datastore/src/test/java/com/google/datastore/snippets/ConceptsTest.java @@ -813,7 +813,7 @@ public void testTransactionalRetry() { --retries; } } - // Retry handling can also be configured and automatically applied using gcloud-java. + // Retry handling can also be configured and automatically applied using google-cloud-java. // [END transactional_retry] assertSuccessfulTransfer(keys.get(0), keys.get(1)); } diff --git a/flexible/cloudstorage/pom.xml b/flexible/cloudstorage/pom.xml index ec378427e5d..b7c9b9a2555 100644 --- a/flexible/cloudstorage/pom.xml +++ b/flexible/cloudstorage/pom.xml @@ -46,8 +46,8 @@ com.google.cloud - gcloud-java-storage - 0.2.8 + google-cloud-storage + 0.4.0 diff --git a/flexible/datastore/pom.xml b/flexible/datastore/pom.xml index 62cac1b18f1..ca34fbd7d8d 100644 --- a/flexible/datastore/pom.xml +++ b/flexible/datastore/pom.xml @@ -46,8 +46,8 @@ com.google.cloud - gcloud-java-datastore - 0.2.8 + google-cloud-datastore + 0.4.0 diff --git a/flexible/sparkjava/README.md b/flexible/sparkjava/README.md index a809fa0815b..57b1c0abdb6 100644 --- a/flexible/sparkjava/README.md +++ b/flexible/sparkjava/README.md @@ -1,34 +1,72 @@ # SparkJava on App Engine Flexible Environment -This app demonstrates how to use [`gcloud-java`'s Datastore client](https://github.com/GoogleCloudPlatform/gcloud-java/tree/master/gcloud-java-datastore#google-cloud-java-client-for-datastore) from within an [App Engine flexible environment](https://cloud.google.com/appengine/docs/flexible/java/hello-world) project using [SparkJava](http://sparkjava.com/). The app allows you to create and modify a database of "users", which contains their ID, name, and email information. - -`gcloud-java` is an idiomatic Java client for [Google Cloud Platform](https://cloud.google.com/) services. Read more about the library [here](https://github.com/GoogleCloudPlatform/gcloud-java#google-cloud-java-client). +This app demonstrates how to use [Datastore with the Google Cloud client +library](https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-datastore) +from within an [App Engine flexible +environment](https://cloud.google.com/appengine/docs/flexible/java/hello-world) +project using [SparkJava](http://sparkjava.com/). The app allows you to create +and modify a database of "users", which contains their ID, name, and email +information. + +The Google Cloud client library is an idiomatic Java client for [Google Cloud +Platform](https://cloud.google.com/) services. Read more about the library +[here](https://github.com/GoogleCloudPlatform/google-cloud-java). Setup ----- -1. Create a Google Developers Console project with the Datastore API enabled. [Follow these instructions](https://cloud.google.com/docs/authentication#preparation) to get your project set up. If you wish to deploy this application, you will also need to [enable billing](https://support.google.com/cloud/?rd=2#topic=6288636). +1. Create a Google Cloud project with the Datastore API enabled. + [Follow these + instructions](https://cloud.google.com/docs/authentication#preparation) to + get your project set up. If you wish to deploy this application, you will + also need to [enable + billing](https://support.google.com/cloud/?rd=2#topic=6288636). -2. Set up the local development environment by [installing the Google Cloud SDK](https://cloud.google.com/sdk/) and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. +2. Set up the local development environment by [installing the Google Cloud + SDK](https://cloud.google.com/sdk/) and running the following commands in + command line: `gcloud auth login` and `gcloud config set project [YOUR + PROJECT ID]`. -3. Ensure that you have Maven installed and configured to use Java 8. See installation instructions [here](https://maven.apache.org/install.html). +3. Ensure that you have Maven installed and configured to use Java 8. See + installation instructions [here](https://maven.apache.org/install.html). Running locally --------------- -Run the application on your local machine by typing the following into your command line from the `sparkjava` directory: `mvn clean package exec:java`. Navigate to `localhost:8080` to view and interact with the application. +Run the application on your local machine by typing the following into your +command line from the `sparkjava` directory: `mvn clean package exec:java`. +Navigate to `localhost:8080` to view and interact with the application. Deploying --------- -If you've enabled billing (step 1 in [Setup](#Setup)), you can deploy the application to the web by running `mvn gcloud:deploy` from your command line (from the `sparkjava` directory). +If you've enabled billing (step 1 in [Setup](#Setup)), you can deploy the +application to the web by running `mvn gcloud:deploy` from your command line +(from the `sparkjava` directory). How does it work? ----------------- -You'll notice that the source code is split into three folders: `appengine`, `java/com/google/appengine/sparkdemo`, and `resource/public`. The `appengine` folder contains a `Dockerfile` and an `app.yaml`, necessary files to [configure the VM environment](https://cloud.google.com/appengine/docs/managed-vms/config). The `java/com/google/appengine/sparkdemo` folder contains the controller code, which uses the `gcloud-java` library to modify the records in the Google Cloud Datastore. Finally, the `resource/public` folder contains the home webpage, which uses jQuery to send HTTP requests to create, remove, and update records. - -Spark runs the [`main` method](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managedvms/sparkjava-demo/src/main/java/com/google/appengine/sparkdemo/Main.java) upon server startup. The `main` method creates the controller, [`UserController`](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managedvms/sparkjava-demo/src/main/java/com/google/appengine/sparkdemo/UserController.java). The URIs used to send HTTP requests in the [home page](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managedvms/sparkjava-demo/src/main/resources/public/index.html) correspond to methods in the `UserController` class. For example, the `index.html` code for `create` makes a `POST` request to the path `/api/users` with a body containing the name and email of a user to add. `UserController` contains the following code to process that request: +You'll notice that the source code is split into three folders: `appengine`, +`java/com/google/appengine/sparkdemo`, and `resource/public`. The `appengine` +folder contains a `Dockerfile` and an `app.yaml`, necessary files to [configure +the VM +environment](https://cloud.google.com/appengine/docs/managed-vms/config). The +`java/com/google/appengine/sparkdemo` folder contains the controller code, +which uses the Google Cloud client library to modify the records in the Google Cloud +Datastore. Finally, the `resource/public` folder contains the home webpage, +which uses jQuery to send HTTP requests to create, remove, and update records. + +Spark runs the [`main` +method](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managedvms/sparkjava-demo/src/main/java/com/google/appengine/sparkdemo/Main.java) +upon server startup. The `main` method creates the controller, +[`UserController`](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managedvms/sparkjava-demo/src/main/java/com/google/appengine/sparkdemo/UserController.java). +The URIs used to send HTTP requests in the [home +page](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managedvms/sparkjava-demo/src/main/resources/public/index.html) +correspond to methods in the `UserController` class. For example, the +`index.html` code for `create` makes a `POST` request to the path `/api/users` +with a body containing the name and email of a user to add. `UserController` +contains the following code to process that request: ```java post("/api/users", (req, res) -> userService.createUser( @@ -36,13 +74,37 @@ post("/api/users", (req, res) -> userService.createUser( req.queryParams("email), ), json()); ``` -This code snippet gets the name and email of the user from the POST request and passes it to `createUser` (in [`UserService.java`](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managedvms/sparkjava-demo/src/main/java/com/google/appengine/sparkdemo/UserService.java)) to create a database record using `gcloud-java`. If you want a more in-depth tutorial on using `gcloud-java` Datastore client, see the [Getting Started](https://github.com/GoogleCloudPlatform/gcloud-java/tree/master/gcloud-java-datastore#getting-started) section in the `gcloud-java-datastore` documentation. - -Communication with the Google Cloud Datastore requires authentication and setting a project ID. When running locally, `gcloud-java` automatically detects your credentials and project ID because you logged into the Google Cloud SDK and set your project ID. There are also many other options for authenticating and setting a project ID. To read more, see the [Authentication](https://github.com/GoogleCloudPlatform/gcloud-java#authentication) and [Specifying a Project ID](https://github.com/GoogleCloudPlatform/gcloud-java#specifying-a-project-id) sections of the `gcloud-java` documentation. - -You built and ran this application using Maven. To read more about using Maven with Managed VMs, see the [Using Apache Maven documentation](https://cloud.google.com/appengine/docs/java/managed-vms/maven). While this particular project uses Maven, `gcloud-java` can also be accessed using Gradle and SBT. See how to obtain the dependency in the [Quickstart section](https://github.com/GoogleCloudPlatform/gcloud-java#quickstart) of the `gcloud-java` documentation. +This code snippet gets the name and email of the user from the POST request and +passes it to `createUser` (in +[`UserService.java`](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managedvms/sparkjava-demo/src/main/java/com/google/appengine/sparkdemo/UserService.java)) +to create a database record using the Google Cloud client library. If you want +a more in-depth tutorial on using Google Cloud client library Datastore client, +see the [Getting +Started](https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-datastore#getting-started) +section of the client library documentation. + +Communication with the Google Cloud Datastore requires authentication and +setting a project ID. When running locally, the Google Cloud client library +automatically detects your credentials and project ID because you logged into +the Google Cloud SDK and set your project ID. There are also many other options +for authenticating and setting a project ID. To read more, see the +[Authentication](https://github.com/GoogleCloudPlatform/google-cloud-java#authentication) +and [Specifying a Project +ID](https://github.com/GoogleCloudPlatform/google-cloud-java#specifying-a-project-id) +sections of the client library documentation. + +You built and ran this application using Maven. To read more about using Maven +with App Engine flexible environment, see the [Using Apache Maven +documentation](https://cloud.google.com/appengine/docs/flexible/java/using-maven). +While this particular project uses Maven, the Google Cloud client library +packages can also be accessed using Gradle and SBT. See how to obtain the +dependency in the [Quickstart +section](https://github.com/GoogleCloudPlatform/google-cloud-java#quickstart) +of the client library documentation. License ------- -Apache 2.0 - See [LICENSE](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/LICENSE) for more information. +Apache 2.0 - See +[LICENSE](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/LICENSE) +for more information. diff --git a/flexible/sparkjava/pom.xml b/flexible/sparkjava/pom.xml index 8e3c3e3f491..6b78cfb6023 100644 --- a/flexible/sparkjava/pom.xml +++ b/flexible/sparkjava/pom.xml @@ -37,8 +37,8 @@ com.google.cloud - gcloud-java - 0.2.7 + google-cloud + 0.4.0 diff --git a/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserController.java b/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserController.java index 0c1a5096af6..0a4b303250c 100644 --- a/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserController.java +++ b/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserController.java @@ -31,7 +31,7 @@ public class UserController { /** - * Creates a controller that maps requests to gcloud-java functions. + * Creates a controller that maps requests to actions. */ public UserController(final UserService userService) { Spark.staticFileLocation("/public"); diff --git a/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserService.java b/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserService.java index dce6dc7baeb..b73acef4692 100644 --- a/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserService.java +++ b/flexible/sparkjava/src/main/java/com/google/appengine/sparkdemo/UserService.java @@ -37,7 +37,7 @@ public class UserService { /** * Constructor for UserService. * - * @param datastore gcloud-java Datastore service object to execute requests + * @param datastore service object to execute requests * @param kind the kind for the Datastore entities in this demo */ public UserService(Datastore datastore, String kind) { diff --git a/speech/grpc/src/main/java/com/examples/cloud/speech/StreamingRecognizeClient.java b/speech/grpc/src/main/java/com/examples/cloud/speech/StreamingRecognizeClient.java index d1a529a1216..03d029ec1fe 100644 --- a/speech/grpc/src/main/java/com/examples/cloud/speech/StreamingRecognizeClient.java +++ b/speech/grpc/src/main/java/com/examples/cloud/speech/StreamingRecognizeClient.java @@ -85,9 +85,10 @@ public StreamingRecognizeClient(ManagedChannel channel, String file, int samplin speechClient = SpeechGrpc.newStub(channel); - //Send log4j logs to Console - //If you are going to run this on GCE, you might wish to integrate with gcloud-java logging. - //See https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/README.md#stackdriver-logging-alpha + // Send log4j logs to Console + // If you are going to run this on GCE, you might wish to integrate with + // google-cloud-java logging. See: + // https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/README.md#stackdriver-logging-alpha ConsoleAppender appender = new ConsoleAppender(new SimpleLayout(), SYSTEM_OUT); logger.addAppender(appender);