-
Notifications
You must be signed in to change notification settings - Fork 228
/
Context.java
103 lines (89 loc) · 2.17 KB
/
Context.java
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
/* Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
package com.amazonaws.services.lambda.runtime;
/**
*
* 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();
}