Skip to content

Commit b40a29e

Browse files
committed
add copyright to files
1 parent 220e591 commit b40a29e

File tree

12 files changed

+205
-38
lines changed

12 files changed

+205
-38
lines changed

powertools-large-messages/pom.xml

+18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2023 Amazon.com, Inc. or its affiliates.
4+
~ Licensed under the Apache License, Version 2.0 (the
5+
~ "License"); you may not use this file except in compliance
6+
~ with the License. You may obtain a copy of the License at
7+
~ http://www.apache.org/licenses/LICENSE-2.0
8+
~ Unless required by applicable law or agreed to in writing, software
9+
~ distributed under the License is distributed on an "AS IS" BASIS,
10+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
~ See the License for the specific language governing permissions and
12+
~ limitations under the License.
13+
~
14+
-->
15+
216
<project xmlns="http://maven.apache.org/POM/4.0.0"
317
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
418
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -136,6 +150,10 @@
136150
</environmentVariables>
137151
</configuration>
138152
</plugin>
153+
<plugin>
154+
<groupId>org.apache.maven.plugins</groupId>
155+
<artifactId>maven-checkstyle-plugin</artifactId>
156+
</plugin>
139157
</plugins>
140158
</build>
141159

powertools-large-messages/src/main/java/software/amazon/lambda/powertools/largemessages/LargeMessage.java

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages;
216

317
import java.lang.annotation.ElementType;

powertools-large-messages/src/main/java/software/amazon/lambda/powertools/largemessages/LargeMessageConfig.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages;
216

17+
import static software.amazon.lambda.powertools.core.internal.LambdaConstants.AWS_REGION_ENV;
18+
319
import software.amazon.awssdk.http.urlconnection.UrlConnectionHttpClient;
420
import software.amazon.awssdk.regions.Region;
521
import software.amazon.awssdk.services.s3.S3Client;
622
import software.amazon.awssdk.services.s3.S3ClientBuilder;
723

8-
import static software.amazon.lambda.powertools.core.internal.LambdaConstants.AWS_REGION_ENV;
9-
1024
/**
1125
* Singleton instance for Large Message Config. We need this to provide a way to customize the S3 client configuration used by the annotation.
1226
* <br/>

powertools-large-messages/src/main/java/software/amazon/lambda/powertools/largemessages/LargeMessageProcessingException.java

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages;
216

317
public class LargeMessageProcessingException extends RuntimeException {

powertools-large-messages/src/main/java/software/amazon/lambda/powertools/largemessages/internal/LargeMessageAspect.java

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages.internal;
216

17+
import java.util.Optional;
318
import org.aspectj.lang.ProceedingJoinPoint;
419
import org.aspectj.lang.annotation.Around;
520
import org.aspectj.lang.annotation.Aspect;
@@ -8,8 +23,6 @@
823
import org.slf4j.LoggerFactory;
924
import software.amazon.lambda.powertools.largemessages.LargeMessage;
1025

11-
import java.util.Optional;
12-
1326
/**
1427
* Handle {@link LargeMessage} annotations.
1528
*/

powertools-large-messages/src/main/java/software/amazon/lambda/powertools/largemessages/internal/LargeMessageProcessor.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages.internal;
216

17+
import static java.lang.String.format;
18+
319
import org.aspectj.lang.ProceedingJoinPoint;
420
import org.slf4j.Logger;
521
import org.slf4j.LoggerFactory;
@@ -10,8 +26,6 @@
1026
import software.amazon.payloadoffloading.S3BackedPayloadStore;
1127
import software.amazon.payloadoffloading.S3Dao;
1228

13-
import static java.lang.String.format;
14-
1529
/**
1630
* Abstract processor for Large Messages. Handle the download from S3 and replace the actual S3 pointer with the content
1731
* of the S3 Object leveraging the payloadoffloading library.

powertools-large-messages/src/main/java/software/amazon/lambda/powertools/largemessages/internal/LargeMessageProcessorFactory.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages.internal;
216

317
import com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord;
418
import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage;
5-
619
import java.util.Optional;
720

821
class LargeMessageProcessorFactory {

powertools-large-messages/src/main/java/software/amazon/lambda/powertools/largemessages/internal/LargeSNSMessageProcessor.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages.internal;
216

317
import com.amazonaws.services.lambda.runtime.events.SNSEvent.MessageAttribute;
418
import com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord;
5-
619
import java.util.HashMap;
720
import java.util.Map;
821

powertools-large-messages/src/main/java/software/amazon/lambda/powertools/largemessages/internal/LargeSQSMessageProcessor.java

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages.internal;
216

317
import com.amazonaws.services.lambda.runtime.events.SQSEvent.MessageAttribute;
418
import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage;
5-
import org.slf4j.Logger;
6-
import org.slf4j.LoggerFactory;
7-
import software.amazon.awssdk.utils.BinaryUtils;
8-
import software.amazon.awssdk.utils.Md5Utils;
9-
1019
import java.nio.ByteBuffer;
1120
import java.nio.charset.StandardCharsets;
1221
import java.security.MessageDigest;
@@ -16,6 +25,10 @@
1625
import java.util.List;
1726
import java.util.Map;
1827
import java.util.Optional;
28+
import org.slf4j.Logger;
29+
import org.slf4j.LoggerFactory;
30+
import software.amazon.awssdk.utils.BinaryUtils;
31+
import software.amazon.awssdk.utils.Md5Utils;
1932

2033
class LargeSQSMessageProcessor extends LargeMessageProcessor<SQSMessage> {
2134

powertools-large-messages/src/test/java/software/amazon/lambda/powertools/largemessages/LargeMessageConfigTest.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages;
216

17+
import static org.assertj.core.api.Assertions.assertThat;
18+
319
import org.junit.jupiter.api.AfterEach;
420
import org.junit.jupiter.api.BeforeEach;
521
import org.junit.jupiter.api.Test;
622
import software.amazon.awssdk.regions.Region;
723
import software.amazon.awssdk.services.s3.S3Client;
824

9-
import static org.assertj.core.api.Assertions.assertThat;
10-
1125
public class LargeMessageConfigTest {
1226

1327
@BeforeEach

powertools-large-messages/src/test/java/software/amazon/lambda/powertools/largemessages/internal/LargeMessageAspectTest.java

+34-21
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,46 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages.internal;
216

17+
import static java.lang.String.format;
18+
import static org.assertj.core.api.Assertions.assertThat;
19+
import static org.assertj.core.api.Assertions.assertThatThrownBy;
20+
import static org.mockito.ArgumentMatchers.any;
21+
import static org.mockito.Mockito.never;
22+
import static org.mockito.Mockito.verify;
23+
import static org.mockito.Mockito.verifyNoInteractions;
24+
import static org.mockito.Mockito.when;
25+
import static org.mockito.MockitoAnnotations.openMocks;
26+
import static software.amazon.lambda.powertools.largemessages.internal.LargeSQSMessageProcessor.calculateMessageAttributesMd5;
27+
import static software.amazon.lambda.powertools.largemessages.internal.LargeSQSMessageProcessor.calculateMessageBodyMd5;
28+
329
import com.amazonaws.services.lambda.runtime.Context;
430
import com.amazonaws.services.lambda.runtime.events.KinesisEvent.KinesisEventRecord;
531
import com.amazonaws.services.lambda.runtime.events.SNSEvent;
632
import com.amazonaws.services.lambda.runtime.events.SNSEvent.SNS;
733
import com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord;
834
import com.amazonaws.services.lambda.runtime.events.SQSEvent.MessageAttribute;
935
import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage;
36+
import java.io.ByteArrayInputStream;
37+
import java.lang.reflect.Field;
38+
import java.nio.ByteBuffer;
39+
import java.nio.charset.StandardCharsets;
40+
import java.util.Collections;
41+
import java.util.HashMap;
42+
import java.util.Map;
43+
import java.util.function.Consumer;
1044
import org.assertj.core.api.Assertions;
1145
import org.junit.jupiter.api.BeforeEach;
1246
import org.junit.jupiter.api.Test;
@@ -23,27 +57,6 @@
2357
import software.amazon.lambda.powertools.largemessages.LargeMessageConfig;
2458
import software.amazon.lambda.powertools.largemessages.LargeMessageProcessingException;
2559

26-
import java.io.ByteArrayInputStream;
27-
import java.lang.reflect.Field;
28-
import java.nio.ByteBuffer;
29-
import java.nio.charset.StandardCharsets;
30-
import java.util.Collections;
31-
import java.util.HashMap;
32-
import java.util.Map;
33-
import java.util.function.Consumer;
34-
35-
import static java.lang.String.format;
36-
import static org.assertj.core.api.Assertions.assertThat;
37-
import static org.assertj.core.api.Assertions.assertThatThrownBy;
38-
import static org.mockito.ArgumentMatchers.any;
39-
import static org.mockito.Mockito.never;
40-
import static org.mockito.Mockito.verify;
41-
import static org.mockito.Mockito.verifyNoInteractions;
42-
import static org.mockito.Mockito.when;
43-
import static org.mockito.MockitoAnnotations.openMocks;
44-
import static software.amazon.lambda.powertools.largemessages.internal.LargeSQSMessageProcessor.calculateMessageAttributesMd5;
45-
import static software.amazon.lambda.powertools.largemessages.internal.LargeSQSMessageProcessor.calculateMessageBodyMd5;
46-
4760
public class LargeMessageAspectTest {
4861

4962
private static final String BIG_MSG = "A biiiiiiiig message";

powertools-large-messages/src/test/java/software/amazon/lambda/powertools/largemessages/internal/LargeMessageProcessorFactoryTest.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1+
/*
2+
* Copyright 2023 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
14+
115
package software.amazon.lambda.powertools.largemessages.internal;
216

17+
import static org.assertj.core.api.Assertions.assertThat;
18+
319
import com.amazonaws.services.lambda.runtime.events.KinesisEvent;
420
import com.amazonaws.services.lambda.runtime.events.SNSEvent;
521
import com.amazonaws.services.lambda.runtime.events.SQSEvent;
622
import org.junit.jupiter.api.Test;
723

8-
import static org.assertj.core.api.Assertions.assertThat;
9-
1024
public class LargeMessageProcessorFactoryTest {
1125

1226
@Test

0 commit comments

Comments
 (0)