From 87fb80d3c4d3f37a39edaa6f83166177091e86d4 Mon Sep 17 00:00:00 2001 From: "praveen.m" <praveen.m@olacabs.com> Date: Thu, 3 Oct 2024 17:07:22 +0530 Subject: [PATCH] Add circuit breaker --- .DS_Store | Bin 0 -> 6148 bytes HELP.md | 18 ++ mvnw | 259 ++++++++++++++++++ mvnw.cmd | 149 ++++++++++ pom.xml | 97 +++++++ .../tarento/training/TrainingApplication.java | 13 + .../training/config/GeocodingConfig.java | 15 + .../controllers/GeocodeController.java | 23 ++ .../training/models/GeocodingResponse.java | 39 +++ .../training/services/GeocodingService.java | 47 ++++ src/main/resources/application.yml | 42 +++ .../training/TrainingApplicationTests.java | 13 + target/classes/application.yml | 42 +++ .../training/TrainingApplication.class | Bin 0 -> 753 bytes .../training/config/GeocodingConfig.class | Bin 0 -> 666 bytes .../controllers/GeocodeController.class | Bin 0 -> 1197 bytes ...essComponent$AddressComponentBuilder.class | Bin 0 -> 2544 bytes .../GeocodingResponse$AddressComponent.class | Bin 0 -> 2819 bytes ...ingResponse$GeocodingResponseBuilder.class | Bin 0 -> 2285 bytes ...ocodingResponse$Result$ResultBuilder.class | Bin 0 -> 2416 bytes .../models/GeocodingResponse$Result.class | Bin 0 -> 2760 bytes .../training/models/GeocodingResponse.class | Bin 0 -> 2872 bytes .../training/services/GeocodingService.class | Bin 0 -> 4256 bytes .../compile/default-compile/createdFiles.lst | 0 .../compile/default-compile/inputFiles.lst | 3 + 25 files changed, 760 insertions(+) create mode 100644 .DS_Store create mode 100644 HELP.md create mode 100755 mvnw create mode 100644 mvnw.cmd create mode 100644 pom.xml create mode 100644 src/main/java/com/tarento/training/TrainingApplication.java create mode 100644 src/main/java/com/tarento/training/config/GeocodingConfig.java create mode 100644 src/main/java/com/tarento/training/controllers/GeocodeController.java create mode 100644 src/main/java/com/tarento/training/models/GeocodingResponse.java create mode 100644 src/main/java/com/tarento/training/services/GeocodingService.java create mode 100644 src/main/resources/application.yml create mode 100644 src/test/java/com/tarento/training/TrainingApplicationTests.java create mode 100644 target/classes/application.yml create mode 100644 target/classes/com/tarento/training/TrainingApplication.class create mode 100644 target/classes/com/tarento/training/config/GeocodingConfig.class create mode 100644 target/classes/com/tarento/training/controllers/GeocodeController.class create mode 100644 target/classes/com/tarento/training/models/GeocodingResponse$AddressComponent$AddressComponentBuilder.class create mode 100644 target/classes/com/tarento/training/models/GeocodingResponse$AddressComponent.class create mode 100644 target/classes/com/tarento/training/models/GeocodingResponse$GeocodingResponseBuilder.class create mode 100644 target/classes/com/tarento/training/models/GeocodingResponse$Result$ResultBuilder.class create mode 100644 target/classes/com/tarento/training/models/GeocodingResponse$Result.class create mode 100644 target/classes/com/tarento/training/models/GeocodingResponse.class create mode 100644 target/classes/com/tarento/training/services/GeocodingService.class create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c7b3efc7246413fad25c270fceec21b621b016e8 GIT binary patch literal 6148 zcmeHKyH3ME5S&dS;)o_C1%(^hNc@2lITA=9A@~7Ef@lIk5FQeZYkq`|@1uj++ruQ6 z&>}#)((c^t&7SQ!%jW|igS*Kt&;^ju6&oFfHKyb0E7pjaHc`SHJzQe4Kb?(7(-pQS zexm}qc5Uoohyxs9Vf|(!j_7OgLf?50#um`x8sFmz54O%Vub=R;PabC-f4vtq|25&a zag7;yJv=f_muHvlgx$e0@41f>hr~7aEl;fIE!=k#x46MLnfE!FcLQ^rk#~V}%oFZg z!e!UZ6>tSyfj_AL_iVLn)6k<U;0m|`wF3Hm$mxnj#L6&yIvBzcfY@R>7~A^Os5N=S zB4TC85t>*j(MlyAF~rK5&m*shSQ%P5BpyB_URmM^MZ(oNe;(+N!qB5D;0i1&(6nw> z_y6Jd=l|s*@3{i5z`s&JTIESO;3LJob>-o7ug&SFbT#EwhII)WVJjwAx8f~&Fy?b@ V5Q~VFAu}}p5ePDPa0Px;fe+;1V^IJA literal 0 HcmV?d00001 diff --git a/HELP.md b/HELP.md new file mode 100644 index 0000000..952d84f --- /dev/null +++ b/HELP.md @@ -0,0 +1,18 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.3.4/maven-plugin) +* [Create an OCI image](https://docs.spring.io/spring-boot/3.3.4/maven-plugin/build-image.html) +* [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/3.3.4/reference/htmlsingle/index.html#using.devtools) +* [Resilience4J](https://docs.spring.io/spring-cloud-circuitbreaker/docs/current/reference/html/#configuring-resilience4j-circuit-breakers) + +### Maven Parent overrides + +Due to Maven's design, elements are inherited from the parent POM to the project POM. +While most of the inheritance is fine, it also inherits unwanted elements like `<license>` and `<developers>` from the parent. +To prevent this, the project POM contains empty overrides for these elements. +If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides. + diff --git a/mvnw b/mvnw new file mode 100755 index 0000000..19529dd --- /dev/null +++ b/mvnw @@ -0,0 +1,259 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.2 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash> +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..249bdf3 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,149 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.2 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash> +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..bd206d9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>3.3.4</version> + <relativePath/> <!-- lookup parent from repository --> + </parent> + <groupId>com.tarento</groupId> + <artifactId>training</artifactId> + <version>0.0.1-SNAPSHOT</version> + <name>training</name> + <description>Fault tolerance training project</description> + <url/> + <licenses> + <license/> + </licenses> + <developers> + <developer/> + </developers> + <scm> + <connection/> + <developerConnection/> + <tag/> + <url/> + </scm> + <properties> + <java.version>17</java.version> + <spring-cloud.version>2023.0.3</spring-cloud.version> + </properties> + <dependencies> + <dependency> + <groupId>io.github.resilience4j</groupId> + <artifactId>resilience4j-spring-boot2</artifactId> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-aop</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-devtools</artifactId> + <scope>runtime</scope> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.springframework.cloud</groupId> + <artifactId>spring-cloud-dependencies</artifactId> + <version>${spring-cloud.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <excludes> + <exclude> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/src/main/java/com/tarento/training/TrainingApplication.java b/src/main/java/com/tarento/training/TrainingApplication.java new file mode 100644 index 0000000..752f332 --- /dev/null +++ b/src/main/java/com/tarento/training/TrainingApplication.java @@ -0,0 +1,13 @@ +package com.tarento.training; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class TrainingApplication { + + public static void main(String[] args) { + SpringApplication.run(TrainingApplication.class, args); + } + +} diff --git a/src/main/java/com/tarento/training/config/GeocodingConfig.java b/src/main/java/com/tarento/training/config/GeocodingConfig.java new file mode 100644 index 0000000..f101f15 --- /dev/null +++ b/src/main/java/com/tarento/training/config/GeocodingConfig.java @@ -0,0 +1,15 @@ +package com.tarento.training.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.client.RestTemplate; + + +@Configuration +public class GeocodingConfig { + + @Bean + public RestTemplate restTemplate() { + return new RestTemplate(); + } +} diff --git a/src/main/java/com/tarento/training/controllers/GeocodeController.java b/src/main/java/com/tarento/training/controllers/GeocodeController.java new file mode 100644 index 0000000..53a499e --- /dev/null +++ b/src/main/java/com/tarento/training/controllers/GeocodeController.java @@ -0,0 +1,23 @@ +package com.tarento.training.controllers; + +import com.tarento.training.models.GeocodingResponse; +import com.tarento.training.services.GeocodingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api/geocoding") +public class GeocodeController { + + @Autowired + private GeocodingService geocodingService; + + @GetMapping("/address") + public GeocodingResponse getAddressInfo(@RequestParam("lat") double latitude, + @RequestParam("lng") double longitude) { + return geocodingService.getAddressInfo(latitude, longitude); + } +} diff --git a/src/main/java/com/tarento/training/models/GeocodingResponse.java b/src/main/java/com/tarento/training/models/GeocodingResponse.java new file mode 100644 index 0000000..ac074ec --- /dev/null +++ b/src/main/java/com/tarento/training/models/GeocodingResponse.java @@ -0,0 +1,39 @@ +package com.tarento.training.models; + +import lombok.*; + +import java.util.List; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter +@Builder +@ToString +public class GeocodingResponse { + private List<Result> results; + private String status; + + @AllArgsConstructor + @NoArgsConstructor + @Getter + @Setter + @Builder + @ToString + public static class Result { + private List<AddressComponent> address_components; + private String formatted_address; + } + + @AllArgsConstructor + @NoArgsConstructor + @Getter + @Setter + @Builder + @ToString + public static class AddressComponent { + private String long_name; + private String short_name; + private List<String> types; + } +} diff --git a/src/main/java/com/tarento/training/services/GeocodingService.java b/src/main/java/com/tarento/training/services/GeocodingService.java new file mode 100644 index 0000000..0b35ea5 --- /dev/null +++ b/src/main/java/com/tarento/training/services/GeocodingService.java @@ -0,0 +1,47 @@ +package com.tarento.training.services; + +import com.tarento.training.models.GeocodingResponse; +import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; + +@Service +@Slf4j +public class GeocodingService { + @Autowired + private RestTemplate restTemplate; + + @Value("${rapidapi.geocoding.url}") + private String geocodingUrl; + + @Value("${rapidapi.geocoding.key}") + private String apiKey; + + @Value("${rapidapi.geocoding.host}") + private String apiHost; + + @CircuitBreaker(name = "geocodingService", fallbackMethod = "fallbackGetAddressInfo") + public GeocodingResponse getAddressInfo(double latitude, double longitude) { + log.info("Getting address info..."); + String url = geocodingUrl + "?latlng=" + latitude + "," + longitude; + + RestTemplate restTemplate = new RestTemplate(); + restTemplate.getInterceptors().add((request, body, execution) -> { + request.getHeaders().set("x-rapidapi-host", apiHost); + request.getHeaders().set("x-rapidapi-key", apiKey); + return execution.execute(request, body); + }); + + return restTemplate.getForObject(url, GeocodingResponse.class); + } + + public GeocodingResponse fallbackGetAddressInfo(double latitude, double longitude, Throwable throwable) { + GeocodingResponse fallbackResponse = new GeocodingResponse(); + log.info("Getting address info from fallback..."); + fallbackResponse.setStatus("FALLBACK"); + return fallbackResponse; + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..435aa85 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,42 @@ +spring: + application: + name: training + +# Server +server: + port: 8500 + +# Geocode API +rapidapi: + geocoding: + url: https://map-geocoding.p.rapidapi.com/json + key: 5dc8f56a3cmsh36a1ab41f1c9cdcp1dfc1cjsn98445fe8106c + host: map-geocoding.p.rapidapi.com + +# Circuit Breaker +resilience4j: + circuitbreaker: + configs: + default: + registerHealthIndicator: true + slidingWindowSize: 10 + minimumNumberOfCalls: 5 + permittedNumberOfCallsInHalfOpenState: 3 + automaticTransitionFromOpenToHalfOpenEnabled: true + waitDurationInOpenState: 30s + failureRateThreshold: 50 + eventConsumerBufferSize: 50 + instances: + geocodingService: + baseConfig: default + +management: + endpoints: + web: + exposure: + include: '*' + endpoint: + health: + show-details: always + health: + circuitbreakers.enabled: true \ No newline at end of file diff --git a/src/test/java/com/tarento/training/TrainingApplicationTests.java b/src/test/java/com/tarento/training/TrainingApplicationTests.java new file mode 100644 index 0000000..d947784 --- /dev/null +++ b/src/test/java/com/tarento/training/TrainingApplicationTests.java @@ -0,0 +1,13 @@ +package com.tarento.training; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class TrainingApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/target/classes/application.yml b/target/classes/application.yml new file mode 100644 index 0000000..435aa85 --- /dev/null +++ b/target/classes/application.yml @@ -0,0 +1,42 @@ +spring: + application: + name: training + +# Server +server: + port: 8500 + +# Geocode API +rapidapi: + geocoding: + url: https://map-geocoding.p.rapidapi.com/json + key: 5dc8f56a3cmsh36a1ab41f1c9cdcp1dfc1cjsn98445fe8106c + host: map-geocoding.p.rapidapi.com + +# Circuit Breaker +resilience4j: + circuitbreaker: + configs: + default: + registerHealthIndicator: true + slidingWindowSize: 10 + minimumNumberOfCalls: 5 + permittedNumberOfCallsInHalfOpenState: 3 + automaticTransitionFromOpenToHalfOpenEnabled: true + waitDurationInOpenState: 30s + failureRateThreshold: 50 + eventConsumerBufferSize: 50 + instances: + geocodingService: + baseConfig: default + +management: + endpoints: + web: + exposure: + include: '*' + endpoint: + health: + show-details: always + health: + circuitbreakers.enabled: true \ No newline at end of file diff --git a/target/classes/com/tarento/training/TrainingApplication.class b/target/classes/com/tarento/training/TrainingApplication.class new file mode 100644 index 0000000000000000000000000000000000000000..4f9504e2ad44f6030c91657fafa0fd82355de2bf GIT binary patch literal 753 zcma)4OHbo45dK_R(w4G7c`Ph&;8uEA-}X|d#8%>zeQ1li2To2fts${1#{vEpCsupl z2k@iNjzcAK$YCR8#-7JF<8S8W_3tx)QyjKY!%~2H2MsJUtlx+`!4sjU{6};nW5=+3 zqO@{DhNa%|BtVm)7n_tjVWoD4J1fXf@fVB3*?gX;SU6>L8*Quv=yb4(4-9={r#zcm zioUiYmG{Qp^2iv+$Az(!N!4tw8KPeJ-q9!#SvI&VS;o$T4UWSq<k)B@9~>VUeXXXs z6;UEfCCKdE1BUv@TuFwtP-*!+Pa|nBd@MsZG_gn~!YY4X80&7PGI~t-zbyC)DUrmm z)2nKJLVjVVgt=MarkQ+`Zf3523eTC7mIB*jliOIHE8pdA1@oUhYYcn8a_v+qCn{6^ z^;#QOOolLqm82Ep5V<qNUcs7N4CgD&sl?s@M+j(l{8t0>+e31VZk#kD-RM7oJr?eD zlHLtU*&x|@3qTi}bZcP?+XUj1zZ76Vvm5mPp!NGb-!Cd?p8~9uFq+uGN3!qI-yniX Q)v#B{PuM5z%N_v#0C~m5kpKVy literal 0 HcmV?d00001 diff --git a/target/classes/com/tarento/training/config/GeocodingConfig.class b/target/classes/com/tarento/training/config/GeocodingConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..db461ac5c90a0e67e4ab709ccced9f631ac6a3db GIT binary patch literal 666 zcmb7BO-lnY5PfN@TWhuTTaVuSKm#7UR0S>QWl>Nmcud#0Mt75vX01O<PlAF!z#k<} zwpEMtVh$7L<-IpEnUBxccL4iXuAqQofKnA>7-y*8i3h<Gp<{m5zLSw-7~fM`xdVpc z+IlNMnPJn|n0Gr?>G;NqRQ8O$=RMixQKF=F{9Jb3rA#}CaI%8H`%jW8GAVb$62ow3 z1-Vj{$mkmt^Al+zb4@@q&lyThb1fNaq0;g+OWV?3igrTCY-l2pw1ibYAAluytGWzZ z;Xi6L7^-%tQwF}a9{yuAGFUm!v{R{Usji}K4z)H;IAwI+%qTCK*U3l6#SfJqNukNB za$zzX$z$cGod5G7+kP($yCeG>;o1Mj%;wEBunNCte+poJ(-f<eak?4ZV;e7E&-wEd zMgI&;V47mJPe2WI${1!aOD0~tlbZqMHw0HNn0O+rfM5O8kiI<7&k@JF&*$8QJTBrJ HT>`!UKX|K= literal 0 HcmV?d00001 diff --git a/target/classes/com/tarento/training/controllers/GeocodeController.class b/target/classes/com/tarento/training/controllers/GeocodeController.class new file mode 100644 index 0000000000000000000000000000000000000000..fce7ad31fa59e1ac9b62f0e89051a6de44dac3d9 GIT binary patch literal 1197 zcmb7DTTc@~6#k|cN^2>I0^$|%0_A}*YK#eLLLj0^Q3Hk-pQhWP3~qPo>@388rHRqR z2Y-M+%J}VqEyUI6!=5we`kl+3??1kN1MnD2H55>+pj1a0BLWlq>Ojd*MP2!_y{`i= zF!IPm#y=4#E;e_n7)7;$S{-Ll7q}bPp7hG;$Xn^1q9-E*8+m8LP`g-eXdBp$UK^;0 z(am)9+}7^E1X|!uD>qSmWdD_A7_m}A1LGA;)NvM*0?YpwF3{*|zuM_I9mmh3T`O>J zaecj+Uqz4ghbL;-(sAELv0f3F-AW>FdV0sirXA|lD6(F8L#x2UmUUej_Z`dLb*iTi zt$QomT1BzkRe`tey;Oq$xte%;Xq@gaZE1~=0^=<c=@&__t=((I^a7JD8>nzcIg`rA z%97tR#Jitg{a=?stkIAK`y|B^>jKr#M%`n1VpID)+j*tZ>OHrag5))IsN1q_qRz>F zHniVV{XUx~Nclj82@yu6IvTpb{OQpRKu*o@!9T-o>34~aeU^rRMRt|as4Gz0wuuY$ zQ<F|``nMl)IsN7Tw646)xPL$Vp9z+~>HN^F%Hd!dQuU1-90acOz6!idLCOmwKSybV z{5*MqoM%cpMM;ti^77Ibh>w|hnlv>7W0)aL6VL${FiS4dV?ikkenxGXy4unwR2G__ zG4_E{0mBSaS%x_jQ?KI;>FXjcWm#*u%vTXtXs;Hi1{KKaZP4K=ziV$GV$88CU?weo cK2^rJF?`-6<}I2FxSfSg^0h#DaS-182~FxmJOBUy literal 0 HcmV?d00001 diff --git a/target/classes/com/tarento/training/models/GeocodingResponse$AddressComponent$AddressComponentBuilder.class b/target/classes/com/tarento/training/models/GeocodingResponse$AddressComponent$AddressComponentBuilder.class new file mode 100644 index 0000000000000000000000000000000000000000..ecdc271b3f3f42b843fd7a3e4eb3289f34720d38 GIT binary patch literal 2544 zcmcIm?QR=I6g`u~-o$mWF(#!H+5}Rt(>8{FP{2vr#I&T6TToL45E9kc9wnQsXQJJ4 zr2gSKcnpw=Diw(b;Gqy_ysO69b*s`SKXzv4?wxbboI7)8|M~a%-vCx{r+^7edYCFA zhrB>}S02blAoX_RyUwoaT7mqsuYJ2JFj=c_&0rcc9tuUALQ!C=Yx)f<L#3^0*ih1w zGyA5ef~fJWGF{W7;h~E5jgHj9TCW$XC~BEL$DETftPlL4r$T|5!07GATK1JdrF}?h z(}o0WIvQ^kQF0s#(T)l2(ASyYE~0{W1akJtzKXb_c=o{hL8I+Qw&~$rfz{&?FQAGu zPO|p|Zq~B=US>IDQQxXC0q+-a4j%}d>B~LUGP*1655C>uTV$oSq`&cI=ve{+=N=BU z_513cKJX*I6R0(<jg{7CG^cW4`W>^!v}qMet9nhQVbkB%(hfqVVId{tayG^)r%bh& zeSuQj*XqHb-%;Ts$yhFc>B?YBhQ1po#wokwGx(3~<K^RJ8;N{^F#^_4E?oJ(vOA{t zy$rc`tqQrg-GsqN@=q@Q>`|3@1`?%zO|uxAzY|m@*KvniV7+$SAk6BtHE}5rs1h$z zAXpYQ%^>WmyT03dvzc17<fahkfr{*giL8ff0$2XmE@W+4H^xS+d;4+Lqf#DU6mSz? zdics6?XP)k4!QaI!0f3;OgujAcV*X_@QJ{0quVrbj6pY~?gc7ZXdAOP*l%XnI$}98 z@ez|h#{K6J|G36CM+HnES~3VWeXE+&SQhvtt6#d7FQpAhEw8<(<SXLx++nSDqhX0& z5p{v$J<Y1q3S<-wi*_1}B{FSF@I9;vT+E0(PCE}Rf%C6+<$V_mjd@-s6RgpbY<by1 z;6sk`?9a2GaF<WU#+!#<E)2iV9r4f8#v7Jj=lRy)OyMkx&mjI7x_`vhfdg~+n5_eM zQx<TM{b*=GI-ii%Jnc;aI+EVvr9avH&esW~p=M*31d7hddOoFh&Y_i4_@(jqr(YXC z)+WI(W$-JgVQR?#{wV+Q5P$MD_&c2i>f|5G<nhj*qa}%0VZ=BIi>Z}e!evHu%B@mc zr*QQzRDW80O7WiJG@tS_%#N2a4pkkSkt<kAaF>}Ghg%uNe2%lgt57RrP;=ZSE}fqp pS;OZ;+f`g=Kg~!t_%!(^$DavCuHq_J=Kh1KxW)c9*6|I_{s*`#jy?bY literal 0 HcmV?d00001 diff --git a/target/classes/com/tarento/training/models/GeocodingResponse$AddressComponent.class b/target/classes/com/tarento/training/models/GeocodingResponse$AddressComponent.class new file mode 100644 index 0000000000000000000000000000000000000000..3173714c2dfede0c80245bc6255533d99d18730f GIT binary patch literal 2819 zcmbtWYfl?T6g>le;h5qYLYg-;5Ws=B@3b+YfLj8MLsA@3wf#^n_6RntchK$_DgUHD zqm@D<rBZ)De^k{oyIcI&rD+4wGBbDXJ@?MNXYTmVzh3_V-~k$03<>NuRlA}sPr6!F zv}f6_?e16FswEx2@=&U#YEiHw{Uhc2a%Qd7@}%$ARGVws#02Xd+i6KJ4}nwxX=DU4 z%LLUc0>kqQyLsf0%3?&I_}n_SDvm{WPxhY6rXIls6tWmC;2n$!teh`0fe}Z!`#-r> zTMCrwU2hHT@kmwU?%e`P##i1yP@WESjd-Gfi<lHh>la7TXQ-idN83)NZu`2Lr_y@` zT*eiF!oJk?uBVClg}5)Hf31M)Mt_w0jZ=4K=Vk#@m=?%!=UM2n^bbncXNgt2Rlp2p z1unI%Ls?U9)6(DB`hYWETdroPoAYt+XGyx)2_Z9o4SV0UbjM@<W(G2_9LHR#3S{@f z@(cXH1DvmbXHko8QZ@2ZV61Mta=X*slio9H&!Ob%PRG@DTW-0>wr^9k=DJE-+Gc_b z2^`hlQ-|cWD?Llg7P0QVUBY$^oN8LmuI1Urc@#lPAJ}xYdd|Z$u*rUS@*;9kd@S{W zYCW|)Qd>)p?jF6(Arfo2z=Pe6kuOn|)c5<Se=#8ngEvaGF5}5_t|Ok0M<zW~q`};v zG||6-&S@21XWrq4>Ud4LVH+Y$##+~1(*S6&Eq%SIe4WLbz|#MsC>z1LQrc&mJPK>z zk7e*x9$#Z4i-+cJZt|*hJB{rgt3z1{BMh(WhSk){dm-?1Z?YoA5OmXWTaNT+>Pj7U zj;isS)+6aNG&xOB|FK6u?6lS1`yN5mEXQfsT2^!TMqneJzrof&f7)Ijh{dUH12wCl zZ$1zUq{x=byH;~7-w!(JAPRfgpeTAmvUnme8%t(Vj<Wbx;KskJ@*N5jifOjo9GmGd zhRjRD*^qe!f{|^XFW2p0K8HL;FpmZ9mnoUzX#R4)Lwx@V!@qDYaEJdh9L@e>G+zpK z(zuIMVCm8_McG986|&_!C&-r<Pf#o`onZV|%7=SUuAxFnIn>7o_>e1F29X*s6G5yd zk_q!j(e@+G3qb@%GDpeBl#CA3q)6o=g~jMdpTt7UM2D*oz`&<Xh$g0?o|vu&F@-+T zQB3`3<x3a?dWpPAQ7_P~Hv;jAOaLkl0?oV;h%YKLVd~aB+DnWN0?j4>h2{TrAXlH^ zUIcib5t;&If>I79>t=vB8ETvsFcTHflqM~L()4HW^JMtqe}y*;7D43+Z>ru8{{`+x zWUTi_AEVz{(T5kKOSMcuwNr;(id6?3FP|24ndvhWE0ur4C4N`=-FS`nfx)6o_Y|d+ tz_%2Cz8Ye!;LBiK#X83v(QEv+@QAA`^mYNOsPhgB&K`5z##8Lz^53fVesTZ+ literal 0 HcmV?d00001 diff --git a/target/classes/com/tarento/training/models/GeocodingResponse$GeocodingResponseBuilder.class b/target/classes/com/tarento/training/models/GeocodingResponse$GeocodingResponseBuilder.class new file mode 100644 index 0000000000000000000000000000000000000000..f7fca86c95253457852baf6abd3ed01419f7a04f GIT binary patch literal 2285 zcmb_dYflqF6g>l!g<7GY;sf7;w)m*;SHTA)h)I1!493To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6V+{WG?{i|2l literal 0 HcmV?d00001 diff --git a/target/classes/com/tarento/training/models/GeocodingResponse$Result$ResultBuilder.class b/target/classes/com/tarento/training/models/GeocodingResponse$Result$ResultBuilder.class new file mode 100644 index 0000000000000000000000000000000000000000..a50bec843714275f2a77185900437a1630a44080 GIT binary patch literal 2416 zcmb_ee@`1n5Pb{S2d)8|CZs8Ck|w0JNy7C<n$jH5fYbbtoV10AHp(B-+TMl>=Ua5Q zM#?wo$7rQgky5E2pdYI0+q<LKJ}U|lLfq~SGjHC^?9B4dzpwuWu!iqT7{j=Oi82Z( z3RIrU1L+1beCGbpdal|=pt$OXzF8L-uhn;^Fo`J#r83?_SzxoRyRMOu3XOJ6B&kWu zuI{KHcJC_P)*TAARJ^alSS@nX3rx0b_WYouB7r&C=|n1ypAw9E#EMCznK0=YKX99V zY&`3Eri@us1ggL4s4I<8ou`>CQBs41`nHMa)^ji?aQ$5<mQckho08K4mutgR@}BBD zb4=%%GCsgrfiqpXry4qJOY^gDcDaj<OrpB+HduLhfvIi(Stv~}QUY5;d{&#s3vnY& zcjGYI-nu8Su+<BV-&Oa+13&g#f!YW|ZKUx@-X=HD-Im^CO+yt)CY~k}4c1v;w&{oJ zVXxa#(IZJitF7BI*pZQM&zW$-?D|ByeN3{Wt_*$e<Pupw8Q}Rr?l1Na`Bxq&v#UEl z%1CyVQ4wSLZJ5LfRN{of_$8y(-wr1PU1-_H6<Ddg8z8GUX>{760;h;_G;^}X6)0`% zUes21e0!hfbCYD*nh@uqip@P88wZ~YTsu}9aKvnCZDLNX{j{|4Y!P3Ta2;PexM5rQ z8-c|mZhm;6_mrDbOuPGzY#SZDIJyZ*x--QT^qvemfr=NKTJQDty?m^Fk^#d<ym}+l zpY-Xc6WZ%fU<T2UL9p!`<xS#SfuHjEOWSHWU9w4B%g^C8arHuO)~<=VK>2>iNze#n z94od$F+~!X9)NVfcVqonby*x9Pb}21$iW8Za;`L^GVY)uaPG~jq@R`tpYV|x<0K#B z4<9&wKTJ*w_=sx}0v{)5zCzsh%L<h91*OF~?p*#=Sjo~Wh(8jO^ZZ%>;507qTTT_| z@*+?DP=c;6VIl!~kWc}fr7M5(^E*|?F$^_NC8}glc4xWs^8W9}N){-&Oi97wSF*r9 z9r8Sj&*;F0;Prc+PCSpjh37OgnIC%?jI4%wmZF=C&}O6Z7pjk!UNX3sn0|%#ZHReC zX|^gOv$cdP8RiOCi#c<M_ZsuSn-FJ4AQo^n;c#t$`*I?4@dejOdij#SE4aziMMhF( X$vxQrQL0$wy2kT&TyJ3$w{iAAZsvv- literal 0 HcmV?d00001 diff --git a/target/classes/com/tarento/training/models/GeocodingResponse$Result.class b/target/classes/com/tarento/training/models/GeocodingResponse$Result.class new file mode 100644 index 0000000000000000000000000000000000000000..6b35daacf19743675b8377510375970ab5cc1999 GIT binary patch literal 2760 zcmb_de^XmU6g>+e326#}0xec6R8*j}@khnB0TiMsXi6PG9LGPHC0XH>m$%G&8)o`V z{1`gZ+L=1z2k=8Vo_+5H9xu_64lv2?-t0a1+;eyD{`L3kKLIS`X%2k?YYp8h8|f?0 z=(6#p<2l|zxuu)R4a$#|Zs;ZrTPir#UZ7?;X}cyK*4mESRDJ;hnIZ;|7050Tz^n-L z&(7@@kVhtmL4ndUc_PcMB=pn$XR2WaaRtR3t`;$bVS)Q^!a`tFHk-Z*f<3yEA9Dy8 zs~!ex8^<lzoxoIVtdSx{aZO<4XYIG7F{-&2`w}H`2-$5LpXpW#bQv#V0@nq`50qK$ z5odIEE*;6bO&0MMZVHUit=1iEtmBmoH_C#%Q^YO2D{#Ffk5pBA4QYOG%pqrikzrzs zv*~!<#A8ZHaDl;X=fIPu?JI$;6vk5hV$#P-R6BxKRw@Fy{pchJ)R^AI0DGM%LT0Kw zf&#;J$5Wf_*1qz0<i1PG&8@a)oR-?~PMpA@Y1Q+zk;b7=wwA7L?du~RT~GOvbtcyP z|3|o8>#Q5n-Icy$L&fnj=FlPV;v1#K;1lOTpC5OCOHY(J)XndtFI&nepFs}NL@%K_ zJ<bSI-RT^|(`#}Gp?Ft<-go6%I<d+eNqnESUIGV;J4O~guHJYYE_pfZ_Po*2wHGLC z>$cxeHOHQ`iLUl{&vq6%Y^uPl>%ipjNZ{^;&O7_ln${*@t38emKro!easey&B8M++ z6Id0PIqR2>ccPC}Ibs;~g_>*_?LQazC7DsYF#=teUei^<OkL}v_Hm{A5F{+;9Cvs? zdu;zHu|MkIm1L`lA*#}Kw;iJ@c~k|e-TFnBeYU%8FN=k#uGYLP<^+lx9&d8hl|i6* zMY0iuz}09Hzd<>y3#?qI5;N&m#?qusIeg3Z(N&CI8t3pt;MRX{CH<%%nC457XV>rJ zKVLw;pi|*$nrl8(oaZr!+jx)b8Lp-{+Q0lC5I?>`|F4{r8Nag}fpL5g&p!-*8Ne(u zq30ew`)M1Ve}&xqotG%gFT6zQH=6nr03(>AWh&Z=dEDWOPBA$<v$XoKKx;7!X@8sM z>@F>XHj5Isl;S+@b@9o@nUv{b84p-KmPKEJ#c0SP!XJoPoKK8TGC5jF&VXK^VD(4> z-RJ={749jgnDMdhV)g>1G~i?p!1K&L!pE`XbpqOQWkb2sN{@v|6VZ-SrL(cpXZl)8 zN8bSv>KkS7Nh*U+aX*&iQ8I8?;-n`37T6XxDkH<#5}wcNvr~Z{5Z;z<X#RJM@pI!f z-UiZ2O(c{W>QTcC7Q;e(jtAlR5EYJjA}{f?hOfA~O(n13A-?7%5S-OGKIVFZ<2R^d H6O;b{Tbr<6 literal 0 HcmV?d00001 diff --git a/target/classes/com/tarento/training/models/GeocodingResponse.class b/target/classes/com/tarento/training/models/GeocodingResponse.class new file mode 100644 index 0000000000000000000000000000000000000000..d2810ef63d10e370e2d9d8204d1b5ba0b5827e59 GIT binary patch literal 2872 zcmbtW0aF`A6#f=ME(s|_+S1l)1&tLbZM4?fHb8|ag*MPi5XW&G=SX(o%H@{1+c49A z;?K~T*3Q%!e}F&A@!PutE|=6X2$SsX%iC|i_r14o@2|h#{0U$Y-&q(ESZ%6yMccmg zw5n*|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-n1n1CI9r>}K{UK8q!< z6VRk98_Jzlx)35wMjj_hXJe&L^);4beMdy7Zxq4pR0N;nPAtiT<i=r&lbXD3W0Tk@ zjoikhusg0VP6WC~c$2!Zx!-YtpUZFX9*|b5m{4l0PYyG<8z$mQ+~a88L<R1n%J<xd vSf(Y%`3gU4c+A=Du)s(0gva4N%e>BUk>du(DlMBFAJX!a<1=hw8(01TEw9be literal 0 HcmV?d00001 diff --git a/target/classes/com/tarento/training/services/GeocodingService.class b/target/classes/com/tarento/training/services/GeocodingService.class new file mode 100644 index 0000000000000000000000000000000000000000..02f60ec7f17119b1e6c369060c62cc8e3adad03c GIT binary patch literal 4256 zcmcIn`&S#s75+v73B=k^Ikt-v9PH5WGFqo`+Y~uT5jKWciBm&xQ@3eX(g15#yUOke zOx?8U`~7~U>AOuIKlXK;+Bxm%&prK{diu@oN-Q8q`Jsm+cIVFAx!=9>&AoU3^`HCy z0PrOKkV6XTEV>MIBO@?y%i6F^$8uNAYn5BFssu6@ZP!*$38crymwVBJ-Yjwk`d|nY zs$ShxmM>l9naa1glA3|^H|(km%q!BXdNqm`BMJ9#yj6jG+4H%~S-Eh_EPJb~(l7Sl zsKCi9QYkJUwrVwB2EnlHu6Tt)p$`LiM;3Vl$M66_?$#FQ(klgykCnF_SX4guDn_7B z7&wV{3K**`OfUG3MzUvpo`E@K;6Xe@Ky_<f&U$XuQa5b1#<xIOt_lRkI#{}NX?*W? zS)3M_3=uapo)zD!%T3Q;H#cR)tU5MhXI__qT9WmKV=0-#5YqbJ83SkWh(Q0UR12<> zepNP<=hJw8EH>0swqus<Ko#>4c$a}kF)Gk&w^j=@#>$5~qvCjUIJ>~EDb;A9oee?H zQ*vFt+$8h_x?&&3F_FcjfpeG=I2y*cjgt)E+3q^1h-t;~4`*QtOm)Ot_iEBfFp3dt z@HE0`J!atDcsx8?HRt&);y%;ih!W>B>sUchyqS=+aO@T3P(Zo|?`4cTQFM64_v*td zmg7{c>N*MAgC_)f=4Q&}(#-5ttv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?1E0pL4B3Lqni-Z}NqWA)n!G1SoensQ-wB*Pcqtp2hz&SHiz$9xbmNr%d}7D` z5=R+6KgMSYABV;FN-V2}GJdqgvOYd*{K)_-T+CK!@5Cx6*w5{qSff!E(9oF8jZKaO zpWPF0Li{PTbc_Er7T^fh`CsGHSRK^)6ma1o4XykJrCB~pe?~Tc<R1D{nD{G>kB;BR zATZti7KUDY6Aw>k1~YdtJaHc*z&(tmaAPnt*qtw=|BlpMoc|{Zf8;JHXv-(KC-4yT zhtEkojA8yg#?Kjz<U%-CijmMR8hANGSAx&CG&Lp>(C=<)oekrdfud$_ic7&o2*Wx+ zr6vt-1lYvw09zby;S-c-x9;$%-5Poe1>(OjozeciC-iSHlYie`ynisWjW~}kE}lRy zZ6D*u&M8bK&<?fH4z<w^#b{}Q#y&~3y?6kx;8TpdMtdaPMtcVsNNH}y*f!~;Ha9wX z4;R^!lo;?!cX1^iKFi@X4yPv1-NW@Xwox9XBFMac#^p2~2@y_2TeT66;xqVc7|&6B z4xgt<8p0RwMe2Tu?_HexGP(QJHhs>7s~O*X&)@K&zaXnAB*KG?C}dFSYm}w%^){iu i!SOfw%TxL-uKodjL<2v^FZla4<vGfJgWux!82m4LAI(?* literal 0 HcmV?d00001 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..d835130 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +/Users/praveen.m/Desktop/Workspace/Trainings/training/src/main/java/com/tarento/training/TrainingApplication.java +/Users/praveen.m/Desktop/Workspace/Trainings/training/src/main/java/com/tarento/training/config/GeocodingConfig.java +/Users/praveen.m/Desktop/Workspace/Trainings/training/src/main/java/com/tarento/training/controllers/GeocodeController.java -- GitLab