Repository navigation
Expand file tree
/
Copy pathContext.java
More file actions
141 lines (124 loc) · 3.07 KB
/
Copy pathContext.java
File metadata and controls
141 lines (124 loc) · 3.07 KB
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
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/* Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
package com.amazonaws.services.lambda.runtime;
import java.util.Collections;
import java.util.Map;
/**
*
* The context object allows you to access useful information available within
* the Lambda execution environment
*
*/
public interface Context {
/**
* Gets the AWS request ID associated with the request.
* <p>
* This is the same ID returned to the client that called invoke(). This ID
* is reused for retries on the same request.
* </p>
*/
String getAwsRequestId();
/**
* Gets the CloudWatch log group that this container is configured to log
* to.
* <p>
* The return value may be null:
* <ul>
* <li>
* If the container is not configured to log to CloudWatch.</li>
* <li>
* If the role provided to the function does not have sufficient
* permissions.</li>
* </ul>
* </p>
*/
String getLogGroupName();
/**
* Gets the CloudWatch log stream that this container is configured to log
* to.
* <p>
* The return value may be null:
* <ul>
* <li>
* If the container is not configured to log to CloudWatch.</li>
* <li>
* If the role provided to the function does not have sufficient
* permissions.</li>
* </ul>
* </p>
*/
String getLogStreamName();
/**
* Gets the name of the function being executed.
*
*/
String getFunctionName();
/**
* Gets the version of the function being executed.
*
*/
String getFunctionVersion();
/**
* Gets the function Arn of the resource being invoked.
*
*/
String getInvokedFunctionArn();
/**
* Gets information about the Amazon Cognito identity provider when invoked
* through the AWS Mobile SDK. It can be null
*
*/
CognitoIdentity getIdentity();
/**
* Gets information about the client application and device when invoked
* through the AWS Mobile SDK. It can be null.
*
*/
ClientContext getClientContext();
/**
* Gets the time remaining for this execution in milliseconds
*/
int getRemainingTimeInMillis();
/**
* Gets the memory size configured for the Lambda function
*
*/
int getMemoryLimitInMB();
/**
* Gets the lambda logger instance associated with the context object
*
*/
LambdaLogger getLogger();
/**
*
* Returns the tenant ID associated with the request.
*
* @return null by default
*/
default String getTenantId() {
return null;
}
/**
*
* Returns the X-Ray trace ID associated with the request.
*
* @return null by default
*/
default String getXrayTraceId() {
return null;
}
/**
* Returns the W3C trace-context fields associated with the request at invoke
* time.
* <p>
* The returned map only ever contains the allowlisted W3C trace-context
* keys ({@code traceparent}, {@code tracestate}, {@code baggage}) that were
* carried on the invoke's client context. Any other key, and any allowlisted
* key whose value is not a string, is dropped.
* </p>
*
* @return an unmodifiable map of W3C trace-context fields; empty by default
*/
default Map<String, String> w3c() {
return Collections.emptyMap();
}
}