Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ludo java21 #9882

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions appengine-java8/README.md → appengine-java21/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Google App Engine Standard Environment Samples for Java 8
# Google App Engine Standard Environment Samples for Java 21

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java8/README.md">
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java21/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

This is a repository that contains Java code samples for [Google App Engine
Expand Down Expand Up @@ -43,7 +43,7 @@ access control, billing, and services.
This sample demonstrates how to deploy an application on Google App Engine.

- [Documentation][ae-docs]
- [Code](https://github.com/GoogleCloudPlatform/getting-started-java/tree/main/appengine-standard-java8/helloworld)
- [Code](https://github.com/GoogleCloudPlatform/getting-started-java/tree/main/appengine-standard-java21/helloworld)

### Sending Email

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Google Analytics sample for Google App Engine

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java8/analytics/README.md">
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java21/analytics/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

Integrating App Engine with Google Analytics.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.appengine</groupId>
<artifactId>appengine-analytics-j8</artifactId>
<artifactId>appengine-analytics-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
-->
<!-- [END_EXCLUDE] -->
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<threadsafe>true</threadsafe>
<runtime>java8</runtime>
<env-variables>

<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>
<system-properties>
<property name="appengine.use.EE8" value="true"/>
ludoch marked this conversation as resolved.
Show resolved Hide resolved
</system-properties>

<env-variables>
<env-var name="GA_TRACKING_ID" value="YOUR-GA-TRACKING-ID" />
</env-variables>
</appengine-web-app>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# App Identity sample for Google App Engine

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java8/appidentity/README.md">
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java21/appidentity/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.appengine</groupId>
<artifactId>appengine-appidentity-j8</artifactId>
<artifactId>appengine-appidentity-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
)
public class IdentityServlet extends HttpServlet {

// [START gae_java21_app_identity_versioned_hostnames]
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/plain");
Expand All @@ -40,4 +41,5 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc
resp.getWriter()
.println(env.getAttributes().get("com.google.appengine.runtime.default_version_hostname"));
}
// [END gae_java21_app_identity_versioned_hostnames]
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public SignForAppServlet() {
appIdentity = AppIdentityServiceFactory.getAppIdentityService();
}

// [START gae_java8_app_identity_other_services]
// [START gae_java21_app_identity_other_services]
// Note that the algorithm used by AppIdentity.signForApp() and
// getPublicCertificatesForApp() is "SHA256withRSA"

Expand Down Expand Up @@ -102,7 +102,7 @@ private String simulateIdentityAssertion()
"isValid=%b for message: %s\n\tsignature: %s\n\tpublic cert: %s",
isValid, message, Arrays.toString(blobSignature), Arrays.toString(publicCert));
}
// [END gae_java8_app_identity_other_services]
// [END gae_java21_app_identity_other_services]

@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

@SuppressWarnings("serial")
class UrlShortener {
// [START gae_java8_app_identity_google_apis]
// [START gae_java21_app_identity_google_apis]

/**
* Returns a shortened URL by calling the Google URL Shortener API.
Expand Down Expand Up @@ -74,5 +74,5 @@ public String createShortUrl(String longUrl) throws Exception {
}
}
}
// [END gae_java8_app_identity_google_apis]
// [END gae_java21_app_identity_google_apis]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">

<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>
<system-properties>
<property name="appengine.use.EE8" value="true"/>
</system-properties>

</appengine-web-app>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java8/bigquery/README.md">
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java21/bigquery/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

# Google Cloud API Showcase: BigQuery & Cloud Monitoring in App Engine standard environment for Java 8
# Google Cloud API Showcase: BigQuery & Cloud Monitoring in App Engine standard environment for Java 21

This API Showcase demonstrates how to run an App Engine standard environment application with dependencies on both
[Google BigQuery][bigquery] and [StackDriver Monitoring][monitoring].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think [StackDriver Monitoring] needs to get updated to Cloud Monitoring

Expand All @@ -16,11 +16,11 @@ The home page also provides a summary view of the metrics that have been logged

## Clone the sample app

Copy the sample apps to your local machine, and cd to the `appengine-java8/bigquery` directory:
Copy the sample apps to your local machine, and cd to the `appengine-java21/bigquery` directory:

```
git clone https://github.com/GoogleCloudPlatform/java-docs-samples
cd appengine-java8/bigquery
cd appengine-java21/bigquery
```

## Setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.appengine</groupId>
<artifactId>appengine-bigquery-monitoring-j8</artifactId>
<artifactId>appengine-bigquery-monitoring-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">

<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>
<system-properties>
<property name="appengine.use.EE8" value="true"/>
</system-properties>

<application>dzlier-work</application>
</appengine-web-app>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Bigtable-hello-j8
Bigtable-hello-j21
=================

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java8/bigtable/README.md">
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=appengine-java21/bigtable/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

Moves the Bigtable Hello World application to Google App Engine Standard for Java 8.
Moves the Bigtable Hello World application to Google App Engine Standard for Java 21.


* [Java 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
* [Java 21](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
* [Maven](https://maven.apache.org/download.cgi) (at least 3.3.9)
* [Gradle](https://gradle.org)
* [Google Cloud SDK](https://cloud.google.com/sdk/) (aka gcloud)
Expand All @@ -27,7 +27,7 @@ Then you need to [Create a Cloud Bigtable Instance](https://cloud.google.com/big

mvn -Dbigtable.projectID=PROJECTID -Dbigtable.instanceID=INSTANCEID appengine:run

### Deploy to App Engine Standard for Java 8
### Deploy to App Engine Standard for Java 21

mvn -Dbigtable.projectID=PROJECTID -Dbigtable.instanceID=INSTANCEID package appengine:deploy

Expand All @@ -41,7 +41,7 @@ Then you need to [Create a Cloud Bigtable Instance](https://cloud.google.com/big

gradle -Dbigtable.projectID=PROJECTID -Dbigtable.instanceID=INSTANCEID appengineRun

### Integration Tests & Deploy to App Engine Standard for Java 8
### Integration Tests & Deploy to App Engine Standard for Java 21

gradle -Dbigtable.projectID=PROJECTID -Dbigtable.instanceID=INSTANCEID appengineDeploy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ apply plugin: 'com.google.cloud.tools.appengine'
group = 'com.example.google.cloud.bigtable'
version = '0.1-SNAPSHOT'

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 17
ludoch marked this conversation as resolved.
Show resolved Hide resolved
targetCompatibility = 17

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ limitations under the License.
<version>0.1-SNAPSHOT</version>

<groupId>com.example.appengine</groupId>
<artifactId>bigtable-hello-j8</artifactId>
<artifactId>bigtable-hello-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
15 changes: 15 additions & 0 deletions appengine-java21/bigtable/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2024 Google LLC
//
// 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.
//
rootProject.name = 'bigtable-hello-j21'
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
limitations under the License.
-->
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<threadsafe>true</threadsafe>
<runtime>java8</runtime>

<system-properties>
<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>

<system-properties>
<property name="appengine.use.EE8" value="true"/>
<property name="BIGTABLE_PROJECT" value="@bigtable.projectID@" />
<property name="BIGTABLE_INSTANCE" value="@bigtable.instanceID@" />
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
</system-properties>
</appengine-web-app>
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# To use this configuration, copy it into your application's WEB-INF
# folder and add the following to your appengine-web.xml:
#
# <system-properties>
# <system-properties>
ludoch marked this conversation as resolved.
Show resolved Hide resolved
# <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
# </system-properties>
# </system-properties>
#

# Set the default logging level for all loggers to WARNING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<html>
<head>
<link href='//fonts.googleapis.com/css?family=Marmelad' rel='stylesheet' type='text/css'>
<title>Hello App Engine Standard using Java 8</title>
<title>Hello App Engine Standard using Java 21</title>
</head>
<body>
<h1>Hello App Engine -- Standard for Java 8!</h1>
<h1>Hello App Engine -- Standard for Java 21!</h1>

<p>This is <%= BigtableHelloWorld.doHelloWorld() %>.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cloud SQL sample for Google App Engine (Java 8)
# Cloud SQL sample for Google App Engine (Java 21)

For instructions on using Google App Engine and Cloud SQL, please see
[Connecting to Cloud SQL from App Engine][0].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.appengine</groupId>
<artifactId>appengine-datastore-indexes-exploding-j8</artifactId>
<artifactId>appengine-datastore-indexes-exploding-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
limitations under the License.
-->
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<runtime>java8</runtime>
<threadsafe>true</threadsafe>
<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>
<system-properties>
<property name="appengine.use.EE8" value="true"/>
</system-properties>


</appengine-web-app>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.appengine</groupId>
<artifactId>appengine-datastore-indexes-perfect-j8</artifactId>
<artifactId>appengine-datastore-indexes-perfect-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
limitations under the License.
-->
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<runtime>java8</runtime>
<threadsafe>true</threadsafe>
<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>
ludoch marked this conversation as resolved.
Show resolved Hide resolved
<system-properties>
<property name="appengine.use.EE8" value="true"/>
</system-properties>


</appengine-web-app>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.appengine</groupId>
<artifactId>appengine-datastore-indexes-j8</artifactId>
<artifactId>appengine-datastore-indexes-j21</artifactId>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
limitations under the License.
-->
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<runtime>java8</runtime>
<threadsafe>true</threadsafe>
<runtime>java21</runtime>
<app-engine-apis>true</app-engine-apis>
<system-properties>
<property name="appengine.use.EE8" value="true"/>
</system-properties>


</appengine-web-app>
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Copyright 2017 Google Inc.
#
# Copyright 2024 Google LLC
#
# 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
# https://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.
#
cron:
- description: "Daily Cloud Datastore Export"
url: /cloud-datastore-export?output_url_prefix=gs://<EXPORT_BUCKET>&kind=<KIND_NAME>
schedule: every 24 hours
Loading
Loading