Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert Mqtt5 Listener #623

Merged
merged 3 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
*/
package software.amazon.awssdk.crt.mqtt5;

import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import software.amazon.awssdk.crt.http.HttpProxyOptions;
import software.amazon.awssdk.crt.io.ClientBootstrap;
import software.amazon.awssdk.crt.io.ExponentialBackoffRetryOptions.JitterMode;
import software.amazon.awssdk.crt.io.SocketOptions;
import software.amazon.awssdk.crt.io.TlsContext;
import software.amazon.awssdk.crt.io.ExponentialBackoffRetryOptions.JitterMode;

import software.amazon.awssdk.crt.mqtt5.packets.ConnectPacket;

import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.function.Consumer;

/**
* Configuration for the creation of Mqtt5Clients
*
Expand Down Expand Up @@ -336,9 +337,7 @@ public interface LifecycleEvents {
*/
public interface PublishEvents {
/**
* Called when an MQTT PUBLISH packet is received by the client. If the PublishReturn has been already handled by
* a service client, then the callback will not get invoked.
* Checkout Mqtt5ListenerOptions.ListenerPublishEvents for more details.
* Called when an MQTT PUBLISH packet is received by the client
*
* @param client The client that has received the message
* @param publishReturn All of the data that was received from the server
Expand Down
73 changes: 0 additions & 73 deletions src/main/java/software/amazon/awssdk/crt/mqtt5/Mqtt5Listener.java

This file was deleted.

This file was deleted.

40 changes: 0 additions & 40 deletions src/native/java_class_ids.c
Original file line number Diff line number Diff line change
Expand Up @@ -1912,22 +1912,6 @@ static void s_cache_mqtt5_publish_events_properties(JNIEnv *env) {
AWS_FATAL_ASSERT(mqtt5_publish_events_properties.publish_events_publish_received_id);
}

struct java_aws_mqtt5_listener_publish_events mqtt5_listener_publish_events_properties;

static void s_cache_mqtt5_listener_publish_events_properties(JNIEnv *env) {
jclass cls = (*env)->FindClass(env, "software/amazon/awssdk/crt/mqtt5/Mqtt5ListenerOptions$ListenerPublishEvents");
AWS_FATAL_ASSERT(cls);
mqtt5_listener_publish_events_properties.listener_publish_events_class = (*env)->NewGlobalRef(env, cls);
AWS_FATAL_ASSERT(mqtt5_listener_publish_events_properties.listener_publish_events_class);
// Functions
mqtt5_listener_publish_events_properties.listener_publish_events_publish_received_id = (*env)->GetMethodID(
env,
mqtt5_listener_publish_events_properties.listener_publish_events_class,
"onMessageReceived",
"(Lsoftware/amazon/awssdk/crt/mqtt5/Mqtt5Client;Lsoftware/amazon/awssdk/crt/mqtt5/PublishReturn;)Z");
AWS_FATAL_ASSERT(mqtt5_listener_publish_events_properties.listener_publish_events_publish_received_id);
}

struct java_aws_mqtt5_lifecycle_events mqtt5_lifecycle_events_properties;

static void s_cache_mqtt5_lifecycle_events_properties(JNIEnv *env) {
Expand Down Expand Up @@ -2081,28 +2065,6 @@ static void s_cache_mqtt5_on_disconnection_return(JNIEnv *env) {
AWS_FATAL_ASSERT(mqtt5_on_disconnection_return_properties.return_constructor_id);
}

struct java_aws_mqtt5_listener_options_properties mqtt5_listener_options_properties;

static void s_cache_mqtt5_listener_options(JNIEnv *env) {
jclass cls = (*env)->FindClass(env, "software/amazon/awssdk/crt/mqtt5/Mqtt5ListenerOptions");
AWS_FATAL_ASSERT(cls);
mqtt5_listener_options_properties.listener_options_class = (*env)->NewGlobalRef(env, cls);
AWS_FATAL_ASSERT(mqtt5_listener_options_properties.listener_options_class);
// Functions
mqtt5_listener_options_properties.listener_publish_events_field_id = (*env)->GetFieldID(
env,
mqtt5_listener_options_properties.listener_options_class,
"listenerPublishEvents",
"Lsoftware/amazon/awssdk/crt/mqtt5/Mqtt5ListenerOptions$ListenerPublishEvents;");
AWS_FATAL_ASSERT(mqtt5_listener_options_properties.listener_publish_events_field_id);
mqtt5_listener_options_properties.lifecycle_events_field_id = (*env)->GetFieldID(
env,
mqtt5_listener_options_properties.listener_options_class,
"lifecycleEvents",
"Lsoftware/amazon/awssdk/crt/mqtt5/Mqtt5ClientOptions$LifecycleEvents;");
AWS_FATAL_ASSERT(mqtt5_listener_options_properties.lifecycle_events_field_id);
}

struct java_boxed_integer_properties boxed_integer_properties;

static void s_cache_boxed_integer(JNIEnv *env) {
Expand Down Expand Up @@ -2250,7 +2212,6 @@ void cache_java_class_ids(JNIEnv *env) {
s_cache_mqtt5_unsuback_reason_code(env);
s_cache_mqtt5_user_property(env);
s_cache_mqtt5_publish_events_properties(env);
s_cache_mqtt5_listener_publish_events_properties(env);
s_cache_mqtt5_lifecycle_events_properties(env);
s_cache_mqtt5_puback_result(env);
s_cache_mqtt5_publish_return(env);
Expand All @@ -2259,7 +2220,6 @@ void cache_java_class_ids(JNIEnv *env) {
s_cache_mqtt5_on_connection_success_return(env);
s_cache_mqtt5_on_connection_failure_return(env);
s_cache_mqtt5_on_disconnection_return(env);
s_cache_mqtt5_listener_options(env);
s_cache_boxed_integer(env);
s_cache_boxed_boolean(env);
s_cache_boxed_list(env);
Expand Down
16 changes: 0 additions & 16 deletions src/native/java_class_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -802,13 +802,6 @@ struct java_aws_mqtt5_publish_events {
};
extern struct java_aws_mqtt5_publish_events mqtt5_publish_events_properties;

/* mqtt5.Mqtt5ListenerOptions.PublishEvents */
struct java_aws_mqtt5_listener_publish_events {
jclass listener_publish_events_class;
jmethodID listener_publish_events_publish_received_id;
};
extern struct java_aws_mqtt5_listener_publish_events mqtt5_listener_publish_events_properties;

/* mqtt5.Mqtt5ClientOptions.LifecycleEvents */
struct java_aws_mqtt5_lifecycle_events {
jclass lifecycle_events_class;
Expand Down Expand Up @@ -870,15 +863,6 @@ struct java_aws_mqtt5_on_disconnection_return_properties {
};
extern struct java_aws_mqtt5_on_disconnection_return_properties mqtt5_on_disconnection_return_properties;

/* mqtt5.ListenerOptions */
struct java_aws_mqtt5_listener_options_properties {
jclass listener_options_class;

jfieldID listener_publish_events_field_id;
jfieldID lifecycle_events_field_id;
};
extern struct java_aws_mqtt5_listener_options_properties mqtt5_listener_options_properties;

/* java/lang/Integer */
struct java_boxed_integer_properties {
jclass integer_class;
Expand Down
Loading