Skip to content

Commit 943352c

Browse files
committed
add KinesisAnalytics events. Update pom.xml for next release
1 parent b9abd1b commit 943352c

6 files changed

+617
-1
lines changed

aws-lambda-java-events/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>com.amazonaws</groupId>
55
<artifactId>aws-lambda-java-events</artifactId>
6-
<version>2.0.2</version>
6+
<version>2.1.0</version>
77
<packaging>jar</packaging>
88

99
<name>AWS Lambda Java Events Library</name>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/*
2+
* Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5+
* the License. A copy of the License is located at
6+
*
7+
* http://aws.amazon.com/apache2.0
8+
*
9+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11+
* and limitations under the License.
12+
*/
13+
package com.amazonaws.services.lambda.runtime.events;
14+
15+
import java.io.Serializable;
16+
import java.nio.ByteBuffer;
17+
import java.util.List;
18+
19+
/**
20+
* Event model for pre-processing Kinesis Firehose records through Kinesis
21+
* Analytics Lambda pre-processing function.
22+
*/
23+
public class KinesisAnalyticsFirehoseInputPreprocessingEvent implements Serializable {
24+
private static final long serialVersionUID = 3372554211277515302L;
25+
public String invocationId;
26+
public String applicationArn;
27+
public String streamArn;
28+
public List<Record> records;
29+
30+
public KinesisAnalyticsFirehoseInputPreprocessingEvent() {
31+
}
32+
33+
public KinesisAnalyticsFirehoseInputPreprocessingEvent(String invocationId, String applicationArn, String streamArn,
34+
List<Record> records) {
35+
super();
36+
this.invocationId = invocationId;
37+
this.applicationArn = applicationArn;
38+
this.streamArn = streamArn;
39+
this.records = records;
40+
}
41+
42+
public String getInvocationId() {
43+
return invocationId;
44+
}
45+
46+
public void setInvocationId(String invocationId) {
47+
this.invocationId = invocationId;
48+
}
49+
50+
public String getApplicationArn() {
51+
return applicationArn;
52+
}
53+
54+
public void setApplicationArn(String applicationArn) {
55+
this.applicationArn = applicationArn;
56+
}
57+
58+
public String getStreamArn() {
59+
return streamArn;
60+
}
61+
62+
public void setStreamArn(String streamArn) {
63+
this.streamArn = streamArn;
64+
}
65+
66+
public List<Record> getRecords() {
67+
return records;
68+
}
69+
70+
public void setRecords(List<Record> records) {
71+
this.records = records;
72+
}
73+
74+
public static class Record implements Serializable {
75+
private static final long serialVersionUID = 9130920004800315787L;
76+
public String recordId;
77+
public KinesisFirehoseRecordMetadata kinesisFirehoseRecordMetadata;
78+
public ByteBuffer data;
79+
80+
public Record() {
81+
}
82+
83+
public Record(String recordId, KinesisFirehoseRecordMetadata kinesisFirehoseRecordMetadata, ByteBuffer data) {
84+
super();
85+
this.recordId = recordId;
86+
this.kinesisFirehoseRecordMetadata = kinesisFirehoseRecordMetadata;
87+
this.data = data;
88+
}
89+
90+
public String getRecordId() {
91+
return recordId;
92+
}
93+
94+
public void setRecordId(String recordId) {
95+
this.recordId = recordId;
96+
}
97+
98+
public ByteBuffer getData() {
99+
return data;
100+
}
101+
102+
public void setData(ByteBuffer data) {
103+
this.data = data;
104+
}
105+
106+
public KinesisFirehoseRecordMetadata getKinesisFirehoseRecordMetadata() {
107+
return kinesisFirehoseRecordMetadata;
108+
}
109+
110+
public void setKinesisFirehoseRecordMetadata(KinesisFirehoseRecordMetadata kinesisFirehoseRecordMetadata) {
111+
this.kinesisFirehoseRecordMetadata = kinesisFirehoseRecordMetadata;
112+
}
113+
114+
public static class KinesisFirehoseRecordMetadata implements Serializable {
115+
private static final long serialVersionUID = 692430771749481045L;
116+
public Long approximateArrivalTimestamp;
117+
118+
public KinesisFirehoseRecordMetadata() {
119+
}
120+
121+
public KinesisFirehoseRecordMetadata(Long approximateArrivalTimestamp) {
122+
super();
123+
this.approximateArrivalTimestamp = approximateArrivalTimestamp;
124+
}
125+
126+
public Long getApproximateArrivalTimestamp() {
127+
return approximateArrivalTimestamp;
128+
}
129+
130+
public void setApproximateArrivalTimestamp(Long approximateArrivalTimestamp) {
131+
this.approximateArrivalTimestamp = approximateArrivalTimestamp;
132+
}
133+
}
134+
}
135+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
* Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5+
* the License. A copy of the License is located at
6+
*
7+
* http://aws.amazon.com/apache2.0
8+
*
9+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11+
* and limitations under the License.
12+
*/
13+
14+
package com.amazonaws.services.lambda.runtime.events;
15+
16+
import java.io.Serializable;
17+
import java.nio.ByteBuffer;
18+
import java.util.List;
19+
20+
/**
21+
* Response model for Kinesis Analytics Preprocessing Lambda function.
22+
*/
23+
public class KinesisAnalyticsInputPreprocessingResponse implements Serializable {
24+
25+
public enum Result {
26+
27+
/**
28+
* Indicates that processing of this item succeeded.
29+
*/
30+
Ok,
31+
32+
/**
33+
* Indicate that the processing of this item failed
34+
*/
35+
ProcessingFailed,
36+
37+
/**
38+
* Indicates that this item should be silently dropped
39+
*/
40+
Dropped
41+
}
42+
43+
private static final long serialVersionUID = -4651154757825854471L;
44+
public List<Record> records;
45+
46+
public KinesisAnalyticsInputPreprocessingResponse() {
47+
super();
48+
}
49+
50+
public KinesisAnalyticsInputPreprocessingResponse(List<Record> records) {
51+
super();
52+
this.records = records;
53+
}
54+
55+
public List<Record> getRecords() {
56+
return records;
57+
}
58+
59+
public void setRecords(List<Record> records) {
60+
this.records = records;
61+
}
62+
63+
public static class Record implements Serializable {
64+
private static final long serialVersionUID = -1583558686451236985L;
65+
public String recordId;
66+
public Result result;
67+
68+
public Record() {
69+
super();
70+
}
71+
72+
public Record(String recordId, Result result, ByteBuffer data) {
73+
super();
74+
this.recordId = recordId;
75+
this.result = result;
76+
this.data = data;
77+
}
78+
79+
public ByteBuffer data;
80+
81+
public String getRecordId() {
82+
return recordId;
83+
}
84+
85+
public void setRecordId(String recordId) {
86+
this.recordId = recordId;
87+
}
88+
89+
public Result getResult() {
90+
return result;
91+
}
92+
93+
public void setResult(Result result) {
94+
this.result = result;
95+
}
96+
97+
public ByteBuffer getData() {
98+
return data;
99+
}
100+
101+
public void setData(ByteBuffer data) {
102+
this.data = data;
103+
}
104+
}
105+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/*
2+
* Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5+
* the License. A copy of the License is located at
6+
*
7+
* http://aws.amazon.com/apache2.0
8+
*
9+
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11+
* and limitations under the License.
12+
*/
13+
package com.amazonaws.services.lambda.runtime.events;
14+
15+
import java.io.Serializable;
16+
import java.nio.ByteBuffer;
17+
import java.util.List;
18+
19+
/**
20+
* Event model for Kinesis Analytics Lambda output delivery.
21+
*/
22+
public class KinesisAnalyticsOutputDeliveryEvent implements Serializable {
23+
private static final long serialVersionUID = -276093256265202318L;
24+
public String invocationId;
25+
public String applicationArn;
26+
public List<Record> records;
27+
28+
public KinesisAnalyticsOutputDeliveryEvent() {
29+
}
30+
31+
public KinesisAnalyticsOutputDeliveryEvent(String invocationId, String applicationArn, List<Record> records) {
32+
super();
33+
this.invocationId = invocationId;
34+
this.applicationArn = applicationArn;
35+
this.records = records;
36+
}
37+
38+
public String getInvocationId() {
39+
return invocationId;
40+
}
41+
42+
public void setInvocationId(String invocationId) {
43+
this.invocationId = invocationId;
44+
}
45+
46+
public String getApplicationArn() {
47+
return applicationArn;
48+
}
49+
50+
public void setApplicationArn(String applicationArn) {
51+
this.applicationArn = applicationArn;
52+
}
53+
54+
public List<Record> getRecords() {
55+
return records;
56+
}
57+
58+
public void setRecords(List<Record> records) {
59+
this.records = records;
60+
}
61+
62+
public static class Record implements Serializable {
63+
private static final long serialVersionUID = -3545295536239762069L;
64+
public String recordId;
65+
public LambdaDeliveryRecordMetadata lambdaDeliveryRecordMetadata;
66+
public ByteBuffer data;
67+
68+
public Record() {
69+
}
70+
71+
public Record(String recordId, LambdaDeliveryRecordMetadata lambdaDeliveryRecordMetadata, ByteBuffer data) {
72+
super();
73+
this.recordId = recordId;
74+
this.lambdaDeliveryRecordMetadata = lambdaDeliveryRecordMetadata;
75+
this.data = data;
76+
}
77+
78+
public String getRecordId() {
79+
return recordId;
80+
}
81+
82+
public void setRecordId(String recordId) {
83+
this.recordId = recordId;
84+
}
85+
86+
public ByteBuffer getData() {
87+
return data;
88+
}
89+
90+
public void setData(ByteBuffer data) {
91+
this.data = data;
92+
}
93+
94+
public LambdaDeliveryRecordMetadata getLambdaDeliveryRecordMetadata() {
95+
return lambdaDeliveryRecordMetadata;
96+
}
97+
98+
public void setLambdaDeliveryRecordMetadata(LambdaDeliveryRecordMetadata lambdaDeliveryRecordMetadata) {
99+
this.lambdaDeliveryRecordMetadata = lambdaDeliveryRecordMetadata;
100+
}
101+
102+
public static class LambdaDeliveryRecordMetadata implements Serializable {
103+
private static final long serialVersionUID = -3809303175070680370L;
104+
public long retryHint;
105+
106+
public LambdaDeliveryRecordMetadata() {
107+
}
108+
109+
public LambdaDeliveryRecordMetadata(long retryHint) {
110+
super();
111+
this.retryHint = retryHint;
112+
}
113+
114+
public long getRetryHint() {
115+
return retryHint;
116+
}
117+
118+
public void setRetryHint(long retryHint) {
119+
this.retryHint = retryHint;
120+
}
121+
}
122+
}
123+
}

0 commit comments

Comments
 (0)