├── .gitignore ├── review-microservice ├── .gitignore ├── bin │ ├── .gitignore │ ├── com │ │ ├── review │ │ │ ├── model │ │ │ │ └── Review.class │ │ │ ├── service │ │ │ │ └── ReviewService.class │ │ │ ├── ReviewMicroserviceApplication.class │ │ │ ├── controllers │ │ │ │ └── ReviewController.class │ │ │ └── repositories │ │ │ │ └── IProductRatingRepo.class │ │ └── example │ │ │ └── ReviewMicroserviceApplicationTests.class │ └── application.properties ├── .gradle │ └── 2.13 │ │ └── taskArtifacts │ │ ├── cache.properties │ │ ├── fileHashes.bin │ │ ├── fileSnapshots.bin │ │ ├── taskArtifacts.bin │ │ └── cache.properties.lock ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .settings │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── gradle │ │ ├── org.springsource.ide.eclipse.gradle.core.prefs │ │ └── org.springsource.ide.eclipse.gradle.refresh.prefs │ └── org.eclipse.jdt.core.prefs ├── src │ ├── main │ │ ├── docker │ │ │ └── Dockerfile │ │ ├── resources │ │ │ ├── persistence.sql │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── review │ │ │ ├── ReviewMicroserviceApplication.java │ │ │ ├── repositories │ │ │ └── IProductRatingRepo.java │ │ │ ├── model │ │ │ └── Review.java │ │ │ ├── service │ │ │ └── ReviewService.java │ │ │ └── controllers │ │ │ └── ReviewController.java │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── ReviewMicroserviceApplicationTests.java ├── .project ├── build.gradle ├── gradlew.bat └── gradlew ├── customer-microservice ├── .gitignore ├── bin │ ├── target │ │ └── classes │ │ │ └── application.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── CustomerMicroserviceApplication.class │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── CustomerMicroserviceApplicationTests.class │ ├── .settings │ │ ├── org.eclipse.core.resources.prefs │ │ └── org.eclipse.m2e.core.prefs │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── .project │ ├── pom.xml │ └── mvnw.cmd ├── src │ └── main │ │ ├── resources │ │ ├── application.properties │ │ ├── db.properties │ │ └── rabbitmq.properties │ │ ├── docker │ │ └── Dockerfile │ │ └── java │ │ └── com │ │ └── sjsu │ │ └── cmpe282 │ │ ├── repository │ │ ├── ICustomerRepository.java │ │ └── CustomerRepository.java │ │ ├── service │ │ ├── ICustomerService.java │ │ └── CustomerService.java │ │ ├── CustomerMicroserviceApplication.java │ │ ├── exception │ │ ├── ServiceException.java │ │ ├── RecordNotFoundException.java │ │ └── GlobalControllerExceptionHandler.java │ │ ├── controller │ │ ├── IBaseRestController.java │ │ └── CustomerController.java │ │ ├── rabbitmq │ │ ├── TaskProducer.java │ │ ├── TaskProducerConfiguration.java │ │ ├── TaskMessage.java │ │ └── RabbitMqConfiguration.java │ │ ├── util │ │ └── DatabaseUtil.java │ │ └── model │ │ └── Customer.java ├── README.md ├── .settings │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.wst.common.project.facet.core.xml │ └── org.eclipse.jdt.core.prefs ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── ddl │ └── cassandra.ddl ├── .project ├── .classpath ├── pom.xml └── mvnw.cmd ├── recommendation-microservice ├── bin │ ├── .gitignore │ ├── application.properties │ └── com │ │ ├── example │ │ └── RecommendationMicroserviceApplicationTests.class │ │ └── recommendation │ │ └── RecommendationMicroserviceApplication.class ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── recommendation │ │ │ └── RecommendationMicroserviceApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── RecommendationMicroserviceApplicationTests.java ├── .gradle │ └── 2.13 │ │ └── taskArtifacts │ │ ├── cache.properties │ │ ├── fileHashes.bin │ │ ├── fileSnapshots.bin │ │ ├── taskArtifacts.bin │ │ └── cache.properties.lock ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .settings │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── gradle │ │ ├── org.springsource.ide.eclipse.gradle.core.prefs │ │ └── org.springsource.ide.eclipse.gradle.refresh.prefs │ └── org.eclipse.jdt.core.prefs ├── .project ├── build.gradle ├── gradlew.bat └── gradlew ├── order-microservice ├── bin │ ├── application.properties │ └── com │ │ ├── order │ │ ├── model │ │ │ └── Order.class │ │ ├── services │ │ │ └── OrderService.class │ │ ├── controllers │ │ │ └── OrderController.class │ │ ├── OrderMicroserviceApplication.class │ │ └── repositories │ │ │ └── IOrderDetailsRepository.class │ │ └── example │ │ └── OrderMicroserviceApplicationTests.class ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── order │ │ │ ├── OrderMicroserviceApplication.java │ │ │ ├── repositories │ │ │ └── IOrderDetailsRepository.java │ │ │ ├── services │ │ │ └── OrderService.java │ │ │ ├── model │ │ │ └── Order.java │ │ │ └── controllers │ │ │ └── OrderController.java │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── OrderMicroserviceApplicationTests.java ├── .gradle │ └── 2.13 │ │ └── taskArtifacts │ │ ├── cache.properties │ │ ├── fileHashes.bin │ │ ├── fileSnapshots.bin │ │ ├── taskArtifacts.bin │ │ └── cache.properties.lock ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .settings │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── gradle │ │ ├── org.springsource.ide.eclipse.gradle.core.prefs │ │ └── org.springsource.ide.eclipse.gradle.refresh.prefs │ └── org.eclipse.jdt.core.prefs ├── build.gradle ├── .project ├── gradlew.bat └── gradlew ├── gateway-microservice ├── src │ └── main │ │ ├── resources │ │ └── application.properties │ │ ├── docker │ │ └── Dockerfile │ │ └── java │ │ └── com │ │ └── gateway │ │ ├── GatewayMicroserviceApplication.java │ │ ├── model │ │ ├── Inventory.java │ │ ├── Review.java │ │ ├── Product.java │ │ ├── ViewProduct.java │ │ └── Customer.java │ │ ├── controller │ │ └── GatewayController.java │ │ └── service │ │ └── GatewayService.java ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── .gitignore ├── pom.xml ├── mvnw.cmd └── mvnw ├── email-rabbit-microservice ├── src │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── rabbitmq.properties │ │ ├── docker │ │ └── Dockerfile │ │ └── java │ │ └── com │ │ └── email │ │ ├── TaskMessage.java │ │ ├── Receiver.java │ │ ├── EmailRabbitMicroserviceApplication.java │ │ └── Mail.java ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── .gitignore ├── pom.xml └── mvnw.cmd ├── eshop-ui ├── cart.png ├── target │ └── eshop-ui.war ├── libs │ └── bootstrap │ │ └── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 ├── product.html ├── index.html ├── homepage.html ├── style.css ├── login.js ├── register.js ├── products.js ├── login.html ├── register.html └── viewproduct.js ├── wiki-images └── Architecture.png ├── products-microservice ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── src │ └── main │ │ ├── docker │ │ └── Dockerfile │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── products │ │ ├── ProductsMicroserviceApplication.java │ │ ├── repositories │ │ └── IProductDetailsRepository.java │ │ ├── model │ │ ├── Inventory.java │ │ └── Product.java │ │ ├── controllers │ │ └── ProductController.java │ │ └── services │ │ └── ProductService.java ├── .gitignore ├── pom.xml └── mvnw.cmd ├── product-inventory-microservice ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.properties │ │ └── maven-wrapper.jar ├── src │ └── main │ │ ├── docker │ │ └── Dockerfile │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── inventory │ │ ├── ProductInventoryMicroserviceApplication.java │ │ ├── repository │ │ └── InventoryRepository.java │ │ ├── service │ │ └── InventoryService.java │ │ ├── model │ │ └── Inventory.java │ │ └── controller │ │ └── InventoryController.java ├── .gitignore ├── pom.xml └── mvnw.cmd ├── .project ├── package-ui.sh └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_STORE 2 | -------------------------------------------------------------------------------- /review-microservice/.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | -------------------------------------------------------------------------------- /customer-microservice/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /recommendation-microservice/bin/.gitignore: -------------------------------------------------------------------------------- 1 | /com/ 2 | -------------------------------------------------------------------------------- /recommendation-microservice/bin/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /customer-microservice/bin/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /order-microservice/bin/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8083 -------------------------------------------------------------------------------- /customer-microservice/bin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /review-microservice/bin/.gitignore: -------------------------------------------------------------------------------- 1 | /persistence.sql 2 | /com/ 3 | -------------------------------------------------------------------------------- /recommendation-microservice/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gateway-microservice/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8086 -------------------------------------------------------------------------------- /order-microservice/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8083 -------------------------------------------------------------------------------- /email-rabbit-microservice/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8082 -------------------------------------------------------------------------------- /customer-microservice/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | -------------------------------------------------------------------------------- /order-microservice/.gradle/2.13/taskArtifacts/cache.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 15 10:45:27 PDT 2016 2 | -------------------------------------------------------------------------------- /review-microservice/.gradle/2.13/taskArtifacts/cache.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 15 14:27:50 PDT 2016 2 | -------------------------------------------------------------------------------- /eshop-ui/cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/eshop-ui/cart.png -------------------------------------------------------------------------------- /customer-microservice/README.md: -------------------------------------------------------------------------------- 1 | # customer-microservice 2 | Customer Micro-service for Book Store App 3 | -------------------------------------------------------------------------------- /recommendation-microservice/.gradle/2.13/taskArtifacts/cache.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 15 14:23:41 PDT 2016 2 | -------------------------------------------------------------------------------- /eshop-ui/target/eshop-ui.war: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/eshop-ui/target/eshop-ui.war -------------------------------------------------------------------------------- /wiki-images/Architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/wiki-images/Architecture.png -------------------------------------------------------------------------------- /customer-microservice/bin/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /email-rabbit-microservice/src/main/resources/rabbitmq.properties: -------------------------------------------------------------------------------- 1 | spring.rabbitmq.host=172.17.0.1 2 | spring.rabbitmq.port=5672 3 | -------------------------------------------------------------------------------- /customer-microservice/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /gateway-microservice/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/gateway-microservice/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /order-microservice/bin/com/order/model/Order.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/bin/com/order/model/Order.class -------------------------------------------------------------------------------- /customer-microservice/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/customer-microservice/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /customer-microservice/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip 2 | -------------------------------------------------------------------------------- /customer-microservice/bin/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles=pom.xml 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /gateway-microservice/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip 2 | -------------------------------------------------------------------------------- /order-microservice/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /products-microservice/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/products-microservice/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /products-microservice/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip 2 | -------------------------------------------------------------------------------- /review-microservice/bin/com/review/model/Review.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/bin/com/review/model/Review.class -------------------------------------------------------------------------------- /review-microservice/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /customer-microservice/bin/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/customer-microservice/bin/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /customer-microservice/bin/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip 2 | -------------------------------------------------------------------------------- /customer-microservice/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | cmpe282.db.contactpoints=127.0.0.1,localhost,172.17.0.2 2 | cmpe282.db.port=9042 3 | cmpe282.db.keyspace=cmpe282project 4 | -------------------------------------------------------------------------------- /email-rabbit-microservice/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/email-rabbit-microservice/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /email-rabbit-microservice/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip 2 | -------------------------------------------------------------------------------- /product-inventory-microservice/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip 2 | -------------------------------------------------------------------------------- /order-microservice/.gradle/2.13/taskArtifacts/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/.gradle/2.13/taskArtifacts/fileHashes.bin -------------------------------------------------------------------------------- /order-microservice/bin/com/order/services/OrderService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/bin/com/order/services/OrderService.class -------------------------------------------------------------------------------- /product-inventory-microservice/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/product-inventory-microservice/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /recommendation-microservice/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/recommendation-microservice/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /review-microservice/.gradle/2.13/taskArtifacts/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/.gradle/2.13/taskArtifacts/fileHashes.bin -------------------------------------------------------------------------------- /eshop-ui/libs/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/eshop-ui/libs/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /eshop-ui/libs/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/eshop-ui/libs/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /eshop-ui/libs/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/eshop-ui/libs/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /order-microservice/.gradle/2.13/taskArtifacts/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/.gradle/2.13/taskArtifacts/fileSnapshots.bin -------------------------------------------------------------------------------- /order-microservice/.gradle/2.13/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/.gradle/2.13/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /review-microservice/bin/com/review/service/ReviewService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/bin/com/review/service/ReviewService.class -------------------------------------------------------------------------------- /eshop-ui/libs/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/eshop-ui/libs/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /order-microservice/bin/com/order/controllers/OrderController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/bin/com/order/controllers/OrderController.class -------------------------------------------------------------------------------- /review-microservice/.gradle/2.13/taskArtifacts/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/.gradle/2.13/taskArtifacts/fileSnapshots.bin -------------------------------------------------------------------------------- /review-microservice/.gradle/2.13/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/.gradle/2.13/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /customer-microservice/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding/=UTF-8 5 | -------------------------------------------------------------------------------- /customer-microservice/src/main/resources/rabbitmq.properties: -------------------------------------------------------------------------------- 1 | spring.rabbitmq.host=localhost,172.17.0.2 2 | spring.rabbitmq.port=5672 3 | spring.rabbitmq.username=admin 4 | spring.rabbitmq.password=secret -------------------------------------------------------------------------------- /order-microservice/.gradle/2.13/taskArtifacts/cache.properties.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/.gradle/2.13/taskArtifacts/cache.properties.lock -------------------------------------------------------------------------------- /order-microservice/bin/com/order/OrderMicroserviceApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/bin/com/order/OrderMicroserviceApplication.class -------------------------------------------------------------------------------- /review-microservice/.gradle/2.13/taskArtifacts/cache.properties.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/.gradle/2.13/taskArtifacts/cache.properties.lock -------------------------------------------------------------------------------- /email-rabbit-microservice/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD email-1.0.jar email.jar 3 | EXPOSE 8082 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","email.jar"] 5 | 6 | -------------------------------------------------------------------------------- /gateway-microservice/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD gateway-1.0.jar gateway.jar 3 | EXPOSE 8086 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","gateway.jar"] 5 | 6 | -------------------------------------------------------------------------------- /recommendation-microservice/.gradle/2.13/taskArtifacts/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/recommendation-microservice/.gradle/2.13/taskArtifacts/fileHashes.bin -------------------------------------------------------------------------------- /review-microservice/bin/com/review/ReviewMicroserviceApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/bin/com/review/ReviewMicroserviceApplication.class -------------------------------------------------------------------------------- /review-microservice/bin/com/review/controllers/ReviewController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/bin/com/review/controllers/ReviewController.class -------------------------------------------------------------------------------- /recommendation-microservice/.gradle/2.13/taskArtifacts/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/recommendation-microservice/.gradle/2.13/taskArtifacts/fileSnapshots.bin -------------------------------------------------------------------------------- /recommendation-microservice/.gradle/2.13/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/recommendation-microservice/.gradle/2.13/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /review-microservice/bin/com/review/repositories/IProductRatingRepo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/bin/com/review/repositories/IProductRatingRepo.class -------------------------------------------------------------------------------- /order-microservice/bin/com/example/OrderMicroserviceApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/bin/com/example/OrderMicroserviceApplicationTests.class -------------------------------------------------------------------------------- /order-microservice/bin/com/order/repositories/IOrderDetailsRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/order-microservice/bin/com/order/repositories/IOrderDetailsRepository.class -------------------------------------------------------------------------------- /recommendation-microservice/.gradle/2.13/taskArtifacts/cache.properties.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/recommendation-microservice/.gradle/2.13/taskArtifacts/cache.properties.lock -------------------------------------------------------------------------------- /review-microservice/bin/com/example/ReviewMicroserviceApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/review-microservice/bin/com/example/ReviewMicroserviceApplicationTests.class -------------------------------------------------------------------------------- /product-inventory-microservice/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD inventory-1.0.jar inventory.jar 3 | EXPOSE 8084 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","inventory.jar"] 5 | 6 | -------------------------------------------------------------------------------- /products-microservice/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD products-1.0.jar productservice.jar 3 | EXPOSE 8081 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","productservice.jar"] 5 | 6 | -------------------------------------------------------------------------------- /customer-microservice/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD customer-1.0.jar customerservice.jar 3 | EXPOSE 8080 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","customerservice.jar"] 5 | 6 | -------------------------------------------------------------------------------- /order-microservice/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /review-microservice/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /customer-microservice/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /recommendation-microservice/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /review-microservice/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD ReviewMicroservice-0.0.1-SNAPSHOT.jar reviewservice.jar 3 | EXPOSE 8085 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","reviewservice.jar"] 5 | 6 | -------------------------------------------------------------------------------- /customer-microservice/bin/src/main/java/com/example/CustomerMicroserviceApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/customer-microservice/bin/src/main/java/com/example/CustomerMicroserviceApplication.class -------------------------------------------------------------------------------- /recommendation-microservice/bin/com/example/RecommendationMicroserviceApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/recommendation-microservice/bin/com/example/RecommendationMicroserviceApplicationTests.class -------------------------------------------------------------------------------- /customer-microservice/bin/src/test/java/com/example/CustomerMicroserviceApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/customer-microservice/bin/src/test/java/com/example/CustomerMicroserviceApplicationTests.class -------------------------------------------------------------------------------- /recommendation-microservice/bin/com/recommendation/RecommendationMicroserviceApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandyarathi/eshop-microservice/HEAD/recommendation-microservice/bin/com/recommendation/RecommendationMicroserviceApplication.class -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | eshop-microservice 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /order-microservice/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 6 | -------------------------------------------------------------------------------- /review-microservice/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 6 | -------------------------------------------------------------------------------- /recommendation-microservice/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 6 | -------------------------------------------------------------------------------- /review-microservice/src/main/resources/persistence.sql: -------------------------------------------------------------------------------- 1 | -- user=root, password=Test_123 2 | Create database reviewDB; 3 | Create table `review`( 4 | `productId` VARCHAR(100) NOT NULL, 5 | `rating` int(1) NOT NULL, 6 | `customerId` VARCHAR(100) NOT NULL, 7 | primary key (`productId`) 8 | ); 9 | -------------------------------------------------------------------------------- /customer-microservice/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 3 | org.eclipse.jdt.core.compiler.compliance=1.8 4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 | org.eclipse.jdt.core.compiler.source=1.8 6 | -------------------------------------------------------------------------------- /order-microservice/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences 2 | #Mon Aug 15 10:45:25 PDT 2016 3 | build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=; 4 | org.springsource.ide.eclipse.gradle.rootprojectloc= 5 | -------------------------------------------------------------------------------- /review-microservice/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences 2 | #Mon Aug 15 14:27:48 PDT 2016 3 | build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=; 4 | org.springsource.ide.eclipse.gradle.rootprojectloc= 5 | -------------------------------------------------------------------------------- /recommendation-microservice/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences 2 | #Mon Aug 15 14:23:39 PDT 2016 3 | build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=; 4 | org.springsource.ide.eclipse.gradle.rootprojectloc= 5 | -------------------------------------------------------------------------------- /products-microservice/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.data.mongodb.uri=mongodb://sandy009994036:009994036@dbh54.mongolab.com:27547/273assignment2db 2 | #spring.data.mongodb.host=172.17.0.1 3 | #spring.data.mongodb.port=27017 4 | #spring.data.mongodb.repositories.enabled=true 5 | #spring.data.mongodb.database=productDB 6 | server.port=8081 -------------------------------------------------------------------------------- /product-inventory-microservice/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.data.mongodb.uri=mongodb://sandy009994036:009994036@dbh54.mongolab.com:27547/273assignment2db 2 | #spring.data.mongodb.host=172.17.0.1 3 | #spring.data.mongodb.port=27017 4 | #spring.data.mongodb.repositories.enabled=true 5 | #spring.data.mongodb.database=inventoryDB 6 | server.port=8084 -------------------------------------------------------------------------------- /gateway-microservice/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .classpath 6 | .factorypath 7 | .project 8 | .settings 9 | .springBeans 10 | 11 | ### IntelliJ IDEA ### 12 | .idea 13 | *.iws 14 | *.iml 15 | *.ipr 16 | 17 | ### NetBeans ### 18 | nbproject/private/ 19 | build/ 20 | nbbuild/ 21 | dist/ 22 | nbdist/ 23 | .nb-gradle/ -------------------------------------------------------------------------------- /products-microservice/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .classpath 6 | .factorypath 7 | .project 8 | .settings 9 | .springBeans 10 | 11 | ### IntelliJ IDEA ### 12 | .idea 13 | *.iws 14 | *.iml 15 | *.ipr 16 | 17 | ### NetBeans ### 18 | nbproject/private/ 19 | build/ 20 | nbbuild/ 21 | dist/ 22 | nbdist/ 23 | .nb-gradle/ -------------------------------------------------------------------------------- /email-rabbit-microservice/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .classpath 6 | .factorypath 7 | .project 8 | .settings 9 | .springBeans 10 | 11 | ### IntelliJ IDEA ### 12 | .idea 13 | *.iws 14 | *.iml 15 | *.ipr 16 | 17 | ### NetBeans ### 18 | nbproject/private/ 19 | build/ 20 | nbbuild/ 21 | dist/ 22 | nbdist/ 23 | .nb-gradle/ -------------------------------------------------------------------------------- /product-inventory-microservice/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .classpath 6 | .factorypath 7 | .project 8 | .settings 9 | .springBeans 10 | 11 | ### IntelliJ IDEA ### 12 | .idea 13 | *.iws 14 | *.iml 15 | *.ipr 16 | 17 | ### NetBeans ### 18 | nbproject/private/ 19 | build/ 20 | nbbuild/ 21 | dist/ 22 | nbdist/ 23 | .nb-gradle/ -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/repository/ICustomerRepository.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.repository; 2 | 3 | import com.sjsu.cmpe282.model.Customer; 4 | 5 | 6 | public interface ICustomerRepository { 7 | 8 | public Customer createCustomer(Customer customer); 9 | 10 | public boolean authenticateCustomer(Customer customer); 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /customer-microservice/ddl/cassandra.ddl: -------------------------------------------------------------------------------- 1 | CREATE KEYSPACE cmpe282project WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; 2 | 3 | use cmpe282project; 4 | 5 | CREATE TABLE customer(customer_id uuid PRIMARY KEY, email text, password text, first_name text, last_name text, created timestamp); 6 | CREATE INDEX ON customer (email); 7 | 8 | -------------------------------------------------------------------------------- /order-microservice/.settings/gradle/org.springsource.ide.eclipse.gradle.refresh.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.actions.GradleRefreshPreferences 2 | #Mon Aug 15 10:45:28 PDT 2016 3 | addResourceFilters=true 4 | afterTasks=afterEclipseImport; 5 | beforeTasks=cleanEclipse;eclipse; 6 | enableAfterTasks=true 7 | enableBeforeTasks=true 8 | enableDSLD=false 9 | useHierarchicalNames=false 10 | -------------------------------------------------------------------------------- /review-microservice/.settings/gradle/org.springsource.ide.eclipse.gradle.refresh.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.actions.GradleRefreshPreferences 2 | #Mon Aug 15 14:27:51 PDT 2016 3 | addResourceFilters=true 4 | afterTasks=afterEclipseImport; 5 | beforeTasks=cleanEclipse;eclipse; 6 | enableAfterTasks=true 7 | enableBeforeTasks=true 8 | enableDSLD=false 9 | useHierarchicalNames=false 10 | -------------------------------------------------------------------------------- /recommendation-microservice/.settings/gradle/org.springsource.ide.eclipse.gradle.refresh.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.actions.GradleRefreshPreferences 2 | #Mon Aug 15 14:23:42 PDT 2016 3 | addResourceFilters=true 4 | afterTasks=afterEclipseImport; 5 | beforeTasks=cleanEclipse;eclipse; 6 | enableAfterTasks=true 7 | enableBeforeTasks=true 8 | enableDSLD=false 9 | useHierarchicalNames=false 10 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/service/ICustomerService.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import com.sjsu.cmpe282.model.Customer; 6 | 7 | @Service 8 | public interface ICustomerService { 9 | 10 | public Customer createCustomer(Customer customer); 11 | 12 | 13 | public boolean authenticateCustomer(Customer customer); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /order-microservice/src/main/java/com/order/OrderMicroserviceApplication.java: -------------------------------------------------------------------------------- 1 | package com.order; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class OrderMicroserviceApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(OrderMicroserviceApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /review-microservice/src/main/java/com/review/ReviewMicroserviceApplication.java: -------------------------------------------------------------------------------- 1 | package com.review; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ReviewMicroserviceApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ReviewMicroserviceApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /gateway-microservice/src/main/java/com/gateway/GatewayMicroserviceApplication.java: -------------------------------------------------------------------------------- 1 | package com.gateway; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class GatewayMicroserviceApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(GatewayMicroserviceApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /products-microservice/src/main/java/com/products/ProductsMicroserviceApplication.java: -------------------------------------------------------------------------------- 1 | package com.products; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ProductsMicroserviceApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ProductsMicroserviceApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/CustomerMicroserviceApplication.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class CustomerMicroserviceApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(CustomerMicroserviceApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /order-microservice/src/main/java/com/order/repositories/IOrderDetailsRepository.java: -------------------------------------------------------------------------------- 1 | package com.order.repositories; 2 | 3 | import java.util.UUID; 4 | 5 | import org.springframework.data.mongodb.repository.MongoRepository; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.order.model.Order; 9 | 10 | 11 | @Service 12 | public interface IOrderDetailsRepository extends MongoRepository { 13 | 14 | public Order findById(UUID id); 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /order-microservice/src/test/java/com/example/OrderMicroserviceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class OrderMicroserviceApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /review-microservice/src/test/java/com/example/ReviewMicroserviceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class ReviewMicroserviceApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /product-inventory-microservice/src/main/java/com/inventory/ProductInventoryMicroserviceApplication.java: -------------------------------------------------------------------------------- 1 | package com.inventory; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ProductInventoryMicroserviceApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ProductInventoryMicroserviceApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /recommendation-microservice/src/main/java/com/recommendation/RecommendationMicroserviceApplication.java: -------------------------------------------------------------------------------- 1 | package com.recommendation; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RecommendationMicroserviceApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RecommendationMicroserviceApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /recommendation-microservice/src/test/java/com/example/RecommendationMicroserviceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class RecommendationMicroserviceApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /review-microservice/src/main/java/com/review/repositories/IProductRatingRepo.java: -------------------------------------------------------------------------------- 1 | package com.review.repositories; 2 | 3 | import java.util.List; 4 | import java.util.UUID; 5 | 6 | import org.springframework.data.repository.CrudRepository; 7 | 8 | import com.review.model.Review; 9 | 10 | public interface IProductRatingRepo extends CrudRepository{ 11 | 12 | public List find(UUID productId); 13 | 14 | public Review save(Review review); 15 | 16 | public Review update(Review review); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /product-inventory-microservice/src/main/java/com/inventory/repository/InventoryRepository.java: -------------------------------------------------------------------------------- 1 | package com.inventory.repository; 2 | 3 | import java.util.UUID; 4 | 5 | import org.springframework.data.mongodb.repository.MongoRepository; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.inventory.model.Inventory; 9 | @Service 10 | public interface InventoryRepository extends MongoRepository { 11 | public Inventory findByProductId(UUID productId); 12 | public Inventory save(Inventory inventory); 13 | 14 | } -------------------------------------------------------------------------------- /package-ui.sh: -------------------------------------------------------------------------------- 1 | DIRECTORY=eshop-ui/target 2 | if [ ! -d "$DIRECTORY" ]; then 3 | mkdir $DIRECTORY 4 | fi 5 | 6 | W1=eshop-ui.war 7 | SRC=eshop-ui 8 | SRC_ROOT=eshop-ui 9 | 10 | # Clean last war build 11 | if [ -e ${SRC_ROOT}/target/${W1} ]; then 12 | echo "Removing old war ${W1}" 13 | rm -rf ${SRC_ROOT}/${W1} 14 | fi 15 | 16 | # Build war 17 | if [ -d ${SRC} ]; then 18 | echo "Found source at ${SRC}" 19 | cd ${SRC} 20 | jar -cvf target/${W1} * 21 | fi 22 | 23 | # Show war details 24 | ls -la ../target/${W1} 25 | echo SUCCESS! 26 | -------------------------------------------------------------------------------- /email-rabbit-microservice/src/main/java/com/email/TaskMessage.java: -------------------------------------------------------------------------------- 1 | package com.email; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | public class TaskMessage{ 7 | 8 | private String emailId; 9 | 10 | @JsonCreator 11 | public TaskMessage(@JsonProperty("emailId") String emailId) { 12 | this.emailId = emailId; 13 | } 14 | 15 | public String getEmailId() { 16 | return emailId; 17 | } 18 | 19 | public void setEmailId(String emailId) { 20 | this.emailId = emailId; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/exception/ServiceException.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR, reason = "Exception in CustomerService!") 7 | public class ServiceException extends RuntimeException { 8 | /** 9 | * 10 | */ 11 | private static final long serialVersionUID = -7818568339305130997L; 12 | 13 | public ServiceException(String msg) { 14 | super(msg); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /products-microservice/src/main/java/com/products/repositories/IProductDetailsRepository.java: -------------------------------------------------------------------------------- 1 | package com.products.repositories; 2 | 3 | import java.util.List; 4 | import java.util.UUID; 5 | 6 | import org.springframework.data.mongodb.repository.MongoRepository; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.products.model.Product; 10 | 11 | @Service 12 | public interface IProductDetailsRepository extends MongoRepository { 13 | 14 | public Product findById(String id); 15 | 16 | public List findAll(); 17 | 18 | 19 | 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /gateway-microservice/src/main/java/com/gateway/model/Inventory.java: -------------------------------------------------------------------------------- 1 | package com.gateway.model; 2 | 3 | import java.util.UUID; 4 | 5 | public class Inventory { 6 | 7 | private UUID productId; 8 | private Integer availableStock; 9 | public UUID getProductId() { 10 | return productId; 11 | } 12 | public void setProductId(UUID productId) { 13 | this.productId = productId; 14 | } 15 | public Integer getAvailableStock() { 16 | return availableStock; 17 | } 18 | public void setAvailableStock(Integer availableStock) { 19 | this.availableStock = availableStock; 20 | } 21 | 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/exception/RecordNotFoundException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.sjsu.cmpe282.exception; 5 | 6 | import org.springframework.http.HttpStatus; 7 | import org.springframework.web.bind.annotation.ResponseStatus; 8 | 9 | @ResponseStatus(value = HttpStatus.NOT_FOUND, reason = "Record not found in database!") 10 | public class RecordNotFoundException extends RuntimeException { 11 | 12 | public RecordNotFoundException(String msg) { 13 | super(msg); 14 | } 15 | 16 | /** 17 | * 18 | */ 19 | private static final long serialVersionUID = 2890201840676042254L; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /customer-microservice/bin/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | customer-microservice 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | -------------------------------------------------------------------------------- /order-microservice/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | # 2 | #Mon Aug 15 10:46:22 PDT 2016 3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 10 | eclipse.preferences.version=1 11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 12 | org.eclipse.jdt.core.compiler.source=1.8 13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 14 | -------------------------------------------------------------------------------- /review-microservice/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | # 2 | #Thu Oct 06 19:03:59 PDT 2016 3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 10 | eclipse.preferences.version=1 11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 12 | org.eclipse.jdt.core.compiler.source=1.8 13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 14 | -------------------------------------------------------------------------------- /gateway-microservice/src/main/java/com/gateway/model/Review.java: -------------------------------------------------------------------------------- 1 | package com.gateway.model; 2 | 3 | import java.util.UUID; 4 | 5 | public class Review { 6 | private UUID productId; 7 | private double rating; 8 | private UUID customerId; 9 | 10 | public UUID getCustomerId() { 11 | return customerId; 12 | } 13 | public void setCustomerId(UUID customerId) { 14 | this.customerId = customerId; 15 | } 16 | public UUID getProductId() { 17 | return productId; 18 | } 19 | public void setProductId(UUID productId) { 20 | this.productId = productId; 21 | } 22 | public double getRating() { 23 | return rating; 24 | } 25 | public void setRating(double rating) { 26 | this.rating = rating; 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /recommendation-microservice/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | # 2 | #Mon Aug 15 14:24:18 PDT 2016 3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 10 | eclipse.preferences.version=1 11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 12 | org.eclipse.jdt.core.compiler.source=1.8 13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 14 | -------------------------------------------------------------------------------- /eshop-ui/product.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | eShop Product Details 8 | 9 | 10 | 11 | 12 | 13 |
14 |

Product Details

15 |
16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /review-microservice/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | review-microservice 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.springframework.ide.eclipse.core.springbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.springframework.ide.eclipse.core.springnature 21 | org.springsource.ide.eclipse.gradle.core.nature 22 | org.eclipse.jdt.core.javanature 23 | 24 | 25 | -------------------------------------------------------------------------------- /order-microservice/src/main/java/com/order/services/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.order.services; 2 | 3 | 4 | import java.util.List; 5 | 6 | import org.apache.commons.logging.Log; 7 | import org.apache.commons.logging.LogFactory; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.order.model.Order; 12 | import com.order.repositories.IOrderDetailsRepository; 13 | 14 | @Service 15 | public class OrderService { 16 | 17 | @Autowired 18 | private IOrderDetailsRepository orderDetailsRepo; 19 | 20 | private Log log = LogFactory.getLog(OrderService.class); 21 | 22 | public List createOrder(List orderList) { 23 | return orderDetailsRepo.save(orderList); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/controller/IBaseRestController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.sjsu.cmpe282.controller; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | /** 15 | * @author sandyarathidas 16 | * 17 | */ 18 | @Target(ElementType.TYPE) 19 | @Retention(RetentionPolicy.RUNTIME) 20 | @RestController 21 | @RequestMapping("/customer") 22 | public @interface IBaseRestController { 23 | /*This will serve as the base 24 | * controller that defines the base url for the rest controllers 25 | */ 26 | 27 | } 28 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/rabbitmq/TaskProducer.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.rabbitmq; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Component; 5 | 6 | 7 | @Component 8 | public class TaskProducer { 9 | @Autowired 10 | private TaskProducerConfiguration taskProducerConfiguration; 11 | 12 | public void sendNewTask(TaskMessage taskMessage) { 13 | System.out.println("Sending message from task producer!!"); 14 | byte[] data = taskMessage.getEmailId().getBytes(); 15 | System.out.println("TASK PRODUCER BYTE DATA "+data); 16 | taskProducerConfiguration.rabbitTemplate().convertAndSend( 17 | taskProducerConfiguration.tasksQueue, data); 18 | System.out.println("Successfully sent message from task producer!!"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /email-rabbit-microservice/src/main/java/com/email/Receiver.java: -------------------------------------------------------------------------------- 1 | package com.email; 2 | 3 | 4 | import java.io.UnsupportedEncodingException; 5 | import java.util.concurrent.CountDownLatch; 6 | import org.apache.commons.codec.binary.Base64; 7 | 8 | public class Receiver { 9 | 10 | public void receiveMessage(byte[] message) throws UnsupportedEncodingException { 11 | CountDownLatch latch = new CountDownLatch(1); 12 | Mail mail = new Mail(); 13 | String strMessage=new String(message, "UTF-8"); 14 | System.out.println("THIS IS THE strMESSAGE"+strMessage); 15 | byte[] valueDecoded= Base64.decodeBase64(strMessage); 16 | System.out.println("Decoded value is " + new String(valueDecoded)); 17 | mail.sendEmail(new String(valueDecoded)); 18 | latch.countDown(); 19 | 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /order-microservice/src/main/java/com/order/model/Order.java: -------------------------------------------------------------------------------- 1 | package com.order.model; 2 | 3 | import java.util.UUID; 4 | 5 | import org.springframework.data.annotation.Id; 6 | import org.springframework.data.mongodb.core.mapping.Document; 7 | 8 | @Document(collection="product") 9 | public class Order { 10 | @Id 11 | private UUID id; 12 | private Integer customerId; 13 | private Integer productId; 14 | 15 | 16 | public UUID getId() { 17 | return id; 18 | } 19 | public void setId(UUID id) { 20 | this.id = id; 21 | } 22 | public Integer getCustomerId() { 23 | return customerId; 24 | } 25 | public void setCustomerId(Integer customerId) { 26 | this.customerId = customerId; 27 | } 28 | public Integer getProductId() { 29 | return productId; 30 | } 31 | public void setProductId(Integer productId) { 32 | this.productId = productId; 33 | } 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /eshop-ui/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eShop Welcome Screen 7 | 8 | 9 | 10 | 11 |
12 |

Welcome to eShop

13 |

14 |

15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /product-inventory-microservice/src/main/java/com/inventory/service/InventoryService.java: -------------------------------------------------------------------------------- 1 | package com.inventory.service; 2 | 3 | import java.util.UUID; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.inventory.model.Inventory; 9 | import com.inventory.repository.InventoryRepository; 10 | @Service 11 | public class InventoryService { 12 | @Autowired 13 | InventoryRepository inventoryRepo; 14 | 15 | public Inventory getInventory(UUID productId) { 16 | // TODO Auto-generated method stub 17 | return inventoryRepo.findByProductId(productId); 18 | } 19 | 20 | 21 | public Inventory createInventory(Inventory inventory) { 22 | 23 | return inventoryRepo.save(inventory); 24 | } 25 | 26 | 27 | public void deleteAllInventory() { 28 | // TODO Auto-generated method stub 29 | inventoryRepo.deleteAll(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /review-microservice/src/main/java/com/review/model/Review.java: -------------------------------------------------------------------------------- 1 | package com.review.model; 2 | 3 | import java.util.UUID; 4 | 5 | import org.springframework.data.mongodb.core.mapping.Document; 6 | 7 | 8 | import javax.persistence.Entity; 9 | import javax.persistence.Table; 10 | @Entity 11 | @Table(name = "review") 12 | public class Review { 13 | 14 | private UUID productId; 15 | private double rating; 16 | private UUID customerId; 17 | 18 | public UUID getCustomerId() { 19 | return customerId; 20 | } 21 | public void setCustomerId(UUID customerId) { 22 | this.customerId = customerId; 23 | } 24 | public UUID getProductId() { 25 | return productId; 26 | } 27 | public void setProductId(UUID productId) { 28 | this.productId = productId; 29 | } 30 | public double getRating() { 31 | return rating; 32 | } 33 | public void setRating(double rating) { 34 | this.rating = rating; 35 | } 36 | 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /eshop-ui/homepage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eShop Home Page 7 | 8 | 9 | 10 | 11 |
12 |

Products

13 |
    14 |
  • 15 |
    Name
    16 |
    Price
    17 |
    Description
    18 |
    Category
    19 |
  • 20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##E-Shop Docker Commands: 2 | 3 | * sudo apt-get install docker.io 4 | * sudo mvn -e package docker:build 5 | * sudo docker run --name dbCustomer -d cassandra:2.2.5 6 | * sudo docker run -it --link dbCustomer:cassandra --rm cassandra:2.2.5 cqlsh cassandra 7 | * sudo docker pull rabbitmq 8 | * sudo docker run -d --hostname my-rabbit --name some-rabbit rabbitmq:3 9 | * sudo docker run -p 8080:8080 -e SPRING_RABBITMQ_HOST=**rabbit docker ip** --link dbCustomer:cassandra -t customer-microservice/customer 10 | * sudo docker run -p 8082:8082 -e SPRING_RABBITMQ_HOST=**rabbit docker ip** -t email-microservice/email 11 | * sudo docker run -p 8081:8081 -t product-microservice/products 12 | * sudo docker run -p 8086:8086 -t gateway-microservice/gateway 13 | * sudo docker run -p 8084:8084 -t inventory-microservice/inventory 14 | * sudo docker ps 15 | * sudo docker inspect **containerId** 16 | * sudo docker network inspect bridge 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /order-microservice/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.4.0.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'eclipse' 15 | apply plugin: 'spring-boot' 16 | 17 | jar { 18 | baseName = 'OrderMicroservice' 19 | version = '0.0.1-SNAPSHOT' 20 | } 21 | sourceCompatibility = 1.8 22 | targetCompatibility = 1.8 23 | 24 | repositories { 25 | mavenCentral() 26 | } 27 | 28 | 29 | dependencies { 30 | compile('org.springframework.boot:spring-boot-starter-amqp') 31 | compile('org.springframework.boot:spring-boot-starter-data-mongodb') 32 | compile('org.springframework.boot:spring-boot-starter-data-rest') 33 | compile('org.springframework.boot:spring-boot-starter-web-services') 34 | testCompile('org.springframework.boot:spring-boot-starter-test') 35 | } 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /review-microservice/bin/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8085 2 | spring.datasource.url = jdbc:mysql://localhost:3306/reviewDB 3 | spring.datasource.username = root 4 | spring.datasource.password = Test_123 5 | 6 | # Keep the connection alive if idle for a long time (needed in production) 7 | spring.datasource.testWhileIdle = true 8 | spring.datasource.validationQuery = SELECT 1 9 | 10 | # Show or not log for each sql query 11 | spring.jpa.show-sql = true 12 | 13 | # Hibernate ddl auto (create, create-drop, update) 14 | spring.jpa.hibernate.ddl-auto = update 15 | 16 | # Naming strategy 17 | spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy 18 | 19 | # Use spring.jpa.properties.* for Hibernate native properties (the prefix is 20 | # stripped before adding them to the entity manager) 21 | 22 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 23 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect 24 | -------------------------------------------------------------------------------- /order-microservice/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | order-microservice 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.common.project.facet.core.builder 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.springframework.ide.eclipse.core.springbuilder 20 | 21 | 22 | 23 | 24 | 25 | org.springframework.ide.eclipse.core.springnature 26 | org.springsource.ide.eclipse.gradle.core.nature 27 | org.eclipse.jdt.core.javanature 28 | org.eclipse.wst.common.project.facet.core.nature 29 | 30 | 31 | -------------------------------------------------------------------------------- /review-microservice/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8085 2 | spring.datasource.url = jdbc:mysql://localhost:3306/reviewDB 3 | spring.datasource.username = root 4 | spring.datasource.password = Test_123 5 | 6 | # Keep the connection alive if idle for a long time (needed in production) 7 | spring.datasource.testWhileIdle = true 8 | spring.datasource.validationQuery = SELECT 1 9 | 10 | # Show or not log for each sql query 11 | spring.jpa.show-sql = true 12 | 13 | # Hibernate ddl auto (create, create-drop, update) 14 | spring.jpa.hibernate.ddl-auto = update 15 | 16 | # Naming strategy 17 | spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy 18 | 19 | # Use spring.jpa.properties.* for Hibernate native properties (the prefix is 20 | # stripped before adding them to the entity manager) 21 | 22 | # The SQL dialect makes Hibernate generate better SQL for the chosen database 23 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect 24 | -------------------------------------------------------------------------------- /recommendation-microservice/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | recommendation-microservice 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.common.project.facet.core.builder 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.springframework.ide.eclipse.core.springbuilder 20 | 21 | 22 | 23 | 24 | 25 | org.springframework.ide.eclipse.core.springnature 26 | org.springsource.ide.eclipse.gradle.core.nature 27 | org.eclipse.jdt.core.javanature 28 | org.eclipse.wst.common.project.facet.core.nature 29 | 30 | 31 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/rabbitmq/TaskProducerConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.rabbitmq; 2 | 3 | import org.springframework.amqp.core.Queue; 4 | import org.springframework.amqp.rabbit.core.RabbitTemplate; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | @Configuration 9 | public class TaskProducerConfiguration extends RabbitMqConfiguration 10 | { 11 | protected final String tasksQueue = "book-shop-email-queue"; 12 | 13 | @Bean 14 | public RabbitTemplate rabbitTemplate() 15 | { 16 | RabbitTemplate template = new RabbitTemplate(connectionFactory()); 17 | template.setRoutingKey(this.tasksQueue); 18 | template.setQueue(this.tasksQueue); 19 | template.setMessageConverter(jsonMessageConverter()); 20 | return template; 21 | } 22 | 23 | @Bean 24 | public Queue tasksQueue() 25 | { 26 | return new Queue(this.tasksQueue); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /recommendation-microservice/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.4.0.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'eclipse' 15 | apply plugin: 'spring-boot' 16 | 17 | jar { 18 | baseName = 'RecommendationMicroservice' 19 | version = '0.0.1-SNAPSHOT' 20 | } 21 | sourceCompatibility = 1.8 22 | targetCompatibility = 1.8 23 | 24 | repositories { 25 | mavenCentral() 26 | } 27 | 28 | 29 | dependencies { 30 | compile('org.springframework.boot:spring-boot-starter-amqp') 31 | compile('org.springframework.boot:spring-boot-starter-data-mongodb') 32 | compile('org.springframework.boot:spring-boot-starter-data-redis') 33 | compile('org.springframework.boot:spring-boot-starter-data-rest') 34 | compile('org.springframework.boot:spring-boot-starter-web-services') 35 | testCompile('org.springframework.boot:spring-boot-starter-test') 36 | } 37 | 38 | -------------------------------------------------------------------------------- /product-inventory-microservice/src/main/java/com/inventory/model/Inventory.java: -------------------------------------------------------------------------------- 1 | package com.inventory.model; 2 | 3 | import java.util.UUID; 4 | 5 | 6 | 7 | import org.springframework.data.annotation.Id; 8 | import org.springframework.data.mongodb.core.mapping.Document; 9 | @Document(collection="Inventory") 10 | public class Inventory { 11 | 12 | @Id 13 | private UUID productId; 14 | private Integer availableStock; 15 | public UUID getProductId() { 16 | return productId; 17 | } 18 | public void setProductId(UUID productId) { 19 | this.productId = productId; 20 | } 21 | public Integer getAvailableStock() { 22 | return availableStock; 23 | } 24 | public void setAvailableStock(Integer availableStock) { 25 | this.availableStock = availableStock; 26 | } 27 | public Inventory(UUID productId, Integer availableStock) { 28 | super(); 29 | this.productId = productId; 30 | this.availableStock = availableStock; 31 | } 32 | public Inventory() { 33 | super(); 34 | // TODO Auto-generated constructor stub 35 | } 36 | 37 | 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /products-microservice/src/main/java/com/products/model/Inventory.java: -------------------------------------------------------------------------------- 1 | package com.products.model; 2 | 3 | import java.util.UUID; 4 | 5 | 6 | 7 | import org.springframework.data.annotation.Id; 8 | import org.springframework.data.mongodb.core.mapping.Document; 9 | @Document(collection="Inventory") 10 | public class Inventory { 11 | 12 | @Id 13 | private String productId; 14 | private Integer availableStock; 15 | public String getProductId() { 16 | return productId; 17 | } 18 | public void setProductId(String productId) { 19 | this.productId = productId; 20 | } 21 | public Integer getAvailableStock() { 22 | return availableStock; 23 | } 24 | public void setAvailableStock(Integer availableStock) { 25 | this.availableStock = availableStock; 26 | } 27 | public Inventory(String productId, Integer availableStock) { 28 | super(); 29 | this.productId = productId; 30 | this.availableStock = availableStock; 31 | } 32 | public Inventory() { 33 | super(); 34 | // TODO Auto-generated constructor stub 35 | } 36 | 37 | 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /review-microservice/src/main/java/com/review/service/ReviewService.java: -------------------------------------------------------------------------------- 1 | package com.review.service; 2 | 3 | import java.util.List; 4 | import java.util.UUID; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.review.model.Review; 10 | import com.review.repositories.IProductRatingRepo; 11 | 12 | @Service 13 | public class ReviewService { 14 | 15 | @Autowired 16 | private IProductRatingRepo productRatingRepo; 17 | 18 | public Review addNewRating(Review review) { 19 | return productRatingRepo.save(review); 20 | 21 | } 22 | 23 | public Review getRating(UUID productId) { 24 | List reviewsForProduct = productRatingRepo.find(productId); 25 | Double rating=0.0; 26 | Review review = new Review(); 27 | Double sum=0.0; 28 | for(Review each:reviewsForProduct){ 29 | sum=sum+each.getRating(); 30 | } 31 | rating= sum/(reviewsForProduct.size()); 32 | review.setProductId(productId); 33 | review.setRating(rating); 34 | review.setCustomerId(null); 35 | return review; 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /customer-microservice/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | customer-microservice 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.common.project.facet.core.builder 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.springframework.ide.eclipse.core.springbuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.m2e.core.maven2Builder 25 | 26 | 27 | 28 | 29 | 30 | org.springframework.ide.eclipse.core.springnature 31 | org.eclipse.jdt.core.javanature 32 | org.eclipse.m2e.core.maven2Nature 33 | org.eclipse.wst.common.project.facet.core.nature 34 | 35 | 36 | -------------------------------------------------------------------------------- /eshop-ui/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 15px; 3 | margin: 0; 4 | font-family: "Courier New", Courier, monospace; 5 | 6 | } 7 | 8 | div#background { 9 | position: fixed; 10 | width: 100%; 11 | height: 100%; 12 | left: 0; 13 | top: 0; 14 | z-index: 10; 15 | background: url("cart.png") no-repeat; 16 | background-position:bottom; 17 | background-attachment:fixed; 18 | background-color:black; 19 | color:lightblue; 20 | 21 | } 22 | 23 | p { 24 | padding: 20px; 25 | } 26 | .page-title{ 27 | font-size: 50px; 28 | margin-top: 30px; 29 | margin-bottom: 30px; 30 | 31 | } 32 | h3:after 33 | { 34 | content:' '; 35 | display:block; 36 | border:2px solid skyblue ; 37 | margin-bottom:30px; 38 | margin-top 39 | } 40 | ul.products { 41 | list-style: none; 42 | 43 | } 44 | 45 | .products-header { 46 | font-weight: bold; 47 | font-size : 20px; 48 | margin-top: 30px; 49 | } 50 | 51 | .product-details { 52 | background-color:black; 53 | color:black; 54 | margin-left: 20px; 55 | } 56 | .form-actions { 57 | margin: 0; 58 | background-color: transparent; 59 | text-align: center; 60 | } 61 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/rabbitmq/TaskMessage.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.rabbitmq; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.IOException; 5 | import java.io.ObjectOutput; 6 | import java.io.ObjectOutputStream; 7 | 8 | import com.fasterxml.jackson.annotation.JsonProperty; 9 | 10 | public class TaskMessage{ 11 | 12 | private String emailId; 13 | 14 | @JsonProperty("emailId") 15 | public String getEmailId() { 16 | return emailId; 17 | } 18 | 19 | public void setEmailId(String emailId) { 20 | this.emailId = emailId; 21 | } 22 | 23 | public byte[] toBytes() { 24 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); 25 | ObjectOutput out = null; 26 | try { 27 | out = new ObjectOutputStream(bos); 28 | out.writeObject(this); 29 | out.flush(); 30 | byte[] bytes = bos.toByteArray(); 31 | return bytes; 32 | } catch (IOException e) { 33 | e.printStackTrace(); 34 | } finally { 35 | try { 36 | bos.close(); 37 | } catch (IOException ex) { 38 | // ignore close exception 39 | } 40 | } 41 | return null; 42 | } 43 | 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /order-microservice/src/main/java/com/order/controllers/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.order.controllers; 2 | 3 | 4 | import java.util.ArrayList; 5 | 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.http.HttpStatus; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | import com.order.model.Order; 16 | import com.order.services.OrderService; 17 | 18 | @RestController 19 | @RequestMapping("/Order") 20 | public class OrderController { 21 | 22 | @Autowired 23 | OrderService orderService; 24 | 25 | @RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json", consumes = "application/json") 26 | public ResponseEntity> createOrder(@RequestBody ArrayList orderList) { 27 | return new ResponseEntity>((ArrayList) orderService.createOrder(orderList), HttpStatus.OK); 28 | 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /eshop-ui/login.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | "use strict"; 3 | 4 | $("#login-form").on('submit', function(event) { 5 | event.preventDefault(); 6 | $.ajax({ 7 | url: "http://ec2-52-53-167-111.us-west-1.compute.amazonaws.com:8086/gateway/customer/auth", 8 | type: "POST", 9 | headers: { 10 | 'Content-Type': 'application/json' 11 | }, 12 | data: JSON.stringify({ 13 | email: $('#emailaddress').val(), 14 | password: $('#password').val() 15 | }) 16 | }).done(function(response) { 17 | alert("Login Successful!") 18 | window.location.href = "homepage.html"; 19 | }).fail(function(response) { 20 | switch (response.status) { 21 | case 401: 22 | alert("Incorrect credentials. Please try again"); 23 | break; 24 | case 400: 25 | $.notify('Bad Request. Missing required fields', 'error'); 26 | break; 27 | default: 28 | $.notify('Internal Server Error, failed to login. Please try again.', 'error'); 29 | } 30 | }); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /eshop-ui/register.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | "use strict"; 3 | 4 | $("#registration-form").on('submit', function (event) { 5 | event.preventDefault(); 6 | $.ajax({ 7 | url: "http://ec2-52-53-167-111.us-west-1.compute.amazonaws.com:8086/gateway/customer/create", 8 | type: "POST", 9 | headers: { 10 | 'Accept': 'application/json', 11 | 'Content-Type': 'application/json' 12 | }, 13 | 'dataType': 'json', 14 | data: JSON.stringify({ 15 | firstName: $('#firstname').val(), 16 | lastName: $('#lastname').val(), 17 | email: $('#emailaddress').val(), 18 | password: $('#password').val() 19 | }) 20 | }).done(function(response) { 21 | alert("Successfully registered!"); 22 | window.location.href="homepage.html"; 23 | }).fail(function(response){ 24 | switch(response.status) { 25 | case 400: 26 | $.notify('Bad Request. Missing required fields', 'error'); 27 | break; 28 | default: 29 | $.notify('Internal Server Error, failed to register. Please try again.', 'error') 30 | } 31 | }); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /customer-microservice/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/rabbitmq/RabbitMqConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.rabbitmq; 2 | 3 | import org.springframework.amqp.core.AmqpAdmin; 4 | import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; 5 | import org.springframework.amqp.rabbit.connection.ConnectionFactory; 6 | import org.springframework.amqp.rabbit.core.RabbitAdmin; 7 | import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; 8 | import org.springframework.amqp.support.converter.MessageConverter; 9 | import org.springframework.context.annotation.Bean; 10 | import org.springframework.context.annotation.Configuration; 11 | 12 | @Configuration 13 | public class RabbitMqConfiguration 14 | { 15 | @Bean 16 | public ConnectionFactory connectionFactory() 17 | { 18 | CachingConnectionFactory connectionFactory = new CachingConnectionFactory("172.17.0.9"); 19 | 20 | //connectionFactory.setUsername("user"); 21 | //connectionFactory.setPassword("password"); 22 | return connectionFactory; 23 | } 24 | 25 | @Bean 26 | public AmqpAdmin amqpAdmin() 27 | { 28 | return new RabbitAdmin(connectionFactory()); 29 | } 30 | 31 | 32 | @Bean 33 | public MessageConverter jsonMessageConverter() 34 | { 35 | return new Jackson2JsonMessageConverter(); 36 | } 37 | } -------------------------------------------------------------------------------- /review-microservice/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.4.0.RELEASE' 4 | } 5 | repositories { 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | apply plugin: 'java' 14 | apply plugin: 'eclipse' 15 | apply plugin: 'spring-boot' 16 | 17 | jar { 18 | baseName = 'review' 19 | version = '' 20 | } 21 | sourceCompatibility = 1.8 22 | targetCompatibility = 1.8 23 | 24 | repositories { 25 | mavenCentral() 26 | } 27 | 28 | apply plugin: 'docker' 29 | 30 | task buildDocker(type: Docker, dependsOn: build) { 31 | push = true 32 | applicationName = jar.baseName 33 | dockerfile = file('src/main/docker/Dockerfile') 34 | doFirst { 35 | copy { 36 | from jar 37 | into stageDir 38 | } 39 | } 40 | 41 | 42 | 43 | dependencies { 44 | compile('org.springframework.boot:spring-boot-starter-data-mongodb') 45 | compile('org.springframework.boot:spring-boot-starter-data-redis') 46 | compile('org.springframework.boot:spring-boot-starter-data-rest') 47 | compile('org.springframework.boot:spring-boot-starter-web-services') 48 | testCompile('org.springframework.boot:spring-boot-starter-test') 49 | compile('org.springframework.boot:spring-boot-starter-data-jpa') 50 | compile('mysql:mysql-connector-java') 51 | } 52 | 53 | -------------------------------------------------------------------------------- /eshop-ui/products.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | "use strict"; 3 | 4 | function fetchProducts(firstTime) { 5 | $.ajax({ 6 | url: "http://ec2-52-53-167-111.us-west-1.compute.amazonaws.com:8086/gateway/product/all", 7 | type: "GET", 8 | 'dataType': 'json', 9 | }).done(function(response) { 10 | !firstTime && $.notify('Meetings list reloaded', 'success'); 11 | renderProducts(response); 12 | }).fail(function(response){ 13 | $.notify(response.responseText); 14 | $('.products > .product').remove(); 15 | }); 16 | } 17 | 18 | function renderProducts(products) { 19 | $('.products > .product').remove(); 20 | $.each(products, function(idx, product) { 21 | $('.products').append("
  • " + 22 | "" + 23 | "
    " + product.productPrice + "
    " + 24 | "
    " + product.description + "
    " + 25 | "
    " + product.category + "
    " + 26 | "
  • "); 27 | }); 28 | } 29 | 30 | fetchProducts(true); 31 | }); 32 | -------------------------------------------------------------------------------- /eshop-ui/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eShop Login 7 | 8 | 9 | 10 |
    11 | 12 |

    Login

    13 |
    14 |
    15 | 16 |
    17 | 18 |
    19 |
    20 |
    21 | 22 |
    23 | 24 |
    25 |
    26 |
    27 |
    28 | 29 |
    30 |
    31 |
    32 |
    33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /review-microservice/src/main/java/com/review/controllers/ReviewController.java: -------------------------------------------------------------------------------- 1 | package com.review.controllers; 2 | 3 | import java.util.UUID; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.http.HttpStatus; 7 | import org.springframework.http.ResponseEntity; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | import com.review.model.Review; 15 | import com.review.service.ReviewService; 16 | 17 | @RestController 18 | @RequestMapping("/review") 19 | public class ReviewController { 20 | 21 | @Autowired 22 | private ReviewService reviewService; 23 | 24 | @RequestMapping(value = "/addRating", method = RequestMethod.POST, produces = "application/json", consumes = "application/json") 25 | public ResponseEntity addNewRating(@RequestBody Review review) { 26 | return new ResponseEntity(reviewService.addNewRating(review), HttpStatus.OK); 27 | 28 | } 29 | 30 | @RequestMapping(value = "/{productId}", method = RequestMethod.GET, produces = "application/json", consumes = "application/json") 31 | public ResponseEntity getAverageRating(@PathVariable UUID productId) { 32 | return new ResponseEntity(reviewService.getRating(productId), HttpStatus.OK); 33 | 34 | } 35 | 36 | 37 | 38 | 39 | 40 | } 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/controller/CustomerController.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.controller; 2 | 3 | 4 | import javax.xml.ws.Response; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.web.bind.annotation.CrossOrigin; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.ResponseStatus; 14 | 15 | import com.sjsu.cmpe282.model.Customer; 16 | import com.sjsu.cmpe282.service.ICustomerService; 17 | @CrossOrigin 18 | @IBaseRestController 19 | public class CustomerController { 20 | 21 | @Autowired 22 | ICustomerService customerService; 23 | 24 | @RequestMapping(value = "/create", method = RequestMethod.POST, produces = "application/json", consumes ="application/json") 25 | @ResponseStatus(HttpStatus.CREATED) 26 | public Customer createCustomer(@RequestBody Customer customer) { 27 | System.out.println("Reached the controller!!"); 28 | return customerService.createCustomer(customer); 29 | } 30 | 31 | @RequestMapping(value = "/auth", method = RequestMethod.POST, produces = "application/json", consumes = "application/json") 32 | public ResponseEntity authenticateUser(@RequestBody Customer customer) { 33 | if(customerService.authenticateCustomer(customer)) 34 | return new ResponseEntity(HttpStatus.OK); 35 | else 36 | return new ResponseEntity(HttpStatus.UNAUTHORIZED); 37 | 38 | 39 | 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /gateway-microservice/src/main/java/com/gateway/model/Product.java: -------------------------------------------------------------------------------- 1 | package com.gateway.model; 2 | 3 | import java.util.UUID; 4 | 5 | 6 | public class Product { 7 | 8 | public Product() { 9 | super(); 10 | // TODO Auto-generated constructor stub 11 | } 12 | 13 | private UUID id; 14 | private String productName; 15 | private Double productPrice; 16 | private String description; 17 | private String category; 18 | 19 | public Product(UUID id, String productName, Double productPrice, 20 | String description, String category) { 21 | super(); 22 | this.id = id; 23 | this.productName = productName; 24 | this.productPrice = productPrice; 25 | this.description = description; 26 | this.category = category; 27 | } 28 | public UUID getId() { 29 | return id; 30 | } 31 | public void setId(UUID id) { 32 | this.id = id; 33 | } 34 | public String getProductName() { 35 | return productName; 36 | } 37 | public void setProductName(String productName) { 38 | this.productName = productName; 39 | } 40 | public Double getProductPrice() { 41 | return productPrice; 42 | } 43 | public void setProductPrice(Double productPrice) { 44 | this.productPrice = productPrice; 45 | } 46 | public String getDescription() { 47 | return description; 48 | } 49 | public void setDescription(String description) { 50 | this.description = description; 51 | } 52 | public String getCategory() { 53 | return category; 54 | } 55 | public void setCategory(String category) { 56 | this.category = category; 57 | } 58 | @Override 59 | public String toString() { 60 | return "Product [id=" + id + ", productName=" + productName 61 | + ", productPrice=" + productPrice + ", description=" 62 | + description + ", category=" + category + "]"; 63 | } 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /customer-microservice/bin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.customer 7 | customer 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | customer-microservice 12 | CustomerMicroService API 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.4.0.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-data-rest 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-web-services 35 | 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-test 40 | test 41 | 42 | 43 | 44 | 45 | 46 | 47 | org.springframework.boot 48 | spring-boot-maven-plugin 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/repository/CustomerRepository.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.repository; 2 | 3 | import java.util.UUID; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.cassandra.core.CassandraOperations; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import com.sjsu.cmpe282.model.Customer; 10 | 11 | @Repository 12 | public class CustomerRepository implements ICustomerRepository { 13 | 14 | @Autowired 15 | private CassandraOperations operations; 16 | 17 | @Override 18 | public Customer createCustomer(Customer customer) { 19 | Customer createdCustomer = operations.insert(customer); 20 | createdCustomer.setPassword("********"); 21 | return createdCustomer; 22 | 23 | } 24 | 25 | @Override 26 | public boolean authenticateCustomer(Customer customer) { 27 | boolean isAuthenticated = false; 28 | String email = customer.getEmail(); 29 | String password = customer.getPassword(); 30 | System.out.println("EMAIL"+email); 31 | System.out.println("PASSWORD"+password); 32 | String cql = "select * from customer where email = '" + email 33 | + "' allow filtering"; 34 | Customer dbCustomer = operations.selectOne(cql, Customer.class); 35 | if(dbCustomer==null){ 36 | System.out.println("****NO RECORD FOUND!!******"); 37 | } 38 | System.out.println(">>>> DB password: " + dbCustomer.getPassword() 39 | + ", User password: " + password); 40 | 41 | if (dbCustomer != null && password.equals(dbCustomer.getPassword())) { 42 | isAuthenticated = true; 43 | System.out.println("**IS AUTH IS TRUE"+isAuthenticated); 44 | } 45 | else{ 46 | System.out.println("**IS AUTH IS FALSE"+isAuthenticated); 47 | } 48 | System.out.println("**IS AUTH IS FALSE"+isAuthenticated); 49 | return isAuthenticated; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /products-microservice/src/main/java/com/products/model/Product.java: -------------------------------------------------------------------------------- 1 | package com.products.model; 2 | 3 | import java.util.UUID; 4 | 5 | import org.springframework.data.annotation.Id; 6 | import org.springframework.data.mongodb.core.mapping.Document; 7 | 8 | @Document(collection="product") 9 | public class Product { 10 | @Id 11 | private String id; 12 | private String productName; 13 | private Double productPrice; 14 | private String description; 15 | private String category; 16 | 17 | public Product(String id, String productName, Double productPrice, 18 | String description, String category) { 19 | super(); 20 | this.id = id; 21 | this.productName = productName; 22 | this.productPrice = productPrice; 23 | this.description = description; 24 | this.category = category; 25 | } 26 | public String getId() { 27 | return id; 28 | } 29 | public void setId(String id) { 30 | this.id = id; 31 | } 32 | public String getProductName() { 33 | return productName; 34 | } 35 | public void setProductName(String productName) { 36 | this.productName = productName; 37 | } 38 | public Double getProductPrice() { 39 | return productPrice; 40 | } 41 | public void setProductPrice(Double productPrice) { 42 | this.productPrice = productPrice; 43 | } 44 | public String getDescription() { 45 | return description; 46 | } 47 | public void setDescription(String description) { 48 | this.description = description; 49 | } 50 | public String getCategory() { 51 | return category; 52 | } 53 | public void setCategory(String category) { 54 | this.category = category; 55 | } 56 | @Override 57 | public String toString() { 58 | return "Product [id=" + id + ", productName=" + productName 59 | + ", productPrice=" + productPrice + ", description=" 60 | + description + ", category=" + category + "]"; 61 | } 62 | public Product() { 63 | super(); 64 | // TODO Auto-generated constructor stub 65 | } 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /gateway-microservice/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.gateway 7 | gateway 8 | 1.0 9 | jar 10 | 11 | gateway-microservice 12 | Gateway Microservice 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.4.1.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | gateway-microservice 26 | 27 | 28 | 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-starter-web 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-maven-plugin 43 | 44 | 45 | com.spotify 46 | docker-maven-plugin 47 | 0.4.12 48 | 49 | ${docker.image.prefix}/${project.artifactId} 50 | src/main/docker 51 | 52 | 53 | / 54 | ${project.build.directory} 55 | ${project.build.finalName}.jar 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /email-rabbit-microservice/src/main/java/com/email/EmailRabbitMicroserviceApplication.java: -------------------------------------------------------------------------------- 1 | package com.email; 2 | 3 | import org.springframework.amqp.core.Binding; 4 | import org.springframework.amqp.core.BindingBuilder; 5 | import org.springframework.amqp.core.Queue; 6 | import org.springframework.amqp.core.TopicExchange; 7 | import org.springframework.amqp.rabbit.connection.ConnectionFactory; 8 | import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; 9 | import org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter; 10 | import org.springframework.boot.SpringApplication; 11 | import org.springframework.boot.autoconfigure.SpringBootApplication; 12 | import org.springframework.context.annotation.Bean; 13 | 14 | @SpringBootApplication 15 | public class EmailRabbitMicroserviceApplication { 16 | 17 | final static String queueName = "book-shop-email-queue"; 18 | 19 | @Bean 20 | Queue queue() { 21 | return new Queue(queueName, false); 22 | } 23 | 24 | @Bean 25 | TopicExchange exchange() { 26 | return new TopicExchange("email-exchange"); 27 | } 28 | 29 | @Bean 30 | Binding binding(Queue queue, TopicExchange exchange) { 31 | return BindingBuilder.bind(queue).to(exchange).with(queueName); 32 | } 33 | 34 | @Bean 35 | SimpleMessageListenerContainer container(ConnectionFactory connectionFactory, 36 | MessageListenerAdapter listenerAdapter) { 37 | SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); 38 | container.setConnectionFactory(connectionFactory); 39 | container.setQueueNames(queueName); 40 | container.setMessageListener(listenerAdapter); 41 | return container; 42 | } 43 | 44 | @Bean 45 | Receiver receiver() { 46 | return new Receiver(); 47 | } 48 | 49 | @Bean 50 | MessageListenerAdapter listenerAdapter(Receiver receiver) { 51 | return new MessageListenerAdapter(receiver, "receiveMessage"); 52 | } 53 | public static void main(String[] args) { 54 | SpringApplication.run(EmailRabbitMicroserviceApplication.class, args); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /product-inventory-microservice/src/main/java/com/inventory/controller/InventoryController.java: -------------------------------------------------------------------------------- 1 | package com.inventory.controller; 2 | 3 | import java.util.UUID; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.http.HttpStatus; 7 | import org.springframework.http.MediaType; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.bind.annotation.ResponseStatus; 15 | import org.springframework.web.bind.annotation.RestController; 16 | 17 | import com.inventory.model.Inventory; 18 | import com.inventory.service.InventoryService; 19 | 20 | 21 | @RestController 22 | @RequestMapping("/inventory") 23 | public class InventoryController { 24 | 25 | @Autowired 26 | InventoryService inventoryService; 27 | 28 | @RequestMapping(value = "/{productId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) 29 | @ResponseStatus(HttpStatus.OK) 30 | public ResponseEntity getInventory(@PathVariable("productId") UUID productId) { 31 | System.out.println("In inventory controller!!"); 32 | return new ResponseEntity(inventoryService.getInventory(productId),HttpStatus.OK); 33 | } 34 | 35 | @RequestMapping(value = "/create", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes =MediaType.APPLICATION_JSON_VALUE) 36 | @ResponseStatus(HttpStatus.CREATED) 37 | public ResponseEntity createInventory(@RequestBody Inventory inventory) { 38 | return new ResponseEntity(inventoryService.createInventory(inventory),HttpStatus.CREATED); 39 | } 40 | 41 | @RequestMapping(value = "/", method = RequestMethod.DELETE) 42 | @ResponseStatus(HttpStatus.OK) 43 | public ResponseEntity deleteAllInventory() { 44 | inventoryService.deleteAllInventory(); 45 | return new ResponseEntity(HttpStatus.OK); 46 | } 47 | 48 | 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /email-rabbit-microservice/src/main/java/com/email/Mail.java: -------------------------------------------------------------------------------- 1 | package com.email; 2 | 3 | 4 | 5 | import java.util.Properties; 6 | 7 | import javax.mail.Message; 8 | import javax.mail.MessagingException; 9 | import javax.mail.PasswordAuthentication; 10 | import javax.mail.Session; 11 | import javax.mail.Transport; 12 | import javax.mail.internet.InternetAddress; 13 | import javax.mail.internet.MimeMessage; 14 | 15 | public class Mail { 16 | public void sendEmail(String strRecepientAddress) 17 | { 18 | final String username = "***"; 19 | final String password = "***"; 20 | 21 | Properties props = new Properties(); 22 | props.put("mail.smtp.auth", "true"); 23 | props.put("mail.smtp.starttls.enable", "true"); 24 | props.put("mail.smtp.host", "smtp.googlemail.com"); 25 | props.put("mail.smtp.port", "587"); 26 | 27 | Session session = Session.getInstance(props, 28 | new javax.mail.Authenticator() { 29 | protected PasswordAuthentication getPasswordAuthentication() { 30 | return new PasswordAuthentication(username, password); 31 | } 32 | }); 33 | 34 | try { 35 | 36 | Message message = new MimeMessage(session); 37 | message.setFrom(new InternetAddress("campus.tribune295@gmail.com")); 38 | 39 | message.setRecipient(Message.RecipientType.TO, new InternetAddress(strRecepientAddress)); 40 | //For login: the Message Subject will be - Verify your email on Campus Tribune 41 | 42 | message.setSubject("Registered on the Book Tribunal"); 43 | StringBuilder str = new StringBuilder(); 44 | str.append("Hi,") ; 45 | str.append("\n\n") ; 46 | str.append("You have been registered on the Book Tribunal!"); 47 | str.append("\n\n"); 48 | str.append("Thanks,") ; 49 | str.append("\n") ; 50 | str.append("Book Tribunal Team") ; 51 | message.setText(str.toString()); 52 | Transport.send(message); 53 | 54 | } catch (MessagingException e) { 55 | throw new RuntimeException(e); 56 | } 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /eshop-ui/register.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | eShop Registration 7 | 8 | 9 | 10 | 11 |
    12 |

    Customer Registration

    13 |
    14 |
    15 | 16 |
    17 | 18 |
    19 |
    20 |
    21 | 22 |
    23 | 24 |
    25 |
    26 |
    27 | 28 |
    29 | 30 |
    31 |
    32 |
    33 | 34 |
    35 | 36 |
    37 |
    38 |
    39 |
    40 | 41 |
    42 |
    43 |
    44 |
    45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/service/CustomerService.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.service; 2 | 3 | import java.util.Date; 4 | import java.util.UUID; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.util.StringUtils; 9 | 10 | import com.sjsu.cmpe282.exception.ServiceException; 11 | import com.sjsu.cmpe282.model.Customer; 12 | import com.sjsu.cmpe282.rabbitmq.TaskMessage; 13 | import com.sjsu.cmpe282.rabbitmq.TaskProducer; 14 | import com.sjsu.cmpe282.repository.ICustomerRepository; 15 | 16 | @Service 17 | public class CustomerService implements ICustomerService { 18 | 19 | @Autowired 20 | private ICustomerRepository iCustomerRepository; 21 | 22 | @Autowired 23 | private TaskProducer taskProducer; 24 | 25 | @Override 26 | public Customer createCustomer(Customer customer) { 27 | customer.setCustomerId(UUID.randomUUID()); 28 | customer.setCreateDate(new Date()); 29 | if (!isValidCreateUserRequest(customer)) { 30 | throw new ServiceException("Invalid create user request."); 31 | } 32 | sendEmail(customer.getEmail()); 33 | return iCustomerRepository.createCustomer(customer); 34 | } 35 | 36 | private void sendEmail(String email) { 37 | TaskMessage taskMessage = new TaskMessage(); 38 | taskMessage.setEmailId(email); 39 | taskProducer.sendNewTask(taskMessage); 40 | 41 | } 42 | 43 | private boolean isValidCreateUserRequest(Customer customer) { 44 | boolean isValid = false; 45 | if (customer != null && !StringUtils.isEmpty(customer.getCustomerId()) 46 | && !StringUtils.isEmpty(customer.getPassword())) { 47 | isValid=true; 48 | } 49 | System.out.println(">>>>> isValidCreateUserRequest: " + isValid); 50 | 51 | return isValid; 52 | } 53 | 54 | 55 | @Override 56 | public boolean authenticateCustomer(Customer customer) { 57 | System.out.println("**In authenticate service class!"); 58 | boolean isAuthenticated = false; 59 | if (customer != null) { 60 | if (!StringUtils.isEmpty(customer.getEmail()) 61 | && !StringUtils.isEmpty(customer.getPassword())) { 62 | isAuthenticated = iCustomerRepository.authenticateCustomer(customer); 63 | } 64 | } 65 | 66 | return isAuthenticated; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /products-microservice/src/main/java/com/products/controllers/ProductController.java: -------------------------------------------------------------------------------- 1 | package com.products.controllers; 2 | 3 | 4 | import java.util.ArrayList; 5 | import java.util.UUID; 6 | 7 | import org.json.JSONException; 8 | import org.json.JSONObject; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.http.HttpStatus; 11 | import org.springframework.http.MediaType; 12 | import org.springframework.http.ResponseEntity; 13 | import org.springframework.web.bind.annotation.PathVariable; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RequestMethod; 16 | import org.springframework.web.bind.annotation.ResponseStatus; 17 | import org.springframework.web.bind.annotation.RestController; 18 | 19 | import com.products.model.Product; 20 | import com.products.services.ProductService; 21 | 22 | 23 | @RestController 24 | @RequestMapping("/product") 25 | public class ProductController { 26 | 27 | @Autowired 28 | ProductService productService; 29 | 30 | @RequestMapping(value = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) 31 | public ArrayList listAllProducts() throws JSONException { 32 | System.out.println("****Reached product microservice controller****"); 33 | return productService.listAll(); 34 | 35 | } 36 | 37 | @RequestMapping(value = "/{productId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) 38 | @ResponseStatus(HttpStatus.OK) 39 | public ResponseEntity getProductInfo(@PathVariable("productId") String productId) { 40 | System.out.println("In ProductController"); 41 | return new ResponseEntity(productService.getProductInfo(productId),HttpStatus.OK); 42 | } 43 | 44 | @RequestMapping(value = "/addProducts", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) 45 | @ResponseStatus(HttpStatus.OK) 46 | public ResponseEntity getProductInfo() { 47 | System.out.println("In ProductController"); 48 | if(productService.addProducts()) 49 | return new ResponseEntity(HttpStatus.OK); 50 | return new ResponseEntity(HttpStatus.METHOD_FAILURE); 51 | } 52 | 53 | 54 | 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /products-microservice/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.products 7 | products 8 | 1.0 9 | jar 10 | 11 | products-microservice 12 | Products Microservice 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.4.1.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | product-microservice 26 | 27 | 28 | 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-starter-web 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-data-mongodb 37 | 38 | 39 | 40 | 41 | org.json 42 | json 43 | 20090211 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-maven-plugin 52 | 53 | 54 | com.spotify 55 | docker-maven-plugin 56 | 0.4.12 57 | 58 | ${docker.image.prefix}/${project.artifactId} 59 | src/main/docker 60 | 61 | 62 | / 63 | ${project.build.directory} 64 | ${project.build.finalName}.jar 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /product-inventory-microservice/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.inventory 7 | inventory 8 | 1.0 9 | jar 10 | 11 | product-inventory-microservice 12 | Inventory Microservice 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.4.1.RELEASE 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | inventory-microservice 26 | 27 | 28 | 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-starter-data-mongodb 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-data-rest 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-web-services 41 | 42 | 43 | 44 | 45 | 46 | 47 | org.springframework.boot 48 | spring-boot-maven-plugin 49 | 50 | 51 | com.spotify 52 | docker-maven-plugin 53 | 0.4.12 54 | 55 | ${docker.image.prefix}/${project.artifactId} 56 | src/main/docker 57 | 58 | 59 | / 60 | ${project.build.directory} 61 | ${project.build.finalName}.jar 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /email-rabbit-microservice/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.email 7 | email 8 | 1.0 9 | jar 10 | 11 | email-rabbit-microservice 12 | Email Microservice with RabbitMQ listener 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.4.1.RELEASE 18 | 19 | 20 | 21 | UTF-8 22 | UTF-8 23 | 1.8 24 | email-microservice 25 | 26 | 27 | 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-starter-activemq 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-amqp 36 | 37 | 38 | 39 | javax.mail 40 | mail 41 | 1.4 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-maven-plugin 52 | 53 | 54 | com.spotify 55 | docker-maven-plugin 56 | 0.4.12 57 | 58 | ${docker.image.prefix}/${project.artifactId} 59 | src/main/docker 60 | 61 | 62 | / 63 | ${project.build.directory} 64 | ${project.build.finalName}.jar 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/exception/GlobalControllerExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.exception; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import org.springframework.dao.DataIntegrityViolationException; 7 | import org.springframework.dao.DuplicateKeyException; 8 | import org.springframework.http.HttpStatus; 9 | import org.springframework.http.ResponseEntity; 10 | import org.springframework.web.bind.annotation.ControllerAdvice; 11 | import org.springframework.web.bind.annotation.ExceptionHandler; 12 | import org.springframework.web.bind.annotation.ResponseStatus; 13 | 14 | @ControllerAdvice 15 | public class GlobalControllerExceptionHandler { 16 | 17 | @ResponseStatus(HttpStatus.CONFLICT) 18 | @ExceptionHandler(DataIntegrityViolationException.class) 19 | public ResponseEntity handleAutoDBConflicts(DataIntegrityViolationException ex) { 20 | return buildErrorResponse(ex, HttpStatus.CONFLICT); 21 | } 22 | 23 | @ResponseStatus(HttpStatus.CONFLICT) 24 | @ExceptionHandler(DuplicateKeyException.class) 25 | public ResponseEntity handleCustomDBConflicts(DuplicateKeyException ex) { 26 | return buildErrorResponse(ex, HttpStatus.CONFLICT); 27 | } 28 | 29 | @ResponseStatus(HttpStatus.NOT_FOUND) 30 | @ExceptionHandler(RecordNotFoundException.class) 31 | public ResponseEntity handleRecordNotFoundException(RecordNotFoundException ex) { 32 | return buildErrorResponse(ex, HttpStatus.NOT_FOUND); 33 | } 34 | 35 | @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) 36 | @ExceptionHandler(ServiceException.class) 37 | public ResponseEntity handleServiceException(ServiceException ex) { 38 | return buildErrorResponse(ex, HttpStatus.INTERNAL_SERVER_ERROR); 39 | } 40 | 41 | @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) 42 | @ExceptionHandler(Exception.class) 43 | public ResponseEntity exceptionHandler(Exception ex) { 44 | return buildErrorResponse(ex, HttpStatus.INTERNAL_SERVER_ERROR); 45 | } 46 | 47 | /** 48 | * @param t 49 | * @param status 50 | * @return 51 | * Build and return the error response 52 | */ 53 | private ResponseEntity buildErrorResponse(Throwable t, HttpStatus status) { 54 | Map responseBody = new HashMap<>(); 55 | responseBody.put("HTTP Status", status.toString() + " - " + status.name()); 56 | responseBody.put("message", t.getLocalizedMessage()); 57 | return new ResponseEntity(responseBody, status); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /order-microservice/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /review-microservice/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /recommendation-microservice/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /gateway-microservice/src/main/java/com/gateway/model/ViewProduct.java: -------------------------------------------------------------------------------- 1 | package com.gateway.model; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * @author sandyarathidas 7 | * 8 | */ 9 | public class ViewProduct implements Serializable{ 10 | 11 | private static final long serialVersionUID = -8243145429438016231L; 12 | 13 | private Product productBasicInfo; 14 | private Double productRating; 15 | private Integer productInventory; 16 | 17 | 18 | public Product getProductBasicInfo() { 19 | return productBasicInfo; 20 | } 21 | 22 | public void setProductBasicInfo(Product productBasicInfo) { 23 | this.productBasicInfo = productBasicInfo; 24 | } 25 | 26 | public Double getProductRating() { 27 | return productRating; 28 | } 29 | 30 | public void setProductRating(Double productRating) { 31 | this.productRating = productRating; 32 | } 33 | 34 | public Integer getProductInventory() { 35 | return productInventory; 36 | } 37 | 38 | public void setProductInventory(Integer productInventory) { 39 | this.productInventory = productInventory; 40 | } 41 | 42 | public static long getSerialversionuid() { 43 | return serialVersionUID; 44 | } 45 | 46 | public ViewProduct(Product productBasicInfo, Double productRating, Integer productInventory) { 47 | super(); 48 | this.productBasicInfo = productBasicInfo; 49 | this.productRating = productRating; 50 | this.productInventory = productInventory; 51 | } 52 | 53 | @Override 54 | public int hashCode() { 55 | final int prime = 31; 56 | int result = 1; 57 | result = prime * result + ((productBasicInfo == null) ? 0 : productBasicInfo.hashCode()); 58 | result = prime * result + ((productInventory == null) ? 0 : productInventory.hashCode()); 59 | result = prime * result + ((productRating == null) ? 0 : productRating.hashCode()); 60 | return result; 61 | } 62 | 63 | @Override 64 | public boolean equals(Object obj) { 65 | if (this == obj) 66 | return true; 67 | if (obj == null) 68 | return false; 69 | if (getClass() != obj.getClass()) 70 | return false; 71 | ViewProduct other = (ViewProduct) obj; 72 | if (productBasicInfo == null) { 73 | if (other.productBasicInfo != null) 74 | return false; 75 | } else if (!productBasicInfo.equals(other.productBasicInfo)) 76 | return false; 77 | if (productInventory == null) { 78 | if (other.productInventory != null) 79 | return false; 80 | } else if (!productInventory.equals(other.productInventory)) 81 | return false; 82 | if (productRating == null) { 83 | if (other.productRating != null) 84 | return false; 85 | } else if (!productRating.equals(other.productRating)) 86 | return false; 87 | return true; 88 | } 89 | 90 | @Override 91 | public String toString() { 92 | return "ViewProduct [productBasicInfo=" + productBasicInfo + ", productRating=" + productRating 93 | + ", productInventory=" + productInventory + "]"; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /gateway-microservice/src/main/java/com/gateway/controller/GatewayController.java: -------------------------------------------------------------------------------- 1 | package com.gateway.controller; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import java.util.UUID; 10 | 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.http.HttpStatus; 13 | import org.springframework.http.MediaType; 14 | import org.springframework.http.ResponseEntity; 15 | import org.springframework.web.bind.annotation.CrossOrigin; 16 | import org.springframework.web.bind.annotation.PathVariable; 17 | import org.springframework.web.bind.annotation.RequestBody; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.RequestMethod; 20 | import org.springframework.web.bind.annotation.ResponseStatus; 21 | import org.springframework.web.bind.annotation.RestController; 22 | 23 | import com.gateway.model.Customer; 24 | import com.gateway.model.Product; 25 | import com.gateway.model.ViewProduct; 26 | import com.gateway.service.GatewayService; 27 | 28 | @RestController 29 | @RequestMapping("/gateway") 30 | @CrossOrigin 31 | public class GatewayController { 32 | 33 | @Autowired 34 | GatewayService gatewayService; 35 | 36 | @RequestMapping(value = "/product/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) 37 | @ResponseStatus(HttpStatus.OK) 38 | public ResponseEntity getProductInfo(@PathVariable("id") UUID productId) { 39 | return new ResponseEntity(gatewayService.getProductInfo(productId),HttpStatus.OK); 40 | } 41 | 42 | @RequestMapping(value = "/product/all", method = RequestMethod.GET, produces = "application/json") 43 | @ResponseStatus(HttpStatus.OK) 44 | public List getCatalog() { 45 | ResponseEntity> responseEntity= gatewayService.getCatalog(); 46 | return responseEntity.getBody(); 47 | } 48 | 49 | @RequestMapping(value = "/customer/create", method = RequestMethod.POST, produces = "application/json", consumes ="application/json") 50 | @ResponseStatus(HttpStatus.CREATED) 51 | public Customer createCustomer(@RequestBody Customer customer) { 52 | return gatewayService.createCustomer(customer); 53 | } 54 | 55 | @RequestMapping(value = "/customer/auth", method = RequestMethod.POST, produces = "application/json", consumes ="application/json") 56 | public ResponseEntity login(@RequestBody Customer customer) { 57 | boolean success = gatewayService.authenticateUser(customer); 58 | if(success) { 59 | ResponseEntity entity = new ResponseEntity(HttpStatus.OK); 60 | return entity; 61 | } 62 | else { 63 | ResponseEntity entity = new ResponseEntity(HttpStatus.UNAUTHORIZED); 64 | return entity; 65 | } 66 | 67 | } 68 | 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/util/DatabaseUtil.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.util; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.context.annotation.PropertySource; 7 | import org.springframework.core.env.Environment; 8 | import org.springframework.data.cassandra.config.CassandraClusterFactoryBean; 9 | import org.springframework.data.cassandra.config.CassandraSessionFactoryBean; 10 | import org.springframework.data.cassandra.config.SchemaAction; 11 | import org.springframework.data.cassandra.convert.CassandraConverter; 12 | import org.springframework.data.cassandra.convert.MappingCassandraConverter; 13 | import org.springframework.data.cassandra.core.CassandraOperations; 14 | import org.springframework.data.cassandra.core.CassandraTemplate; 15 | import org.springframework.data.cassandra.mapping.BasicCassandraMappingContext; 16 | import org.springframework.data.cassandra.mapping.CassandraMappingContext; 17 | 18 | @Configuration 19 | @PropertySource(value = { "classpath:db.properties" }) 20 | public class DatabaseUtil { 21 | /** 22 | * Constant String for Keyspace 23 | */ 24 | private static final String KEYSPACE = "cmpe282.db.keyspace"; 25 | /** 26 | * Constant String for ContactPoints 27 | */ 28 | private static final String CONTACTPOINTS = "cmpe282.db.contactpoints"; 29 | /** 30 | * Constant String for Port 31 | */ 32 | private static final String PORT = "cmpe282.db.port"; 33 | 34 | @Autowired 35 | private Environment environment; 36 | 37 | private String getKeyspaceName() { 38 | return environment.getProperty(KEYSPACE); 39 | } 40 | 41 | private String getContactPoints() { 42 | return environment.getProperty(CONTACTPOINTS); 43 | } 44 | 45 | private int getPortNumber() { 46 | return Integer.parseInt(environment.getProperty(PORT)); 47 | } 48 | 49 | @Bean 50 | public CassandraClusterFactoryBean cluster() { 51 | CassandraClusterFactoryBean cluster = new CassandraClusterFactoryBean(); 52 | cluster.setContactPoints(getContactPoints()); 53 | cluster.setPort(getPortNumber()); 54 | return cluster; 55 | } 56 | 57 | @Bean 58 | public CassandraMappingContext mappingContext() { 59 | return new BasicCassandraMappingContext(); 60 | } 61 | 62 | @Bean 63 | public CassandraConverter converter() { 64 | return new MappingCassandraConverter(mappingContext()); 65 | } 66 | 67 | @Bean 68 | public CassandraSessionFactoryBean session() throws Exception { 69 | CassandraSessionFactoryBean cassandraSessionFactoryBean = new CassandraSessionFactoryBean(); 70 | cassandraSessionFactoryBean.setCluster(cluster().getObject()); 71 | cassandraSessionFactoryBean.setKeyspaceName(getKeyspaceName()); 72 | cassandraSessionFactoryBean.setConverter(converter()); 73 | cassandraSessionFactoryBean.setSchemaAction(SchemaAction.NONE); 74 | return cassandraSessionFactoryBean; 75 | } 76 | 77 | @Bean 78 | public CassandraOperations cassandraTemplate() throws Exception { 79 | return new CassandraTemplate(session().getObject()); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /eshop-ui/viewproduct.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | "use strict"; 3 | 4 | function init() { 5 | var productID = getUrlParameter("productID"); 6 | if(!productID) { 7 | $.notify('Product ID missing in URL', 'error'); 8 | return; 9 | } 10 | $.ajax({ 11 | url: "http://ec2-52-53-167-111.us-west-1.compute.amazonaws.com:8086/gateway/product/" + productID, 12 | type: "GET", 13 | headers: { 14 | 'Accept': 'application/json', 15 | 'Content-Type': 'application/json' 16 | }, 17 | 'dataType': 'json' 18 | }).done(function(response) { 19 | renderProductDetails(response) 20 | }).fail(function(response){ 21 | switch(response.status) { 22 | case 400: 23 | $.notify('Bad Request. Missing required fields', 'error'); 24 | break; 25 | default: 26 | $.notify('Internal Server Error, failed to fetch Product Details. Please try again.', 'error') 27 | } 28 | }); 29 | } 30 | 31 | function renderProductDetails(productDetails) { 32 | $('.product-details').append( 33 | "
    " + 34 | "" + 35 | "" + 36 | "
    " + 37 | "
    " + 38 | "" + 39 | "" + 40 | "
    " + 41 | "
    " + 42 | "" + 43 | "" + 44 | "
    " + 45 | "
    " + 46 | "" + 47 | "" + 48 | "
    " + 49 | "
    " + 50 | "" + 51 | "" + 52 | "
    " + 53 | "
    " + 54 | "" + 55 | "" + 56 | "
    " 57 | ); 58 | } 59 | 60 | function getUrlParameter(sParam) { 61 | var sPageURL = decodeURIComponent(window.location.search.substring(1)), 62 | sURLVariables = sPageURL.split('&'), 63 | sParameterName, 64 | i; 65 | 66 | for (i = 0; i < sURLVariables.length; i++) { 67 | sParameterName = sURLVariables[i].split('='); 68 | 69 | if (sParameterName[0] === sParam) { 70 | return sParameterName[1] === undefined ? true : sParameterName[1]; 71 | } 72 | } 73 | } 74 | 75 | init(); 76 | }); 77 | -------------------------------------------------------------------------------- /gateway-microservice/src/main/java/com/gateway/model/Customer.java: -------------------------------------------------------------------------------- 1 | package com.gateway.model; 2 | 3 | import java.util.Date; 4 | import java.util.UUID; 5 | 6 | public class Customer { 7 | private UUID customerId; 8 | 9 | private String firstName; 10 | 11 | private String lastName; 12 | 13 | private String email; 14 | 15 | private String password; 16 | 17 | private Date createDate; 18 | 19 | /** 20 | * @param customerId 21 | * @param firstName 22 | * @param lastName 23 | * @param password 24 | * @param createDate 25 | */ 26 | public Customer(UUID customerId, String firstName, String lastName, 27 | String password, Date createDate) { 28 | super(); 29 | this.customerId = customerId; 30 | this.firstName = firstName; 31 | this.lastName = lastName; 32 | this.password = password; 33 | 34 | if (createDate != null) { 35 | this.createDate = createDate; 36 | } else { 37 | this.createDate = new Date(); 38 | } 39 | } 40 | 41 | /** 42 | * @param customerId 43 | * @param firstName 44 | * @param lastName 45 | * @param createDate 46 | */ 47 | public Customer(UUID userId, String firstName, String lastName, 48 | Date createDate) { 49 | super(); 50 | this.customerId = userId; 51 | this.firstName = firstName; 52 | this.lastName = lastName; 53 | this.createDate = createDate; 54 | } 55 | 56 | /* (non-Javadoc) 57 | * @see java.lang.Object#toString() 58 | */ 59 | @Override 60 | public String toString() { 61 | return "Customer [customerId=" + customerId + ", firstName=" + firstName 62 | + ", lastName=" + lastName + ", createDate=" + createDate + "]"; 63 | } 64 | 65 | /** 66 | * @return the customerId 67 | */ 68 | public UUID getCustomerId() { 69 | return customerId; 70 | } 71 | 72 | /** 73 | * @param customerId the customerId to set 74 | */ 75 | public void setCustomerId(UUID customerId) { 76 | this.customerId = customerId; 77 | } 78 | 79 | /** 80 | * @return the firstName 81 | */ 82 | public String getFirstName() { 83 | return firstName; 84 | } 85 | 86 | /** 87 | * @param firstName the firstName to set 88 | */ 89 | public void setFirstName(String firstName) { 90 | this.firstName = firstName; 91 | } 92 | 93 | /** 94 | * @return the lastName 95 | */ 96 | public String getLastName() { 97 | return lastName; 98 | } 99 | 100 | /** 101 | * @param lastName the lastName to set 102 | */ 103 | public void setLastName(String lastName) { 104 | this.lastName = lastName; 105 | } 106 | 107 | /** 108 | * @return the createDate 109 | */ 110 | public Date getCreateDate() { 111 | return createDate; 112 | } 113 | 114 | /** 115 | * @param createDate the createDate to set 116 | */ 117 | public void setCreateDate(Date createDate) { 118 | this.createDate = createDate; 119 | } 120 | 121 | /** 122 | * 123 | */ 124 | public Customer() { 125 | super(); 126 | } 127 | 128 | /** 129 | * @return the password 130 | */ 131 | public String getPassword() { 132 | return password; 133 | } 134 | 135 | /** 136 | * @param password the password to set 137 | */ 138 | public void setPassword(String password) { 139 | this.password = password; 140 | } 141 | 142 | public String getEmail() { 143 | return email; 144 | } 145 | 146 | public void setEmail(String email) { 147 | this.email = email; 148 | } 149 | 150 | 151 | } 152 | -------------------------------------------------------------------------------- /customer-microservice/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.sjsu.cmpe282 7 | customer 8 | 1.0 9 | jar 10 | 11 | customer-microservice 12 | CustomerMicroService API 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 1.3.3.RELEASE 18 | 19 | 20 | 21 | UTF-8 22 | UTF-8 23 | 1.8 24 | customer-microservice 25 | 26 | 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | 35 | org.springframework.data 36 | spring-data-cassandra 37 | 1.3.4.RELEASE 38 | 39 | 40 | commons-httpclient 41 | commons-httpclient 42 | 3.1 43 | 44 | 45 | org.springframework.boot 46 | spring-boot-starter-amqp 47 | 48 | 49 | org.scala-lang 50 | scala-library 51 | 2.11.0 52 | 53 | 54 | com.fasterxml.jackson.core 55 | jackson-core 56 | 2.8.3 57 | 58 | 59 | com.fasterxml.jackson.core 60 | jackson-databind 61 | 2.8.3 62 | 63 | 64 | com.fasterxml.jackson.core 65 | jackson-annotations 66 | 2.8.3 67 | 68 | 69 | 70 | 71 | 72 | 73 | org.springframework.boot 74 | spring-boot-maven-plugin 75 | 76 | 77 | com.spotify 78 | docker-maven-plugin 79 | 0.4.12 80 | 81 | ${docker.image.prefix}/${project.artifactId} 82 | src/main/docker 83 | 84 | 85 | / 86 | ${project.build.directory} 87 | ${project.build.finalName}.jar 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | spring-releases 98 | https://repo.spring.io/libs-release 99 | 100 | 101 | 102 | 103 | spring-releases 104 | https://repo.spring.io/libs-release 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /customer-microservice/src/main/java/com/sjsu/cmpe282/model/Customer.java: -------------------------------------------------------------------------------- 1 | package com.sjsu.cmpe282.model; 2 | 3 | import java.util.Date; 4 | import java.util.UUID; 5 | 6 | import org.springframework.data.cassandra.mapping.Column; 7 | import org.springframework.data.cassandra.mapping.PrimaryKey; 8 | import org.springframework.data.cassandra.mapping.Table; 9 | 10 | @Table("customer") 11 | public class Customer { 12 | @PrimaryKey("customer_id") 13 | private UUID customerId; 14 | 15 | @Column("first_name") 16 | private String firstName; 17 | 18 | @Column("last_name") 19 | private String lastName; 20 | 21 | @Column("email") 22 | private String email; 23 | 24 | @Column("password") 25 | private String password; 26 | 27 | @Column("created") 28 | private Date createDate; 29 | 30 | /** 31 | * @param customerId 32 | * @param firstName 33 | * @param lastName 34 | * @param password 35 | * @param createDate 36 | */ 37 | public Customer(UUID customerId, String firstName, String lastName, 38 | String password, Date createDate) { 39 | super(); 40 | this.customerId = customerId; 41 | this.firstName = firstName; 42 | this.lastName = lastName; 43 | this.password = password; 44 | 45 | if (createDate != null) { 46 | this.createDate = createDate; 47 | } else { 48 | this.createDate = new Date(); 49 | } 50 | } 51 | 52 | /** 53 | * @param customerId 54 | * @param firstName 55 | * @param lastName 56 | * @param createDate 57 | */ 58 | public Customer(UUID userId, String firstName, String lastName, 59 | Date createDate) { 60 | super(); 61 | this.customerId = userId; 62 | this.firstName = firstName; 63 | this.lastName = lastName; 64 | this.createDate = createDate; 65 | } 66 | 67 | /* (non-Javadoc) 68 | * @see java.lang.Object#toString() 69 | */ 70 | @Override 71 | public String toString() { 72 | return "Customer [customerId=" + customerId + ", firstName=" + firstName 73 | + ", lastName=" + lastName + ", createDate=" + createDate + "]"; 74 | } 75 | 76 | /** 77 | * @return the customerId 78 | */ 79 | public UUID getCustomerId() { 80 | return customerId; 81 | } 82 | 83 | /** 84 | * @param customerId the customerId to set 85 | */ 86 | public void setCustomerId(UUID customerId) { 87 | this.customerId = customerId; 88 | } 89 | 90 | /** 91 | * @return the firstName 92 | */ 93 | public String getFirstName() { 94 | return firstName; 95 | } 96 | 97 | /** 98 | * @param firstName the firstName to set 99 | */ 100 | public void setFirstName(String firstName) { 101 | this.firstName = firstName; 102 | } 103 | 104 | /** 105 | * @return the lastName 106 | */ 107 | public String getLastName() { 108 | return lastName; 109 | } 110 | 111 | /** 112 | * @param lastName the lastName to set 113 | */ 114 | public void setLastName(String lastName) { 115 | this.lastName = lastName; 116 | } 117 | 118 | /** 119 | * @return the createDate 120 | */ 121 | public Date getCreateDate() { 122 | return createDate; 123 | } 124 | 125 | /** 126 | * @param createDate the createDate to set 127 | */ 128 | public void setCreateDate(Date createDate) { 129 | this.createDate = createDate; 130 | } 131 | 132 | /** 133 | * 134 | */ 135 | public Customer() { 136 | super(); 137 | } 138 | 139 | /** 140 | * @return the password 141 | */ 142 | public String getPassword() { 143 | return password; 144 | } 145 | 146 | /** 147 | * @param password the password to set 148 | */ 149 | public void setPassword(String password) { 150 | this.password = password; 151 | } 152 | 153 | public String getEmail() { 154 | return email; 155 | } 156 | 157 | public void setEmail(String email) { 158 | this.email = email; 159 | } 160 | 161 | 162 | } 163 | -------------------------------------------------------------------------------- /products-microservice/src/main/java/com/products/services/ProductService.java: -------------------------------------------------------------------------------- 1 | package com.products.services; 2 | 3 | 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.UUID; 7 | import org.apache.commons.logging.Log; 8 | import org.apache.commons.logging.LogFactory; 9 | import org.json.JSONException; 10 | import org.json.JSONObject; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | import org.springframework.web.client.RestTemplate; 14 | 15 | import com.products.model.Inventory; 16 | import com.products.model.Product; 17 | import com.products.repositories.IProductDetailsRepository; 18 | 19 | @Service 20 | public class ProductService { 21 | 22 | @Autowired 23 | private IProductDetailsRepository productDetailsRepo; 24 | 25 | final String inventoryURI = "http://ec2-54-67-113-169.us-west-1.compute.amazonaws.com:8084/inventory/"; 26 | //final String inventoryURI = "http://localhost:8084/inventory/"; 27 | 28 | 29 | private Log log = LogFactory.getLog(ProductService.class); 30 | 31 | public boolean addProduct(Product product){ 32 | productDetailsRepo.save(product); 33 | return true; 34 | } 35 | 36 | public boolean isValid(String productId) { 37 | if(!(productDetailsRepo.exists(productId))) 38 | return false; 39 | return true; 40 | } 41 | 42 | public ArrayList listAll() throws JSONException { 43 | //if(addProducts()){ 44 | System.out.println("returning product list"); 45 | return (ArrayList) productDetailsRepo.findAll(); 46 | //} 47 | 48 | //return null; 49 | 50 | /*if(addProducts()){ 51 | List productList = productDetailsRepo.findAll(); 52 | List products = new ArrayList(); 53 | for (Product p : productList) { 54 | JSONObject product = new JSONObject(); 55 | product.put("productId", p.getId()); 56 | product.put("productName", p.getProductName()); 57 | 58 | products.add(product); 59 | } 60 | return (ArrayList) products; 61 | } 62 | 63 | return null; 64 | */ 65 | } 66 | 67 | public boolean addProducts(){ 68 | System.out.println("***CREATING PRODUCT DATA****"); 69 | productDetailsRepo.deleteAll(); 70 | ArrayList productList= new ArrayList(); 71 | Product product1 = new Product(UUID.randomUUID().toString(), "Not a Penny More, Not a Penny less",259.23,"Novel by Jeffery Archer", "Novel"); 72 | Product product2 = new Product(UUID.randomUUID().toString(), "Macbeth",40.00,"Play by Sherlock Holmes", "Plays"); 73 | Product product3 = new Product(UUID.randomUUID().toString(), "Head First Java",20.00,"A java beginners reference", "Textbook"); 74 | Product product4 = new Product(UUID.randomUUID().toString(), "Head First Design Patterns",25.00,"A design patterns reference book", "Textbook"); 75 | Product product5 = new Product(UUID.randomUUID().toString(), "fairy Colors",25.00,"Coloring Book", "Kids"); 76 | Product product7 = new Product(UUID.randomUUID().toString(), "Guitar Guide",40.00,"A guitar lesson book", "Music"); 77 | 78 | productList.add(product1); 79 | productList.add(product2); 80 | productList.add(product3); 81 | productList.add(product4); 82 | productList.add(product5); 83 | productList.add(product7); 84 | 85 | productDetailsRepo.save(productList); 86 | createInventory(productList); 87 | 88 | 89 | return true; 90 | } 91 | 92 | private void createInventory(ArrayList productList) { 93 | System.out.println("***DELETING INVENTORY****"); 94 | RestTemplate restTemplate = new RestTemplate(); 95 | restTemplate.delete(inventoryURI); 96 | 97 | System.out.println("***CREATING INVENTORY****"); 98 | for(Product product:productList){ 99 | Inventory newInventory = new Inventory(product.getId(),1000); 100 | restTemplate.postForObject(inventoryURI + "create", newInventory, Inventory.class); 101 | } 102 | 103 | 104 | } 105 | 106 | public Product getProductInfo(String productId) { 107 | // TODO Auto-generated method stub 108 | return productDetailsRepo.findById(productId); 109 | } 110 | 111 | 112 | } 113 | -------------------------------------------------------------------------------- /gateway-microservice/src/main/java/com/gateway/service/GatewayService.java: -------------------------------------------------------------------------------- 1 | package com.gateway.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | import java.util.HashMap; 6 | import java.util.List; 7 | import java.util.Map; 8 | import java.util.UUID; 9 | 10 | import org.springframework.core.ParameterizedTypeReference; 11 | import org.springframework.http.HttpEntity; 12 | import org.springframework.http.HttpHeaders; 13 | import org.springframework.http.HttpMethod; 14 | import org.springframework.http.HttpStatus; 15 | import org.springframework.http.MediaType; 16 | import org.springframework.http.ResponseEntity; 17 | import org.springframework.stereotype.Service; 18 | import org.springframework.web.client.RestTemplate; 19 | 20 | import com.gateway.model.Customer; 21 | import com.gateway.model.Inventory; 22 | import com.gateway.model.Product; 23 | import com.gateway.model.Review; 24 | import com.gateway.model.ViewProduct; 25 | @Service 26 | public class GatewayService { 27 | 28 | /*final String productURI = "http://localhost:8081/product/"; 29 | final String customerURI = "http://localhost:8080/customer/"; 30 | final String reviewURI = "http://localhost:8085/review/"; 31 | final String inventoryURI = "http://localhost:8084/inventory/";*/ 32 | 33 | final String productURI = "http://ec2-**-**-**-***.us-west-1.compute.amazonaws.com:8081/product/"; 34 | final String customerURI = "http://ec2-**-**-**-***.us-west-1.compute.amazonaws.com:8080/customer/"; 35 | final String reviewURI = "http://ec2-**-**-**-***.us-west-1.compute.amazonaws.com:8085/review/"; 36 | final String inventoryURI = "http://ec2-**-**-**-***.us-west-1.compute.amazonaws.com:8084/inventory/"; 37 | 38 | RestTemplate restTemplate = new RestTemplate(); 39 | 40 | public ViewProduct getProductInfo(UUID productId) { 41 | System.out.println("In gateway service class"); 42 | //Map params = new HashMap(); 43 | //params.put("id", productId); 44 | 45 | Product product = restTemplate.getForObject(productURI+productId, Product.class); 46 | System.out.println("product obtained"); 47 | //Review review = restTemplate.getForObject(reviewURI, Review.class, params); 48 | Inventory inventory = restTemplate.getForObject(inventoryURI+productId, Inventory.class); 49 | System.out.println("inventory obtained"); 50 | ViewProduct viewProduct = new ViewProduct(product, 0.0, inventory.getAvailableStock()); 51 | return viewProduct; 52 | 53 | } 54 | 55 | public ResponseEntity> getCatalog() { 56 | System.out.println("Reached Gateway service!"); 57 | /*ResponseEntity> responseList = restTemplate.exchange(productURI + "list", HttpMethod.GET, null, 58 | new ParameterizedTypeReference>() { 59 | }); 60 | List productList = responseList.getBody();*/ 61 | 62 | HttpHeaders headers = new HttpHeaders(); 63 | headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON)); 64 | HttpEntity entity = new HttpEntity("parameters", headers); 65 | 66 | /*ResponseEntity response = restTemplate.exchange( 67 | productURI + "list",HttpMethod.GET,entity, Product[].class); 68 | 69 | return (ArrayList) Arrays.asList(response.getBody());*/ 70 | 71 | ParameterizedTypeReference> myProducts = new ParameterizedTypeReference>() {}; 72 | ResponseEntity> response = restTemplate.exchange(productURI + "list",HttpMethod.GET, entity, myProducts); 73 | System.out.println("*****Response****"+response); 74 | return response; 75 | } 76 | 77 | public Customer createCustomer(Customer customer) { 78 | 79 | RestTemplate restTemplate = new RestTemplate(); 80 | Customer createdCustomer = restTemplate.postForObject(customerURI + "create", customer, Customer.class); 81 | return createdCustomer; 82 | } 83 | 84 | public boolean authenticateUser(Customer customer) { 85 | RestTemplate restTemplate = new RestTemplate(); 86 | HttpEntity entity = new HttpEntity(customer); 87 | try { 88 | ResponseEntity response =restTemplate.exchange(customerURI + "auth",HttpMethod.POST, entity, String.class); 89 | System.out.println("Response: " + response.getStatusCodeValue()); 90 | } 91 | catch(Exception e) { 92 | return false; 93 | } 94 | return true; 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /customer-microservice/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | set MAVEN_CMD_LINE_ARGS=%* 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | 121 | set WRAPPER_JAR="".\.mvn\wrapper\maven-wrapper.jar"" 122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 123 | 124 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS% 125 | if ERRORLEVEL 1 goto error 126 | goto end 127 | 128 | :error 129 | set ERROR_CODE=1 130 | 131 | :end 132 | @endlocal & set ERROR_CODE=%ERROR_CODE% 133 | 134 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 135 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 136 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 137 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 138 | :skipRcPost 139 | 140 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 141 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 142 | 143 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 144 | 145 | exit /B %ERROR_CODE% -------------------------------------------------------------------------------- /gateway-microservice/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | set MAVEN_CMD_LINE_ARGS=%* 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | 121 | set WRAPPER_JAR="".\.mvn\wrapper\maven-wrapper.jar"" 122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 123 | 124 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS% 125 | if ERRORLEVEL 1 goto error 126 | goto end 127 | 128 | :error 129 | set ERROR_CODE=1 130 | 131 | :end 132 | @endlocal & set ERROR_CODE=%ERROR_CODE% 133 | 134 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 135 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 136 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 137 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 138 | :skipRcPost 139 | 140 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 141 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 142 | 143 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 144 | 145 | exit /B %ERROR_CODE% -------------------------------------------------------------------------------- /products-microservice/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | set MAVEN_CMD_LINE_ARGS=%* 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | 121 | set WRAPPER_JAR="".\.mvn\wrapper\maven-wrapper.jar"" 122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 123 | 124 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS% 125 | if ERRORLEVEL 1 goto error 126 | goto end 127 | 128 | :error 129 | set ERROR_CODE=1 130 | 131 | :end 132 | @endlocal & set ERROR_CODE=%ERROR_CODE% 133 | 134 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 135 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 136 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 137 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 138 | :skipRcPost 139 | 140 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 141 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 142 | 143 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 144 | 145 | exit /B %ERROR_CODE% -------------------------------------------------------------------------------- /customer-microservice/bin/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | set MAVEN_CMD_LINE_ARGS=%* 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | 121 | set WRAPPER_JAR="".\.mvn\wrapper\maven-wrapper.jar"" 122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 123 | 124 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS% 125 | if ERRORLEVEL 1 goto error 126 | goto end 127 | 128 | :error 129 | set ERROR_CODE=1 130 | 131 | :end 132 | @endlocal & set ERROR_CODE=%ERROR_CODE% 133 | 134 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 135 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 136 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 137 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 138 | :skipRcPost 139 | 140 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 141 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 142 | 143 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 144 | 145 | exit /B %ERROR_CODE% -------------------------------------------------------------------------------- /email-rabbit-microservice/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | set MAVEN_CMD_LINE_ARGS=%* 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | 121 | set WRAPPER_JAR="".\.mvn\wrapper\maven-wrapper.jar"" 122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 123 | 124 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS% 125 | if ERRORLEVEL 1 goto error 126 | goto end 127 | 128 | :error 129 | set ERROR_CODE=1 130 | 131 | :end 132 | @endlocal & set ERROR_CODE=%ERROR_CODE% 133 | 134 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 135 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 136 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 137 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 138 | :skipRcPost 139 | 140 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 141 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 142 | 143 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 144 | 145 | exit /B %ERROR_CODE% -------------------------------------------------------------------------------- /product-inventory-microservice/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | set MAVEN_CMD_LINE_ARGS=%* 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | 121 | set WRAPPER_JAR="".\.mvn\wrapper\maven-wrapper.jar"" 122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 123 | 124 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS% 125 | if ERRORLEVEL 1 goto error 126 | goto end 127 | 128 | :error 129 | set ERROR_CODE=1 130 | 131 | :end 132 | @endlocal & set ERROR_CODE=%ERROR_CODE% 133 | 134 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 135 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 136 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 137 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 138 | :skipRcPost 139 | 140 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 141 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 142 | 143 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 144 | 145 | exit /B %ERROR_CODE% -------------------------------------------------------------------------------- /order-microservice/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /review-microservice/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /recommendation-microservice/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gateway-microservice/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven2 Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # 58 | # Look for the Apple JDKs first to preserve the existing behaviour, and then look 59 | # for the new JDKs provided by Oracle. 60 | # 61 | if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then 62 | # 63 | # Apple JDKs 64 | # 65 | export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home 66 | fi 67 | 68 | if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then 69 | # 70 | # Apple JDKs 71 | # 72 | export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home 73 | fi 74 | 75 | if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then 76 | # 77 | # Oracle JDKs 78 | # 79 | export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home 80 | fi 81 | 82 | if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then 83 | # 84 | # Apple JDKs 85 | # 86 | export JAVA_HOME=`/usr/libexec/java_home` 87 | fi 88 | ;; 89 | esac 90 | 91 | if [ -z "$JAVA_HOME" ] ; then 92 | if [ -r /etc/gentoo-release ] ; then 93 | JAVA_HOME=`java-config --jre-home` 94 | fi 95 | fi 96 | 97 | if [ -z "$M2_HOME" ] ; then 98 | ## resolve links - $0 may be a link to maven's home 99 | PRG="$0" 100 | 101 | # need this for relative symlinks 102 | while [ -h "$PRG" ] ; do 103 | ls=`ls -ld "$PRG"` 104 | link=`expr "$ls" : '.*-> \(.*\)$'` 105 | if expr "$link" : '/.*' > /dev/null; then 106 | PRG="$link" 107 | else 108 | PRG="`dirname "$PRG"`/$link" 109 | fi 110 | done 111 | 112 | saveddir=`pwd` 113 | 114 | M2_HOME=`dirname "$PRG"`/.. 115 | 116 | # make it fully qualified 117 | M2_HOME=`cd "$M2_HOME" && pwd` 118 | 119 | cd "$saveddir" 120 | # echo Using m2 at $M2_HOME 121 | fi 122 | 123 | # For Cygwin, ensure paths are in UNIX format before anything is touched 124 | if $cygwin ; then 125 | [ -n "$M2_HOME" ] && 126 | M2_HOME=`cygpath --unix "$M2_HOME"` 127 | [ -n "$JAVA_HOME" ] && 128 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 129 | [ -n "$CLASSPATH" ] && 130 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 131 | fi 132 | 133 | # For Migwn, ensure paths are in UNIX format before anything is touched 134 | if $mingw ; then 135 | [ -n "$M2_HOME" ] && 136 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 137 | [ -n "$JAVA_HOME" ] && 138 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 139 | # TODO classpath? 140 | fi 141 | 142 | if [ -z "$JAVA_HOME" ]; then 143 | javaExecutable="`which javac`" 144 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 145 | # readlink(1) is not available as standard on Solaris 10. 146 | readLink=`which readlink` 147 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 148 | if $darwin ; then 149 | javaHome="`dirname \"$javaExecutable\"`" 150 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 151 | else 152 | javaExecutable="`readlink -f \"$javaExecutable\"`" 153 | fi 154 | javaHome="`dirname \"$javaExecutable\"`" 155 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 156 | JAVA_HOME="$javaHome" 157 | export JAVA_HOME 158 | fi 159 | fi 160 | fi 161 | 162 | if [ -z "$JAVACMD" ] ; then 163 | if [ -n "$JAVA_HOME" ] ; then 164 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 165 | # IBM's JDK on AIX uses strange locations for the executables 166 | JAVACMD="$JAVA_HOME/jre/sh/java" 167 | else 168 | JAVACMD="$JAVA_HOME/bin/java" 169 | fi 170 | else 171 | JAVACMD="`which java`" 172 | fi 173 | fi 174 | 175 | if [ ! -x "$JAVACMD" ] ; then 176 | echo "Error: JAVA_HOME is not defined correctly." >&2 177 | echo " We cannot execute $JAVACMD" >&2 178 | exit 1 179 | fi 180 | 181 | if [ -z "$JAVA_HOME" ] ; then 182 | echo "Warning: JAVA_HOME environment variable is not set." 183 | fi 184 | 185 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 186 | 187 | # For Cygwin, switch paths to Windows format before running java 188 | if $cygwin; then 189 | [ -n "$M2_HOME" ] && 190 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 191 | [ -n "$JAVA_HOME" ] && 192 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 193 | [ -n "$CLASSPATH" ] && 194 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 195 | fi 196 | 197 | # traverses directory structure from process work directory to filesystem root 198 | # first directory with .mvn subdirectory is considered project base directory 199 | find_maven_basedir() { 200 | local basedir=$(pwd) 201 | local wdir=$(pwd) 202 | while [ "$wdir" != '/' ] ; do 203 | if [ -d "$wdir"/.mvn ] ; then 204 | basedir=$wdir 205 | break 206 | fi 207 | wdir=$(cd "$wdir/.."; pwd) 208 | done 209 | echo "${basedir}" 210 | } 211 | 212 | # concatenates all lines of a file 213 | concat_lines() { 214 | if [ -f "$1" ]; then 215 | echo "$(tr -s '\n' ' ' < "$1")" 216 | fi 217 | } 218 | 219 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)} 220 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 221 | 222 | # Provide a "standardized" way to retrieve the CLI args that will 223 | # work with both Windows and non-Windows executions. 224 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 225 | export MAVEN_CMD_LINE_ARGS 226 | 227 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 228 | 229 | exec "$JAVACMD" \ 230 | $MAVEN_OPTS \ 231 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 232 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 233 | ${WRAPPER_LAUNCHER} "$@" 234 | --------------------------------------------------------------------------------