xref: /aosp_15_r20/external/aws-crt-java/src/native/java_class_ids.h (revision 3c7ae9de214676c52d19f01067dc1a404272dc11)
1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #ifndef AWS_JNI_CRT_JAVA_CLASS_IDS_H
7 #define AWS_JNI_CRT_JAVA_CLASS_IDS_H
8 
9 #include <jni.h>
10 
11 /* HttpRequestBodyStream */
12 struct java_http_request_body_stream_properties {
13     jmethodID send_outgoing_body;
14     jmethodID reset_position;
15     jmethodID get_length;
16 };
17 extern struct java_http_request_body_stream_properties http_request_body_stream_properties;
18 
19 /* AwsSigningConfig */
20 struct java_aws_signing_config_properties {
21     jclass aws_signing_config_class;
22     jfieldID algorithm_field_id;
23     jfieldID signature_type_field_id;
24     jfieldID region_field_id;
25     jfieldID service_field_id;
26     jfieldID time_field_id;
27     jfieldID credentials_field_id;
28     jfieldID credentials_provider_field_id;
29     jfieldID should_sign_header_field_id;
30     jfieldID use_double_uri_encode_field_id;
31     jfieldID should_normalize_uri_path_field_id;
32     jfieldID omit_session_token_field_id;
33     jfieldID signed_body_value_field_id;
34     jfieldID signed_body_header_field_id;
35     jfieldID expiration_in_seconds_field_id;
36 };
37 extern struct java_aws_signing_config_properties aws_signing_config_properties;
38 
39 /* Predicate<T> */
40 struct java_predicate_properties {
41     jclass predicate_class;
42     jmethodID test_method_id;
43 };
44 extern struct java_predicate_properties predicate_properties;
45 
46 /* java/lang/Long */
47 struct java_boxed_long_properties {
48     jclass long_class;
49     jmethodID constructor;
50     jmethodID long_value_method_id;
51 };
52 extern struct java_boxed_long_properties boxed_long_properties;
53 
54 /* HttpRequest */
55 struct java_http_request_properties {
56     jclass http_request_class;
57     jmethodID constructor_method_id;
58     jfieldID body_stream_field_id;
59 };
60 extern struct java_http_request_properties http_request_properties;
61 
62 /* CrtResource */
63 struct java_crt_resource_properties {
64     jmethodID get_native_handle_method_id;
65     jmethodID release_references;
66     jmethodID add_ref;
67     jmethodID close;
68 };
69 extern struct java_crt_resource_properties crt_resource_properties;
70 
71 /* MqttClientConnection */
72 struct java_mqtt_connection_properties {
73     jmethodID on_connection_complete;
74     jmethodID on_connection_interrupted;
75     jmethodID on_connection_resumed;
76     jmethodID on_connection_closed;
77     jmethodID on_websocket_handshake;
78     jmethodID on_connection_success;
79     jmethodID on_connection_failure;
80 };
81 extern struct java_mqtt_connection_properties mqtt_connection_properties;
82 
83 /* MqttClientConnection.MessageHandler */
84 struct java_message_handler_properties {
85     jmethodID deliver;
86 };
87 extern struct java_message_handler_properties message_handler_properties;
88 
89 /* MqttClientConnection.MqttClientOperationStatistics */
90 struct java_mqtt_connection_operation_statistics_properties {
91     jclass statistics_class;
92     jmethodID statistics_constructor_id;
93     jfieldID incomplete_operation_count_field_id;
94     jfieldID incomplete_operation_size_field_id;
95     jfieldID unacked_operation_count_field_id;
96     jfieldID unacked_operation_size_field_id;
97 };
98 extern struct java_mqtt_connection_operation_statistics_properties mqtt_connection_operation_statistics_properties;
99 
100 /* MqttException */
101 struct java_mqtt_exception_properties {
102     jclass jni_mqtt_exception;
103     jmethodID jni_constructor;
104 };
105 extern struct java_mqtt_exception_properties mqtt_exception_properties;
106 
107 /* ByteBuffer */
108 struct java_byte_buffer_properties {
109     jclass cls;
110     jmethodID get_capacity; /* The total number of bytes in the internal byte array. Stays constant. */
111     jmethodID get_limit;    /* The max allowed read/write position of the Buffer. limit must be <= capacity. */
112     jmethodID set_limit;
113     jmethodID get_position; /* The current read/write position of the Buffer. position must be <= limit */
114     jmethodID set_position;
115     jmethodID get_remaining; /* Remaining number of bytes before the limit is reached. Equal to (limit - position). */
116     jmethodID wrap;          /* Creates a new ByteBuffer Object from a Java byte[]. */
117 };
118 extern struct java_byte_buffer_properties byte_buffer_properties;
119 
120 /* CredentialsProvider */
121 struct java_credentials_provider_properties {
122     jmethodID on_shutdown_complete_method_id;
123     jmethodID on_get_credentials_complete_method_id;
124 };
125 extern struct java_credentials_provider_properties credentials_provider_properties;
126 
127 /* Credentials */
128 struct java_credentials_properties {
129     jclass credentials_class;
130     jmethodID constructor_method_id;
131     jfieldID access_key_id_field_id;
132     jfieldID secret_access_key_field_id;
133     jfieldID session_token_field_id;
134     jfieldID expiration_field_id;
135 };
136 extern struct java_credentials_properties credentials_properties;
137 
138 /* DelegateCredentialsHandler */
139 struct java_credentials_handler_properties {
140     jmethodID on_handler_get_credentials_method_id;
141 };
142 extern struct java_credentials_handler_properties credentials_handler_properties;
143 
144 /* AsyncCallback */
145 struct java_async_callback_properties {
146     jmethodID on_success_with_object;
147     jmethodID on_success;
148     jmethodID on_failure;
149 };
150 extern struct java_async_callback_properties async_callback_properties;
151 
152 /* EventLoopGroup */
153 struct java_event_loop_group_properties {
154     jmethodID onCleanupComplete;
155 };
156 extern struct java_event_loop_group_properties event_loop_group_properties;
157 
158 /* ClientBootstrap */
159 struct java_client_bootstrap_properties {
160     jmethodID onShutdownComplete;
161 };
162 extern struct java_client_bootstrap_properties client_bootstrap_properties;
163 
164 /* TlsContextPkcs11Options */
165 struct java_tls_context_pkcs11_options_properties {
166     jfieldID pkcs11Lib;
167     jfieldID userPin;
168     jfieldID slotId;
169     jfieldID tokenLabel;
170     jfieldID privateKeyObjectLabel;
171     jfieldID certificateFilePath;
172     jfieldID certificateFileContents;
173 };
174 extern struct java_tls_context_pkcs11_options_properties tls_context_pkcs11_options_properties;
175 
176 /* TlsContextCustomKeyOperationOptions */
177 struct java_tls_context_custom_key_operation_options_properties {
178     jfieldID operation_handler_field_id;
179     jfieldID certificate_file_path_field_id;
180     jfieldID certificate_file_contents_field_id;
181 };
182 extern struct java_tls_context_custom_key_operation_options_properties
183     tls_context_custom_key_operation_options_properties;
184 
185 /* TlsKeyOperationHandler */
186 struct java_tls_key_operation_handler_properties {
187     jmethodID perform_operation_id;
188 };
189 extern struct java_tls_key_operation_handler_properties tls_key_operation_handler_properties;
190 
191 /* TlsKeyOperation */
192 struct java_tls_key_operation_properties {
193     jclass cls;
194     jmethodID constructor;
195     jmethodID invoke_operation_id;
196 };
197 extern struct java_tls_key_operation_properties tls_key_operation_properties;
198 
199 /* HttpClientConnectionManager */
200 struct java_http_client_connection_manager_properties {
201     jmethodID onShutdownComplete;
202 };
203 extern struct java_http_client_connection_manager_properties http_client_connection_manager_properties;
204 
205 /* Http2StreamManager */
206 struct java_http2_stream_manager_properties {
207     jmethodID onShutdownComplete;
208 };
209 extern struct java_http2_stream_manager_properties http2_stream_manager_properties;
210 
211 /* HttpClientConnection */
212 struct java_http_client_connection_properties {
213     jclass http_client_connection_class;
214     jmethodID on_connection_acquired_method_id;
215 };
216 extern struct java_http_client_connection_properties http_client_connection_properties;
217 
218 /* HttpStream */
219 struct java_http_stream_properties {
220     jclass stream_class;
221     jmethodID constructor;
222     jmethodID close;
223 };
224 extern struct java_http_stream_properties http_stream_properties;
225 
226 /* Http2Stream */
227 struct java_http2_stream_properties {
228     jclass stream_class;
229     jmethodID constructor;
230 };
231 extern struct java_http2_stream_properties http2_stream_properties;
232 
233 /* HttpStreamResponseHandler */
234 struct java_http_stream_response_handler_native_adapter_properties {
235     jmethodID onResponseHeaders;
236     jmethodID onResponseHeadersDone;
237     jmethodID onResponseBody;
238     jmethodID onResponseComplete;
239     jmethodID onMetrics;
240 };
241 extern struct java_http_stream_response_handler_native_adapter_properties http_stream_response_handler_properties;
242 
243 /* HttpStreamWriteChunkCompletionCallback */
244 struct java_http_stream_write_chunk_completion_properties {
245     jmethodID callback;
246 };
247 extern struct java_http_stream_write_chunk_completion_properties http_stream_write_chunk_completion_properties;
248 
249 /* HtppStreamMetrics */
250 struct java_http_stream_metrics_properties {
251     jclass http_stream_metrics_class;
252     jmethodID constructor_id;
253 };
254 extern struct java_http_stream_metrics_properties http_stream_metrics_properties;
255 
256 /* EventStreamServerListener */
257 struct java_event_stream_server_listener_properties {
258     jmethodID onShutdownComplete;
259 };
260 extern struct java_event_stream_server_listener_properties event_stream_server_listener_properties;
261 
262 /* EventStreamServerListenerHandler */
263 struct java_event_stream_server_listener_handler_properties {
264     jmethodID onNewConnection;
265     jmethodID onConnectionShutdown;
266     jmethodID newConnConstructor;
267     jclass connCls;
268 };
269 extern struct java_event_stream_server_listener_handler_properties event_stream_server_listener_handler_properties;
270 
271 struct java_event_stream_server_connection_handler_properties {
272     jmethodID onProtocolMessage;
273     jmethodID onIncomingStream;
274     jmethodID newContinuationConstructor;
275     jclass continuationCls;
276 };
277 extern struct java_event_stream_server_connection_handler_properties event_stream_server_connection_handler_properties;
278 
279 struct java_event_stream_server_continuation_handler_properties {
280     jmethodID onContinuationMessage;
281     jmethodID onContinuationClosed;
282 };
283 extern struct java_event_stream_server_continuation_handler_properties
284     event_stream_server_continuation_handler_properties;
285 
286 struct java_event_stream_client_connection_handler_properties {
287     jmethodID onSetup;
288     jmethodID onProtocolMessage;
289     jmethodID onClosed;
290 };
291 extern struct java_event_stream_client_connection_handler_properties event_stream_client_connection_handler_properties;
292 
293 struct java_event_stream_client_continuation_handler_properties {
294     jmethodID onContinuationMessage;
295     jmethodID onContinuationClosed;
296 };
297 extern struct java_event_stream_client_continuation_handler_properties
298     event_stream_client_continuation_handler_properties;
299 
300 struct java_event_stream_message_flush_properties {
301     jmethodID callback;
302 };
303 extern struct java_event_stream_message_flush_properties event_stream_server_message_flush_properties;
304 
305 struct java_cpu_info_properties {
306     jclass cpu_info_class;
307     jmethodID cpu_info_constructor;
308 };
309 extern struct java_cpu_info_properties cpu_info_properties;
310 
311 struct java_s3_client_properties {
312     jmethodID onShutdownComplete;
313 };
314 extern struct java_s3_client_properties s3_client_properties;
315 
316 /* S3Client */
317 struct java_s3_meta_request_properties {
318     jmethodID onShutdownComplete;
319 };
320 extern struct java_s3_meta_request_properties s3_meta_request_properties;
321 
322 /* S3MetaRequestResponseHandlerNativeAdapter */
323 struct java_s3_meta_request_response_handler_native_adapter_properties {
324     jmethodID onResponseBody;
325     jmethodID onFinished;
326     jmethodID onResponseHeaders;
327     jmethodID onProgress;
328 };
329 extern struct java_s3_meta_request_response_handler_native_adapter_properties
330     s3_meta_request_response_handler_native_adapter_properties;
331 
332 /* CompletableFuture */
333 struct java_completable_future_properties {
334     jmethodID complete_method_id;
335     jmethodID complete_exceptionally_method_id;
336 };
337 
338 extern struct java_completable_future_properties completable_future_properties;
339 
340 /* CrtRuntimeException */
341 struct java_crt_runtime_exception_properties {
342     jclass crt_runtime_exception_class;
343     jmethodID constructor_method_id;
344     jfieldID error_code_field_id;
345 };
346 extern struct java_crt_runtime_exception_properties crt_runtime_exception_properties;
347 
348 /* EccKeyPair */
349 struct java_ecc_key_pair_properties {
350     jclass ecc_key_pair_class;
351     jmethodID constructor;
352 };
353 extern struct java_ecc_key_pair_properties ecc_key_pair_properties;
354 
355 /* CRT */
356 struct java_crt_properties {
357     jclass crt_class;
358     jmethodID test_jni_exception_method_id;
359 };
360 extern struct java_crt_properties crt_properties;
361 
362 /* AwsSigningResult */
363 struct java_aws_signing_result_properties {
364     jclass aws_signing_result_class;
365     jmethodID constructor;
366     jfieldID signed_request_field_id;
367     jfieldID signature_field_id;
368 };
369 extern struct java_aws_signing_result_properties aws_signing_result_properties;
370 
371 /* HttpHeader */
372 struct java_http_header_properties {
373     jclass http_header_class;
374     jmethodID constructor_method_id; /* (byte[], byte[]) */
375 };
376 extern struct java_http_header_properties http_header_properties;
377 
378 /* HtppConnectionManagerMetrics */
379 struct java_http_manager_metrics_properties {
380     jclass http_manager_metrics_class;
381     jmethodID constructor_method_id;
382 };
383 extern struct java_http_manager_metrics_properties http_manager_metrics_properties;
384 
385 /* ExponentialBackoffRetryOptions */
386 struct java_aws_exponential_backoff_retry_options_properties {
387     jclass exponential_backoff_retry_options_class;
388     jmethodID exponential_backoff_retry_options_constructor_method_id;
389     jfieldID el_group_field_id;
390     jfieldID max_retries_field_id;
391     jfieldID backoff_scale_factor_ms_field_id;
392     jfieldID jitter_mode_field_id;
393 
394     jclass jitter_mode_class;
395     jfieldID jitter_mode_value_field_id;
396 };
397 extern struct java_aws_exponential_backoff_retry_options_properties exponential_backoff_retry_options_properties;
398 
399 /* StandardRetryOptions */
400 struct java_aws_standard_retry_options_properties {
401     jclass standard_retry_options_class;
402     jmethodID standard_retry_options_constructor_method_id;
403     jfieldID backoff_retry_options_field_id;
404     jfieldID initial_bucket_capacity_field_id;
405 };
406 extern struct java_aws_standard_retry_options_properties standard_retry_options_properties;
407 
408 /* DirectoryTraversalHandler */
409 struct java_aws_directory_traversal_handler_properties {
410     jclass directory_traversal_handler_class;
411     jmethodID on_directory_entry_method_id;
412 };
413 extern struct java_aws_directory_traversal_handler_properties directory_traversal_handler_properties;
414 
415 /* DirectoryEntry */
416 struct java_aws_directory_entry_properties {
417     jclass directory_entry_class;
418     jmethodID directory_entry_constructor_method_id;
419     jfieldID path_field_id;
420     jfieldID relative_path_field_id;
421     jfieldID is_directory_field_id;
422     jfieldID is_symlink_field_id;
423     jfieldID is_file_field_id;
424     jfieldID file_size_field_id;
425 };
426 extern struct java_aws_directory_entry_properties directory_entry_properties;
427 
428 /* S3MetaRequestProgress */
429 struct java_aws_s3_meta_request_progress {
430     jclass s3_meta_request_progress_class;
431     jmethodID s3_meta_request_progress_constructor_method_id;
432     jfieldID bytes_transferred_field_id;
433     jfieldID content_length_field_id;
434 };
435 extern struct java_aws_s3_meta_request_progress s3_meta_request_progress_properties;
436 
437 /* S3TcpKeepAliveOptions */
438 struct java_aws_s3_tcp_keep_alive_options_properties {
439     jclass s3_tcp_keep_alive_options_class;
440     jmethodID s3_tcp_keep_alive_options_constructor_method_id;
441     jfieldID keep_alive_interval_sec_field_id;
442     jfieldID keep_alive_timeout_sec_field_id;
443     jfieldID keep_alive_max_failed_probes_field_id;
444 };
445 extern struct java_aws_s3_tcp_keep_alive_options_properties s3_tcp_keep_alive_options_properties;
446 
447 /* ResumeToken */
448 struct java_aws_s3_meta_request_resume_token {
449     jclass s3_meta_request_resume_token_class;
450     jmethodID s3_meta_request_resume_token_constructor_method_id;
451     jfieldID native_type_field_id;
452     jfieldID part_size_field_id;
453     jfieldID total_num_parts_field_id;
454     jfieldID num_parts_completed_field_id;
455     jfieldID upload_id_field_id;
456 };
457 extern struct java_aws_s3_meta_request_resume_token s3_meta_request_resume_token_properties;
458 
459 /* mqtt5.packets.ConnAckPacket */
460 struct java_aws_mqtt5_connack_packet_properties {
461     jclass connack_packet_class;
462 
463     jmethodID connack_constructor_id;
464     jmethodID connack_native_add_maximum_qos_id;
465     jmethodID connack_native_add_reason_code_id;
466 
467     jfieldID connack_session_present_field_id;
468     jfieldID connack_reason_code_field_id;
469     jfieldID connack_session_expiry_interval_field_id;
470     jfieldID connack_receive_maximum_field_id;
471     jfieldID connack_maximum_qos_field_id;
472     jfieldID connack_retain_available_field_id;
473     jfieldID connack_maximum_packet_size_field_id;
474     jfieldID connack_assigned_client_identifier_field_id;
475     jfieldID connack_topic_alias_maximum_field_id;
476     jfieldID connack_reason_string_field_id;
477     jfieldID connack_wildcard_subscriptions_available_field_id;
478     jfieldID connack_subscription_identifiers_available_field_id;
479     jfieldID connack_shared_subscriptions_available_field_id;
480     jfieldID connack_server_keep_alive_field_id;
481     jfieldID connack_response_information_field_id;
482     jfieldID connack_server_reference_field_id;
483     jfieldID connack_user_properties_field_id;
484 };
485 extern struct java_aws_mqtt5_connack_packet_properties mqtt5_connack_packet_properties;
486 
487 /* mqtt5.packets.ConnAckPacket.ConnectReasonCode */
488 struct java_aws_mqtt5_connect_reason_code_properties {
489     jclass reason_code_class;
490     jmethodID code_get_value_id;
491     jmethodID code_s_get_enum_value_from_integer_id;
492 };
493 extern struct java_aws_mqtt5_connect_reason_code_properties mqtt5_connect_reason_code_properties;
494 
495 /* mqtt5.packets.PacketConnnect */
496 struct java_aws_mqtt5_connect_packet_properties {
497     jclass connect_packet_class;
498 
499     jfieldID connect_keep_alive_interval_seconds_field_id;
500     jfieldID connect_client_id_field_id;
501     jfieldID connect_username_field_id;
502     jfieldID connect_password_field_id;
503     jfieldID connect_session_expiry_interval_seconds_field_id;
504     jfieldID connect_request_response_information_field_id;
505     jfieldID connect_request_problem_information_field_id;
506     jfieldID connect_receive_maximum_field_id;
507     jfieldID connect_maximum_packet_size_bytes_field_id;
508     jfieldID connect_will_delay_interval_seconds_field_id;
509     jfieldID connect_will_field_id;
510     jfieldID connect_user_properties_field_id;
511 };
512 extern struct java_aws_mqtt5_connect_packet_properties mqtt5_connect_packet_properties;
513 
514 /* mqtt5.packets.PacketDisconnnect */
515 struct java_aws_mqtt5_disconnect_packet_properties {
516     jclass disconnect_packet_class;
517 
518     jmethodID disconnect_constructor_id;
519     jmethodID disconnect_native_add_disconnect_reason_code_id;
520     jmethodID disconnect_get_reason_code_id;
521 
522     jfieldID disconnect_reason_code_field_id;
523     jfieldID disconnect_session_expiry_interval_seconds_field_id;
524     jfieldID disconnect_reason_string_field_id;
525     jfieldID disconnect_session_server_reference_field_id;
526     jfieldID disconnect_user_properties_field_id;
527 };
528 extern struct java_aws_mqtt5_disconnect_packet_properties mqtt5_disconnect_packet_properties;
529 
530 /* mqtt5.packets.PacketDisconnnect.DisconnectReasonCode */
531 struct java_aws_mqtt5_disconnect_reason_code_properties {
532     jclass reason_code_class;
533     jmethodID code_get_value_id;
534     jmethodID code_s_get_enum_value_from_integer_id;
535 };
536 extern struct java_aws_mqtt5_disconnect_reason_code_properties mqtt5_disconnect_reason_code_properties;
537 
538 /* mqtt5.packets.PubAckPacket */
539 struct java_aws_mqtt5_puback_packet_properties {
540     jclass puback_packet_class;
541     jmethodID puback_constructor_id;
542     jmethodID puback_native_add_reason_code_id;
543 
544     jfieldID puback_reason_code_field_id;
545     jfieldID puback_reason_string_field_id;
546     jfieldID puback_user_properties_field_id;
547 };
548 extern struct java_aws_mqtt5_puback_packet_properties mqtt5_puback_packet_properties;
549 
550 /* mqtt5.packets.PubAckPacket.PubAckReasonCode */
551 struct java_aws_mqtt5_puback_reason_code_properties {
552     jclass reason_code_class;
553     jmethodID code_get_value_id;
554     jmethodID code_s_get_enum_value_from_integer_id;
555 };
556 extern struct java_aws_mqtt5_puback_reason_code_properties mqtt5_puback_reason_code_properties;
557 
558 /* mqtt5.packets.PublishPacket */
559 struct java_aws_mqtt5_publish_packet_properties {
560     jclass publish_packet_class;
561 
562     jmethodID publish_constructor_id;
563     jmethodID publish_native_set_qos_id;
564     jmethodID publish_native_set_payload_format_indicator_id;
565     jmethodID publish_get_qos_id;
566     jmethodID publish_get_payload_format_id;
567 
568     jfieldID publish_payload_field_id;
569     jfieldID publish_qos_field_id;
570     jfieldID publish_retain_field_id;
571     jfieldID publish_topic_field_id;
572     jfieldID publish_payload_format_field_id;
573     jfieldID publish_message_expiry_interval_seconds_field_id;
574     jfieldID publish_topic_alias_field_id;
575     jfieldID publish_response_topic_field_id;
576     jfieldID publish_correlation_data_field_id;
577     jfieldID publish_content_type_field_id;
578     jfieldID publish_subscription_identifiers_field_id;
579     jfieldID publish_user_properties_field_id;
580 };
581 extern struct java_aws_mqtt5_publish_packet_properties mqtt5_publish_packet_properties;
582 
583 /* mqtt5.packets.PublishPacket.PayloadFormatIndicator */
584 struct java_aws_mqtt5_payload_format_indicator_properties {
585     jclass payload_format_class;
586     jmethodID format_get_value_id;
587     jmethodID format_s_get_enum_value_from_integer_id;
588 };
589 extern struct java_aws_mqtt5_payload_format_indicator_properties mqtt5_payload_format_indicator_properties;
590 
591 /* mqtt5.NegotiatedSettings */
592 struct java_aws_mqtt5_negotiated_settings_properties {
593     jclass negotiated_settings_class;
594 
595     jmethodID negotiated_settings_constructor_id;
596     jmethodID negotiated_settings_native_set_qos_id;
597 
598     jfieldID negotiated_settings_maximum_qos_field_id;
599     jfieldID negotiated_settings_session_expiry_interval_field_id;
600     jfieldID negotiated_settings_receive_maximum_from_server_field_id;
601     jfieldID negotiated_settings_maximum_packet_size_to_server_field_id;
602     jfieldID negotiated_settings_topic_alias_maximum_to_server_field_id;
603     jfieldID negotiated_settings_topic_alias_maximum_to_client_field_id;
604     jfieldID negotiated_settings_server_keep_alive_field_id;
605     jfieldID negotiated_settings_retain_available_field_id;
606     jfieldID negotiated_settings_wildcard_subscriptions_available_field_id;
607     jfieldID negotiated_settings_subscription_identifiers_available_field_id;
608     jfieldID negotiated_settings_shared_subscriptions_available_field_id;
609     jfieldID negotiated_settings_rejoined_session_field_id;
610     jfieldID negotiated_settings_assigned_client_id_field_id;
611 };
612 extern struct java_aws_mqtt5_negotiated_settings_properties mqtt5_negotiated_settings_properties;
613 
614 /* http.HttpProxyOptions */
615 struct java_aws_http_proxy_options_properties {
616     jclass http_proxy_options_class;
617 
618     jmethodID proxy_get_connection_type_id;
619     jmethodID proxy_get_proxy_host_id;
620     jmethodID proxy_get_proxy_port_id;
621     jmethodID proxy_get_proxy_tls_context_id;
622     jmethodID proxy_get_proxy_authorization_type_id;
623     jmethodID proxy_get_authorization_username_id;
624     jmethodID proxy_get_authorization_password_id;
625 };
626 extern struct java_aws_http_proxy_options_properties http_proxy_options_properties;
627 
628 /* http.HttpProxyOptions.HttpProxyConnectionType */
629 struct java_aws_http_proxy_connection_type_properties {
630     jclass http_proxy_connection_type_class;
631     jmethodID proxy_get_value_id;
632 };
633 extern struct java_aws_http_proxy_connection_type_properties http_proxy_connection_type_properties;
634 
635 /* mqtt5.ClientOptions */
636 struct java_aws_mqtt5_client_options_properties {
637     jclass client_options_class;
638 
639     // Functions for CRT resource references so we can
640     // better control them when they are not present
641     jmethodID options_get_bootstrap_id;
642     jmethodID options_get_socket_options_id;
643     jmethodID options_get_tls_options_id;
644     jmethodID options_get_session_behavior_id;
645     jmethodID options_get_extended_validation_and_flow_control_options_id;
646     jmethodID options_get_offline_queue_behavior_id;
647     jmethodID options_get_retry_jitter_mode_id;
648 
649     jfieldID options_host_name_field_id;
650     jfieldID options_port_field_id;
651     jfieldID http_proxy_options_field_id;
652     // We skip connect options since that is passed in directly
653     // since it can be made outside of the builder
654     jfieldID session_behavior_field_id;
655     jfieldID extended_validation_and_flow_control_options_field_id;
656     jfieldID offline_queue_behavior_field_id;
657     jfieldID retry_jitter_mode_field_id;
658     jfieldID min_reconnect_delay_ms_field_id;
659     jfieldID max_reconnect_delay_ms_field_id;
660     jfieldID min_connected_time_to_reset_reconnect_delay_ms_field_id;
661     jfieldID ping_timeout_ms_field_id;
662     jfieldID connack_timeout_ms_field_id;
663     jfieldID ack_timeout_seconds_field_id;
664     jfieldID publish_events_field_id;
665     jfieldID lifecycle_events_field_id;
666     jfieldID topic_aliasing_options_field_id;
667 };
668 extern struct java_aws_mqtt5_client_options_properties mqtt5_client_options_properties;
669 
670 /* mqtt5.Client */
671 struct java_aws_mqtt5_client_properties {
672     jclass client_class;
673     jmethodID client_on_websocket_handshake_id;
674     jmethodID client_set_is_connected;
675     jfieldID websocket_handshake_field_id;
676 };
677 extern struct java_aws_mqtt5_client_properties mqtt5_client_properties;
678 
679 /* mqtt5.Mqtt5ClientOperationStatistics */
680 struct java_aws_mqtt5_client_operation_statistics_properties {
681     jclass statistics_class;
682     jmethodID statistics_constructor_id;
683     jfieldID incomplete_operation_count_field_id;
684     jfieldID incomplete_operation_size_field_id;
685     jfieldID unacked_operation_count_field_id;
686     jfieldID unacked_operation_size_field_id;
687 };
688 extern struct java_aws_mqtt5_client_operation_statistics_properties mqtt5_client_operation_statistics_properties;
689 
690 /* mqtt5.ClientOptions.ClientSessionBehavior */
691 struct java_aws_mqtt5_client_session_behavior_type_properties {
692     jclass mqtt5_client_session_behavior_class;
693     jmethodID client_get_value_id;
694 };
695 extern struct java_aws_mqtt5_client_session_behavior_type_properties mqtt5_client_session_behavior_properties;
696 
697 /* mqtt5.ClientOptions.ExtendedValidationAndFlowControlOptions */
698 struct java_aws_mqtt5_client_extended_validation_and_flow_control_options {
699     jclass mqtt5_client_extended_validation_and_flow_control_options_class;
700     jmethodID client_get_value_id;
701 };
702 extern struct java_aws_mqtt5_client_extended_validation_and_flow_control_options
703     mqtt5_client_extended_validation_and_flow_control_options;
704 
705 /* mqtt5.ClientOptions.ClientOfflineQueueBehavior */
706 struct java_aws_mqtt5_client_offline_queue_behavior_type_properties {
707     jclass mqtt5_client_offline_queue_behavior_type_class;
708     jmethodID client_get_value_id;
709 };
710 extern struct java_aws_mqtt5_client_offline_queue_behavior_type_properties
711     mqtt5_client_offline_queue_behavior_type_properties;
712 
713 /* mqtt5.ClientOptions.JitterMode */
714 struct java_aws_mqtt5_client_jitter_mode_properties {
715     jclass mqtt5_client_jitter_mode_class;
716     jmethodID client_get_value_id;
717 };
718 extern struct java_aws_mqtt5_client_jitter_mode_properties mqtt5_client_jitter_mode_properties;
719 
720 /* mqtt5.Mqtt5ClientOptions.OutboundTopicAliasBehaviorType */
721 struct java_aws_mqtt5_outbound_topic_alias_behavior_type_properties {
722     jclass mqtt5_outbound_topic_alias_behavior_type_class;
723     jmethodID get_value_method_id;
724 };
725 extern struct java_aws_mqtt5_outbound_topic_alias_behavior_type_properties
726     mqtt5_outbound_topic_alias_behavior_type_properties;
727 
728 /* mqtt5.Mqtt5ClientOptions.InboundTopicAliasBehaviorType */
729 struct java_aws_mqtt5_inbound_topic_alias_behavior_type_properties {
730     jclass mqtt5_inbound_topic_alias_behavior_type_class;
731     jmethodID get_value_method_id;
732 };
733 extern struct java_aws_mqtt5_inbound_topic_alias_behavior_type_properties
734     mqtt5_inbound_topic_alias_behavior_type_properties;
735 
736 /* mqtt5.Mqtt5ClientOptions.TopicAliasingOptions */
737 struct java_aws_mqtt5_topic_aliasing_options_properties {
738     jclass mqtt5_topic_aliasing_options_class;
739 
740     jfieldID outbound_behavior_field_id;
741     jfieldID outbound_cache_max_size_field_id;
742     jfieldID inbound_behavior_field_id;
743     jfieldID inbound_cache_max_size_field_id;
744 };
745 extern struct java_aws_mqtt5_topic_aliasing_options_properties mqtt5_topic_aliasing_options_properties;
746 
747 /* mqtt5.packets.SubscribePacket */
748 struct java_aws_mqtt5_subscribe_packet_properties {
749     jclass subscribe_packet_class;
750     jfieldID subscribe_subscriptions_field_id;
751     jfieldID subscribe_subscription_identifier_field_id;
752     jfieldID subscribe_user_properties_field_id;
753 };
754 extern struct java_aws_mqtt5_subscribe_packet_properties mqtt5_subscribe_packet_properties;
755 
756 /* mqtt5.packets.SubscribePacket.Subscription */
757 struct java_aws_mqtt5_subscription_properties {
758     jclass subscribe_subscription_class;
759     jfieldID subscribe_no_local_field_id;
760     jfieldID subscribe_retain_as_published_field_id;
761 
762     jmethodID subscribe_get_topic_filter_id;
763     jmethodID subscribe_get_qos_id;
764     jmethodID subscribe_get_no_local_id;
765     jmethodID subscribe_get_retain_as_published_id;
766     jmethodID subscribe_get_retain_handling_type_id;
767 };
768 extern struct java_aws_mqtt5_subscription_properties mqtt5_subscription_properties;
769 
770 /* mqtt5.QOS */
771 struct java_aws_mqtt5_packet_qos_properties {
772     jclass packet_qos_class;
773     jmethodID qos_get_value_id;
774     jmethodID qos_s_get_enum_value_from_integer_id;
775 };
776 extern struct java_aws_mqtt5_packet_qos_properties mqtt5_packet_qos_properties;
777 
778 /* mqtt5.packets.SubscribePacket.RetainHandlingType */
779 struct java_aws_mqtt5_retain_handling_type_properties {
780     jclass retain_handling_type_class;
781     jmethodID retain_get_value_id;
782 };
783 extern struct java_aws_mqtt5_retain_handling_type_properties mqtt5_retain_handling_type_properties;
784 
785 /* mqtt5.packets.SubAckPacket.SubAckReasonCode */
786 struct java_aws_mqtt5_suback_reason_code_properties {
787     jclass reason_code_class;
788     jmethodID reason_get_value_id;
789     jmethodID reason_s_get_enum_value_from_integer_id;
790 };
791 extern struct java_aws_mqtt5_suback_reason_code_properties mqtt5_suback_reason_code_properties;
792 
793 /* mqtt5.packets.SubAckPacket */
794 struct java_aws_mqtt5_packet_suback_properties {
795     jclass suback_packet_class;
796     jmethodID suback_constructor_id;
797     jmethodID suback_native_add_suback_code_id;
798 
799     jfieldID suback_reason_string_field_id;
800     jfieldID suback_reason_codes_field_id;
801     jfieldID suback_user_properties_field_id;
802 };
803 extern struct java_aws_mqtt5_packet_suback_properties mqtt5_suback_packet_properties;
804 
805 /* mqtt5.packets.UnsubscribePacket */
806 struct java_aws_mqtt5_packet_unsubscribe_properties {
807     jclass unsubscribe_packet_class;
808     jfieldID unsubscribe_subscriptions_field_id;
809     jfieldID unsubscribe_user_properties_field_id;
810 };
811 extern struct java_aws_mqtt5_packet_unsubscribe_properties mqtt5_unsubscribe_packet_properties;
812 
813 /* mqtt5.packets.UnsubAckPacket */
814 struct java_aws_mqtt5_packet_unsuback_properties {
815     jclass unsuback_packet_class;
816     jmethodID unsuback_constructor_id;
817     jmethodID unsuback_native_add_unsuback_code_id;
818 
819     jfieldID unsuback_reason_string_field_id;
820     jfieldID unsuback_reason_codes_field_id;
821     jfieldID unsuback_user_properties_field_id;
822 };
823 extern struct java_aws_mqtt5_packet_unsuback_properties mqtt5_unsuback_packet_properties;
824 
825 /* mqtt5.packets.UnsubAckPacket.UnsubAckReasonCode */
826 struct java_aws_mqtt5_unsuback_reason_code_properties {
827     jclass reason_code_class;
828     jmethodID reason_get_value_id;
829     jmethodID reason_s_get_enum_value_from_integer_id;
830 };
831 extern struct java_aws_mqtt5_unsuback_reason_code_properties mqtt5_unsuback_reason_code_properties;
832 
833 /* mqtt5.packets.UserProperty */
834 struct java_aws_mqtt5_user_property_properties {
835     jclass user_property_class;
836     jmethodID property_constructor_id;
837     jfieldID property_key_id;
838     jfieldID property_value_id;
839 };
840 extern struct java_aws_mqtt5_user_property_properties mqtt5_user_property_properties;
841 
842 /* mqtt5.Mqtt5ClientOptions.PublishEvents */
843 struct java_aws_mqtt5_publish_events {
844     jclass publish_events_class;
845     jmethodID publish_events_publish_received_id;
846 };
847 extern struct java_aws_mqtt5_publish_events mqtt5_publish_events_properties;
848 
849 /* mqtt5.Mqtt5ClientOptions.LifecycleEvents */
850 struct java_aws_mqtt5_lifecycle_events {
851     jclass lifecycle_events_class;
852     jmethodID lifecycle_attempting_connect_id;
853     jmethodID lifecycle_connection_success_id;
854     jmethodID lifecycle_connection_failure_id;
855     jmethodID lifecycle_disconnection_id;
856     jmethodID lifecycle_stopped_id;
857 };
858 extern struct java_aws_mqtt5_lifecycle_events mqtt5_lifecycle_events_properties;
859 
860 /* mqtt5.PublishResult */
861 struct java_aws_mqtt5_publish_result_properties {
862     jclass result_class;
863     jmethodID result_constructor_id;
864     jmethodID result_puback_constructor_id;
865 };
866 extern struct java_aws_mqtt5_publish_result_properties mqtt5_publish_result_properties;
867 
868 /* mqtt5.PublishReturn */
869 struct java_aws_mqtt5_publish_return_properties {
870     jclass return_class;
871     jmethodID return_constructor_id;
872 };
873 extern struct java_aws_mqtt5_publish_return_properties mqtt5_publish_return_properties;
874 
875 /* mqtt5.OnStoppedReturn */
876 struct java_aws_mqtt5_on_stopped_return_properties {
877     jclass return_class;
878     jmethodID return_constructor_id;
879 };
880 extern struct java_aws_mqtt5_on_stopped_return_properties mqtt5_on_stopped_return_properties;
881 
882 /* mqtt5.OnAttemptingConnectReturn */
883 struct java_aws_mqtt5_on_attempting_connect_return_properties {
884     jclass return_class;
885     jmethodID return_constructor_id;
886 };
887 extern struct java_aws_mqtt5_on_attempting_connect_return_properties mqtt5_on_attempting_connect_return_properties;
888 
889 /* mqtt5.OnConnectionSuccessReturn */
890 struct java_aws_mqtt5_on_connection_success_return_properties {
891     jclass return_class;
892     jmethodID return_constructor_id;
893 };
894 extern struct java_aws_mqtt5_on_connection_success_return_properties mqtt5_on_connection_success_return_properties;
895 
896 /* mqtt5.OnConnectionFailureReturn */
897 struct java_aws_mqtt5_on_connection_failure_return_properties {
898     jclass return_class;
899     jmethodID return_constructor_id;
900 };
901 extern struct java_aws_mqtt5_on_connection_failure_return_properties mqtt5_on_connection_failure_return_properties;
902 
903 /* mqtt5.OnDisconnectionReturn */
904 struct java_aws_mqtt5_on_disconnection_return_properties {
905     jclass return_class;
906     jmethodID return_constructor_id;
907 };
908 extern struct java_aws_mqtt5_on_disconnection_return_properties mqtt5_on_disconnection_return_properties;
909 
910 /* java/lang/Integer */
911 struct java_boxed_integer_properties {
912     jclass integer_class;
913     jmethodID integer_constructor_id;
914     jmethodID integer_get_value_id;
915 };
916 extern struct java_boxed_integer_properties boxed_integer_properties;
917 
918 /* java/lang/Boolean */
919 struct java_boxed_boolean_properties {
920     jclass boolean_class;
921     jmethodID boolean_constructor_id;
922     jmethodID boolean_get_value_id;
923 };
924 extern struct java_boxed_boolean_properties boxed_boolean_properties;
925 
926 /* java/util/List */
927 struct java_boxed_list_properties {
928     jclass list_class;
929     jmethodID list_size_id;
930     jmethodID list_get_id;
931     jmethodID list_add_id;
932 };
933 extern struct java_boxed_list_properties boxed_list_properties;
934 
935 /* java/util/ArrayList */
936 struct java_boxed_array_list_properties {
937     jclass list_class;
938     jmethodID list_constructor_id;
939 };
940 extern struct java_boxed_array_list_properties boxed_array_list_properties;
941 
942 /* S3ExpressCredentialsProviderFactory */
943 struct java_s3express_credentials_provider_factory_properties {
944     jmethodID createS3ExpressCredentialsProvider;
945 };
946 extern struct java_s3express_credentials_provider_factory_properties s3express_credentials_provider_factory_properties;
947 
948 /* S3ExpressCredentialsProperties */
949 struct java_s3express_credentials_properties_properties {
950     jclass s3express_credentials_properties_class;
951     jmethodID constructor_method_id;
952     jfieldID host_field_id;
953     jfieldID region_field_id;
954 };
955 extern struct java_s3express_credentials_properties_properties s3express_credentials_properties_properties;
956 
957 /* S3ExpressCredentialsProvider */
958 struct java_s3express_credentials_provider_properties {
959     jmethodID getS3ExpressCredentials;
960     jmethodID destroyProvider;
961 };
962 extern struct java_s3express_credentials_provider_properties s3express_credentials_provider_properties;
963 
964 /**
965  * All functions bound to JNI MUST call this before doing anything else.
966  * This caches all JNI IDs the first time it is called. Any further calls are no-op; it is thread-safe.
967  * The reason we do this lazily, rather than simply calling it once from awsCrtInit(),
968  * is to avoid deadlock when multiple threads init the CRT simultaneously.
969  *
970  * See: https://github.com/awslabs/aws-crt-java/pull/670
971  */
972 void aws_cache_jni_ids(JNIEnv *env);
973 
974 #endif /* AWS_JNI_CRT_JAVA_CLASS_IDS_H */
975