diff --git a/helidon-storefront-full/.classpath b/helidon-storefront-full/.classpath index 77be441..613e547 100644 --- a/helidon-storefront-full/.classpath +++ b/helidon-storefront-full/.classpath @@ -1,37 +1,43 @@ - + - + - + + + - + - - - + - - + + + + - + + + + + diff --git a/helidon-storefront-full/.factorypath b/helidon-storefront-full/.factorypath new file mode 100644 index 0000000..6a7a17a --- /dev/null +++ b/helidon-storefront-full/.factorypath @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/helidon-storefront-full/.settings/org.eclipse.jdt.apt.core.prefs b/helidon-storefront-full/.settings/org.eclipse.jdt.apt.core.prefs new file mode 100644 index 0000000..dfa4f3a --- /dev/null +++ b/helidon-storefront-full/.settings/org.eclipse.jdt.apt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.apt.aptEnabled=true +org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations +org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations diff --git a/helidon-storefront-full/.settings/org.eclipse.jdt.core.prefs b/helidon-storefront-full/.settings/org.eclipse.jdt.core.prefs index eeac0e7..cd99dd0 100644 --- a/helidon-storefront-full/.settings/org.eclipse.jdt.core.prefs +++ b/helidon-storefront-full/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,14 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.processAnnotations=enabled org.eclipse.jdt.core.compiler.release=enabled org.eclipse.jdt.core.compiler.source=17 diff --git a/helidon-storefront-full/pom.xml b/helidon-storefront-full/pom.xml index f42845e..f040309 100644 --- a/helidon-storefront-full/pom.xml +++ b/helidon-storefront-full/pom.xml @@ -1,4 +1,5 @@ + - - + 4.0.0 - - - io.helidon.applications - helidon-mp - 3.1.2 - - + + io.helidon.applications + helidon-mp + 3.2.12 + + + com.oracle.labs.helidon.storefront.Main 17 ${maven.compiler.source} - 1.18.26 + 1.18.36 3.3.1 + 3.1.2 true - ghcr.io/graalvm/graalvm-ce:ol9-java17-22.3.1 + ghcr.io/graalvm/jdk-community:17 com.oracle.labs.helidon storefront - ${project.parent.version} - ${project.artifactId} - io.helidon.microprofile.bundles helidon-microprofile + + io.helidon.microprofile.bundles + helidon-microprofile-core + + + io.helidon.microprofile.openapi + helidon-microprofile-openapi + + + io.helidon.microprofile.health + helidon-microprofile-health + + + jakarta.json.bind + jakarta.json.bind-api + + + org.glassfish.jersey.media + jersey-media-json-binding + runtime + + + io.helidon.logging + helidon-logging-jul + runtime + + org.jboss jandex runtime true + jakarta.activation jakarta.activation-api - runtime + + + org.eclipse.microprofile.metrics + microprofile-metrics-api + + + io.helidon.microprofile.metrics + helidon-microprofile-metrics org.junit.jupiter junit-jupiter-api test - + + + + org.hamcrest + hamcrest-all + test + + org.projectlombok @@ -86,13 +139,15 @@ SOFTWARE. --> ${version.lombok} provided - com.fasterxml.jackson.core jackson-databind - org.slf4j slf4j-jdk14 - - - io.helidon.tracing - helidon-tracing-zipkin - + + + + + + + + + + + + + + @@ -123,6 +187,17 @@ SOFTWARE. --> + + org.jboss.jandex jandex-maven-plugin diff --git a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/Main.java b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/Main.java index 2094f8b..604ca84 100644 --- a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/Main.java +++ b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/Main.java @@ -95,8 +95,7 @@ private static Config buildConfig() { // need to // build it before we can add it to the list. again if there were three or less // we could pass the ConfigSource builder directly into the sources method of - // the - // config builder. + // the config builder. List> configSourcesToScan = new ArrayList<>(5); configSourcesToScan.add(ConfigSources.file("conf/storefront-config.yaml") .pollingStrategy(PollingStrategies.regular(Duration.ofSeconds(5))).optional().build()); diff --git a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/data/ItemRequest.java b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/data/ItemRequest.java index 87cc70a..c172962 100644 --- a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/data/ItemRequest.java +++ b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/data/ItemRequest.java @@ -45,7 +45,7 @@ Software and the Larger Work(s), and to sublicense the foregoing rights on @Data @NoArgsConstructor @AllArgsConstructor -@Schema(name = "ItemRequest", description = "Details of a Item reservation request", example = "{\"requestedItem\", \"Pin\", \"requestedCount\",5}") +@Schema(name = "ItemRequest", description = "Details of a Item reservation request", example = "{\"requestedItem\": \"Pin\", \"requestedCount\": 5}") public class ItemRequest { @Schema(required = true, description = "Name of the item being requested", example = "Pin") private String requestedItem; diff --git a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/resources/StorefrontResource.java b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/resources/StorefrontResource.java index 2fe3bac..bfa3b03 100644 --- a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/resources/StorefrontResource.java +++ b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/resources/StorefrontResource.java @@ -45,7 +45,6 @@ Software and the Larger Work(s), and to sublicense the foregoing rights on import org.eclipse.microprofile.faulttolerance.Fallback; import org.eclipse.microprofile.faulttolerance.Timeout; import org.eclipse.microprofile.metrics.annotation.Counted; -import org.eclipse.microprofile.metrics.annotation.Metered; import org.eclipse.microprofile.metrics.annotation.Timed; import org.eclipse.microprofile.openapi.annotations.Operation; import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; @@ -137,9 +136,6 @@ public class StorefrontResource { @Fallback(fallbackMethod = "failedListStockItem") // add a timer to track how long is spent in this call @Timed(name = "listAllStockTimer") - // add a Meter to track how often we're called, absolute=true means the name - // given is used directly and not added to the class - @Metered(name = "listAllStockMeter", absolute = true) @Operation(summary = "List stock items", description = "Returns a list of all of the stock items currently held in the database (the list may be empty if there are no items)") @APIResponse(description = "A set of ItemDetails representing the current data in the database", responseCode = "200", content = @Content(schema = @Schema(name = "ItemDetails", implementation = ItemDetails.class, type = SchemaType.ARRAY), example = "[{\"itemCount\": 10, \"itemName\": \"Pencil\"}," + "{\"itemCount\": 50, \"itemName\": \"Eraser\"}," + "{\"itemCount\": 4600, \"itemName\": \"Pin\"}," @@ -191,7 +187,7 @@ public Collection listAllStock() { @APIResponse(description = "The requested change does not meet the minimum level required for the change (i.e. is <= the minimumChange value)", responseCode = "406") @APIResponse(description = "There are not enough of the requested item to fulfil your request", responseCode = "409") public ItemDetails reserveStockItem( - @RequestBody(description = "The details of the item being requested", required = true, content = @Content(schema = @Schema(name = "ItemRequest", implementation = ItemRequest.class), example = "{\"requestedItem\",\"Pencil\",\"requestedCount\",5}")) ItemRequest itemRequest, + @RequestBody(description = "The details of the item being requested", required = true, content = @Content(schema = @Schema(name = "ItemRequest", implementation = ItemRequest.class), example = "{\"requestedItem\": \"Pencil\",\"requestedCount\": 5}")) ItemRequest itemRequest, @Context SecurityContext securityContext) throws MinimumChangeException, UnknownItemException, NotEnoughItemsException { log.info("Requesting the reservation of " + itemRequest.getRequestedCount() + " items of "