Skip to content

Commit 9a014e1

Browse files
authored
split examples into packages (aws#264)
1 parent a0eb0fe commit 9a014e1

48 files changed

Lines changed: 105 additions & 73 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ FROM public.ecr.aws/lambda/java:17
2626
COPY --from=builder /build/examples/target/*.jar ${LAMBDA_TASK_ROOT}/lib/
2727

2828
# Default CMD (will be overridden by ImageConfig.Command in SAM template)
29-
CMD ["software.amazon.lambda.durable.examples.SimpleStepExample::handleRequest"]
29+
CMD ["software.amazon.lambda.durable.examples.step.SimpleStepExample::handleRequest"]

examples/Dockerfile-java17

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ FROM public.ecr.aws/lambda/java:17
2727
COPY --from=builder /build/examples/target/*.jar ${LAMBDA_TASK_ROOT}/lib/
2828

2929
# Default CMD (will be overridden by ImageConfig.Command in SAM template)
30-
CMD ["software.amazon.lambda.durable.examples.SimpleStepExample::handleRequest"]
30+
CMD ["software.amazon.lambda.durable.examples.step.SimpleStepExample::handleRequest"]

examples/Dockerfile-java21

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ FROM public.ecr.aws/lambda/java:21
2727
COPY --from=builder /build/examples/target/*.jar ${LAMBDA_TASK_ROOT}/lib/
2828

2929
# Default CMD (will be overridden by ImageConfig.Command in SAM template)
30-
CMD ["software.amazon.lambda.durable.examples.SimpleStepExample::handleRequest"]
30+
CMD ["software.amazon.lambda.durable.examples.step.SimpleStepExample::handleRequest"]

examples/Dockerfile-java25

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ FROM public.ecr.aws/lambda/java:25
2727
COPY --from=builder /build/examples/target/*.jar ${LAMBDA_TASK_ROOT}/lib/
2828

2929
# Default CMD (will be overridden by ImageConfig.Command in SAM template)
30-
CMD ["software.amazon.lambda.durable.examples.SimpleStepExample::handleRequest"]
30+
CMD ["software.amazon.lambda.durable.examples.step.SimpleStepExample::handleRequest"]

examples/src/main/java/software/amazon/lambda/durable/examples/CallbackExample.java renamed to examples/src/main/java/software/amazon/lambda/durable/examples/callback/CallbackExample.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
package software.amazon.lambda.durable.examples;
3+
package software.amazon.lambda.durable.examples.callback;
44

55
import java.time.Duration;
66
import software.amazon.lambda.durable.DurableContext;
77
import software.amazon.lambda.durable.DurableHandler;
88
import software.amazon.lambda.durable.config.CallbackConfig;
9+
import software.amazon.lambda.durable.examples.types.ApprovalRequest;
910

1011
/**
1112
* Example demonstrating callback operations for external system integration.
@@ -73,11 +74,3 @@ public String handleRequest(ApprovalRequest input, DurableContext context) {
7374
stepCtx -> prepared + " - " + preapprovalResult + " - " + approvalResult);
7475
}
7576
}
76-
77-
/** Input for the approval workflow. */
78-
record ApprovalRequest(String description, double amount, Integer timeoutSeconds) {
79-
// Convenience constructor for default timeout
80-
public ApprovalRequest(String description, double amount) {
81-
this(description, amount, null);
82-
}
83-
}

examples/src/main/java/software/amazon/lambda/durable/examples/ChildContextExample.java renamed to examples/src/main/java/software/amazon/lambda/durable/examples/child/ChildContextExample.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
package software.amazon.lambda.durable.examples;
3+
package software.amazon.lambda.durable.examples.child;
44

55
import java.time.Duration;
66
import software.amazon.lambda.durable.DurableContext;
77
import software.amazon.lambda.durable.DurableFuture;
88
import software.amazon.lambda.durable.DurableHandler;
9+
import software.amazon.lambda.durable.examples.types.GreetingRequest;
910

1011
/**
1112
* Example demonstrating child context workflows with the Durable Execution SDK.

examples/src/main/java/software/amazon/lambda/durable/examples/ManyAsyncChildContextExample.java renamed to examples/src/main/java/software/amazon/lambda/durable/examples/child/ManyAsyncChildContextExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
package software.amazon.lambda.durable.examples;
3+
package software.amazon.lambda.durable.examples.child;
44

55
import java.time.Duration;
66
import java.util.ArrayList;

examples/src/main/java/software/amazon/lambda/durable/examples/CustomConfigExample.java renamed to examples/src/main/java/software/amazon/lambda/durable/examples/general/CustomConfigExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
package software.amazon.lambda.durable.examples;
3+
package software.amazon.lambda.durable.examples.general;
44

55
import com.fasterxml.jackson.core.JsonProcessingException;
66
import com.fasterxml.jackson.databind.ObjectMapper;

examples/src/main/java/software/amazon/lambda/durable/examples/CustomPollingExample.java renamed to examples/src/main/java/software/amazon/lambda/durable/examples/general/CustomPollingExample.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
package software.amazon.lambda.durable.examples;
3+
package software.amazon.lambda.durable.examples.general;
44

55
import java.time.Duration;
66
import software.amazon.lambda.durable.DurableConfig;
77
import software.amazon.lambda.durable.DurableContext;
88
import software.amazon.lambda.durable.DurableHandler;
99
import software.amazon.lambda.durable.config.InvokeConfig;
10+
import software.amazon.lambda.durable.examples.types.GreetingRequest;
1011
import software.amazon.lambda.durable.retry.JitterStrategy;
1112
import software.amazon.lambda.durable.retry.PollingStrategies;
1213

examples/src/main/java/software/amazon/lambda/durable/examples/ErrorHandlingExample.java renamed to examples/src/main/java/software/amazon/lambda/durable/examples/general/ErrorHandlingExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
package software.amazon.lambda.durable.examples;
3+
package software.amazon.lambda.durable.examples.general;
44

55
import org.slf4j.Logger;
66
import org.slf4j.LoggerFactory;

0 commit comments

Comments
 (0)