|
53 | 53 | import software.amazon.awssdk.aws.greengrass.model.GetSecretValueResponse; |
54 | 54 | import software.amazon.awssdk.aws.greengrass.model.GetThingShadowRequest; |
55 | 55 | import software.amazon.awssdk.aws.greengrass.model.GetThingShadowResponse; |
| 56 | +import software.amazon.awssdk.aws.greengrass.model.IoTCoreConnectionStatusEvent; |
56 | 57 | import software.amazon.awssdk.aws.greengrass.model.IoTCoreMessage; |
57 | 58 | import software.amazon.awssdk.aws.greengrass.model.ListComponentsRequest; |
58 | 59 | import software.amazon.awssdk.aws.greengrass.model.ListComponentsResponse; |
|
82 | 83 | import software.amazon.awssdk.aws.greengrass.model.SubscribeToComponentUpdatesResponse; |
83 | 84 | import software.amazon.awssdk.aws.greengrass.model.SubscribeToConfigurationUpdateRequest; |
84 | 85 | import software.amazon.awssdk.aws.greengrass.model.SubscribeToConfigurationUpdateResponse; |
| 86 | +import software.amazon.awssdk.aws.greengrass.model.SubscribeToIoTCoreConnectionStatusRequest; |
| 87 | +import software.amazon.awssdk.aws.greengrass.model.SubscribeToIoTCoreConnectionStatusResponse; |
85 | 88 | import software.amazon.awssdk.aws.greengrass.model.SubscribeToIoTCoreRequest; |
86 | 89 | import software.amazon.awssdk.aws.greengrass.model.SubscribeToIoTCoreResponse; |
87 | 90 | import software.amazon.awssdk.aws.greengrass.model.SubscribeToTopicRequest; |
@@ -1049,6 +1052,89 @@ public StreamingResponse<CompletableFuture<SubscribeToIoTCoreResponse>, Subscrib |
1049 | 1052 | return new StreamingResponse<>(r.getResponse(), r); |
1050 | 1053 | } |
1051 | 1054 |
|
| 1055 | + /** |
| 1056 | + * Perform the subscribeToIoTCoreConnectionStatus operation asynchronously. |
| 1057 | + * The initial response or error will be returned as the result of the asynchronous future, further events will |
| 1058 | + * arrive via the streaming callbacks. |
| 1059 | + * |
| 1060 | + * @return a future which resolves to the response |
| 1061 | + * |
| 1062 | + * @param request request object |
| 1063 | + * @param onStreamEvent Callback for stream events. If an executor is provided, this method will run in the executor. |
| 1064 | + * @param onStreamError Callback for stream errors. Return true to close the stream, |
| 1065 | + * return false to keep the stream open. Even if an executor is provided, |
| 1066 | + * this method will not run in the executor. |
| 1067 | + * @param onStreamClosed Callback for when the stream closes. If an executor is provided, this method will run in the executor. |
| 1068 | + */ |
| 1069 | + public StreamingResponse<CompletableFuture<SubscribeToIoTCoreConnectionStatusResponse>, SubscribeToIoTCoreConnectionStatusResponseHandler> subscribeToIoTCoreConnectionStatusAsync( |
| 1070 | + final SubscribeToIoTCoreConnectionStatusRequest request, |
| 1071 | + Consumer<IoTCoreConnectionStatusEvent> onStreamEvent, |
| 1072 | + Optional<Function<Throwable, Boolean>> onStreamError, Optional<Runnable> onStreamClosed) { |
| 1073 | + return this.subscribeToIoTCoreConnectionStatusAsync(request, getStreamingResponseHandler(onStreamEvent, onStreamError, onStreamClosed)); |
| 1074 | + } |
| 1075 | + |
| 1076 | + /** |
| 1077 | + * Perform the subscribeToIoTCoreConnectionStatus operation synchronously. |
| 1078 | + * The initial response or error will be returned synchronously, |
| 1079 | + * further events will arrive via the streaming callbacks. |
| 1080 | + * |
| 1081 | + * @throws InterruptedException if thread is interrupted while waiting for the response |
| 1082 | + * @return the response |
| 1083 | + * |
| 1084 | + * @param request request object |
| 1085 | + * @param onStreamEvent Callback for stream events. If an executor is provided, this method will run in the executor. |
| 1086 | + * @param onStreamError Callback for stream errors. Return true to close the stream, |
| 1087 | + * return false to keep the stream open. Even if an executor is provided, |
| 1088 | + * this method will not run in the executor. |
| 1089 | + * @param onStreamClosed Callback for when the stream closes. If an executor is provided, this method will run in the executor. |
| 1090 | + */ |
| 1091 | + public StreamingResponse<SubscribeToIoTCoreConnectionStatusResponse, SubscribeToIoTCoreConnectionStatusResponseHandler> subscribeToIoTCoreConnectionStatus( |
| 1092 | + final SubscribeToIoTCoreConnectionStatusRequest request, |
| 1093 | + Consumer<IoTCoreConnectionStatusEvent> onStreamEvent, |
| 1094 | + Optional<Function<Throwable, Boolean>> onStreamError, Optional<Runnable> onStreamClosed) |
| 1095 | + throws InterruptedException { |
| 1096 | + StreamingResponse<CompletableFuture<SubscribeToIoTCoreConnectionStatusResponse>, SubscribeToIoTCoreConnectionStatusResponseHandler> r = this.subscribeToIoTCoreConnectionStatusAsync(request, onStreamEvent, onStreamError, onStreamClosed); |
| 1097 | + return new StreamingResponse<>(getResponse(r.getResponse()), r.getHandler()); |
| 1098 | + } |
| 1099 | + |
| 1100 | + /** |
| 1101 | + * Perform the subscribeToIoTCoreConnectionStatus operation synchronously. |
| 1102 | + * The initial response or error will be returned synchronously, further events will |
| 1103 | + * arrive via the streaming callbacks. |
| 1104 | + * |
| 1105 | + * @throws InterruptedException if thread is interrupted while waiting for the response |
| 1106 | + * @return the response |
| 1107 | + * |
| 1108 | + * @param request request object |
| 1109 | + * @param streamResponseHandler Methods on this object will be called as stream events happen on this operation. |
| 1110 | + * If an executor is provided, the onStreamEvent and onStreamClosed methods will run in the executor. |
| 1111 | + */ |
| 1112 | + public StreamingResponse<SubscribeToIoTCoreConnectionStatusResponse, SubscribeToIoTCoreConnectionStatusResponseHandler> subscribeToIoTCoreConnectionStatus( |
| 1113 | + final SubscribeToIoTCoreConnectionStatusRequest request, |
| 1114 | + final StreamResponseHandler<IoTCoreConnectionStatusEvent> streamResponseHandler) throws |
| 1115 | + InterruptedException { |
| 1116 | + StreamingResponse<CompletableFuture<SubscribeToIoTCoreConnectionStatusResponse>, SubscribeToIoTCoreConnectionStatusResponseHandler> r = this.subscribeToIoTCoreConnectionStatusAsync(request, streamResponseHandler); |
| 1117 | + return new StreamingResponse<>(getResponse(r.getResponse()), r.getHandler()); |
| 1118 | + } |
| 1119 | + |
| 1120 | + /** |
| 1121 | + * Perform the subscribeToIoTCoreConnectionStatus operation asynchronously. |
| 1122 | + * The initial response or error will be returned as the result of the asynchronous future, further events will |
| 1123 | + * arrive via the streaming callbacks. |
| 1124 | + * |
| 1125 | + * @return a future which resolves to the response |
| 1126 | + * |
| 1127 | + * @param request request object |
| 1128 | + * @param streamResponseHandler Methods on this object will be called as stream events happen on this operation. |
| 1129 | + * If an executor is provided, the onStreamEvent and onStreamClosed methods will run in the executor. |
| 1130 | + */ |
| 1131 | + public StreamingResponse<CompletableFuture<SubscribeToIoTCoreConnectionStatusResponse>, SubscribeToIoTCoreConnectionStatusResponseHandler> subscribeToIoTCoreConnectionStatusAsync( |
| 1132 | + final SubscribeToIoTCoreConnectionStatusRequest request, |
| 1133 | + final StreamResponseHandler<IoTCoreConnectionStatusEvent> streamResponseHandler) { |
| 1134 | + SubscribeToIoTCoreConnectionStatusResponseHandler r = client.subscribeToIoTCoreConnectionStatus(request, Optional.ofNullable(getStreamingResponseHandler(streamResponseHandler))); |
| 1135 | + return new StreamingResponse<>(r.getResponse(), r); |
| 1136 | + } |
| 1137 | + |
1052 | 1138 | /** |
1053 | 1139 | * Perform the subscribeToTopic operation asynchronously. |
1054 | 1140 | * The initial response or error will be returned as the result of the asynchronous future, further events will |
|
0 commit comments