diff --git a/reactor/src/main/java/com/hivemq/client2/internal/mqtt/reactor/MqttReactorClient.java b/reactor/src/main/java/com/hivemq/client2/internal/mqtt/reactor/MqttReactorClient.java index 1d0509068..abb015265 100644 --- a/reactor/src/main/java/com/hivemq/client2/internal/mqtt/reactor/MqttReactorClient.java +++ b/reactor/src/main/java/com/hivemq/client2/internal/mqtt/reactor/MqttReactorClient.java @@ -167,7 +167,7 @@ public MqttReactorClient(final @NotNull Mqtt5RxClient delegate) { return delegate.toBlocking(); } - private class MqttSubscribePublishesBuilder + public class MqttSubscribePublishesBuilder extends MqttSubscribeBuilder.Publishes> { @Override diff --git a/reactor/src/main/java/com/hivemq/client2/internal/mqtt/reactor/mqtt3/Mqtt3ReactorClientView.java b/reactor/src/main/java/com/hivemq/client2/internal/mqtt/reactor/mqtt3/Mqtt3ReactorClientView.java index 31b45c689..45a68ba73 100644 --- a/reactor/src/main/java/com/hivemq/client2/internal/mqtt/reactor/mqtt3/Mqtt3ReactorClientView.java +++ b/reactor/src/main/java/com/hivemq/client2/internal/mqtt/reactor/mqtt3/Mqtt3ReactorClientView.java @@ -149,7 +149,7 @@ public Mqtt3ReactorClientView(final @NotNull Mqtt3RxClient delegate) { return delegate.toBlocking(); } - private class Mqtt3SubscribeViewPublishesBuilder + public class Mqtt3SubscribeViewPublishesBuilder extends Mqtt3SubscribeViewBuilder.Publishes> { @Override diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/MqttAsyncClient.java b/src/main/java/com/hivemq/client2/internal/mqtt/MqttAsyncClient.java index 365b41714..7d90388f6 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/MqttAsyncClient.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/MqttAsyncClient.java @@ -310,7 +310,7 @@ public void onComplete() {} public void onError(final @NotNull Throwable t) {} } - private class SubscribeBuilder extends MqttSubscribeBuilder + public class SubscribeBuilder extends MqttSubscribeBuilder implements Mqtt5AsyncClient.SubscribeBuilder.Start.Complete, Mqtt5AsyncClient.SubscribeBuilder.AfterCallback { diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/MqttBlockingClient.java b/src/main/java/com/hivemq/client2/internal/mqtt/MqttBlockingClient.java index 1519dbe64..f3584717c 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/MqttBlockingClient.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/MqttBlockingClient.java @@ -216,7 +216,7 @@ public void disconnect(final @NotNull Mqtt5Disconnect disconnect) { return delegate.toAsync(); } - private static class Publishes implements Mqtt5BlockingClient.Publishes, FlowableSubscriber { + public static class Publishes implements Mqtt5BlockingClient.Publishes, FlowableSubscriber { private final @NotNull AtomicReference<@Nullable Subscription> subscription = new AtomicReference<>(); private final @NotNull NodeList entries = new NodeList<>(); diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/MqttRxClient.java b/src/main/java/com/hivemq/client2/internal/mqtt/MqttRxClient.java index 6be5d4bb1..ea128112f 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/MqttRxClient.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/MqttRxClient.java @@ -270,7 +270,7 @@ public MqttRxClient(final @NotNull MqttClientConfig clientConfig) { return new MqttBlockingClient(this); } - private class MqttSubscribePublishesBuilder + public class MqttSubscribePublishesBuilder extends MqttSubscribeBuilder.Publishes> { @Override diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/handler/auth/MqttReAuthHandler.java b/src/main/java/com/hivemq/client2/internal/mqtt/handler/auth/MqttReAuthHandler.java index d13b9c0b9..cce31e17c 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/handler/auth/MqttReAuthHandler.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/handler/auth/MqttReAuthHandler.java @@ -44,7 +44,7 @@ * @author Silvio Giebl */ @ConnectionScope -public class MqttReAuthHandler extends AbstractMqttAuthHandler { +class MqttReAuthHandler extends AbstractMqttAuthHandler { private @Nullable CompletableFlow flow; diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/incoming/MqttSubscribedPublishFlowTree.java b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/incoming/MqttSubscribedPublishFlowTree.java index c931bea60..b877fad4f 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/incoming/MqttSubscribedPublishFlowTree.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/incoming/MqttSubscribedPublishFlowTree.java @@ -36,7 +36,7 @@ * @author Silvio Giebl */ @NotThreadSafe -public class MqttSubscribedPublishFlowTree implements MqttSubscribedPublishFlows { +class MqttSubscribedPublishFlowTree implements MqttSubscribedPublishFlows { private @Nullable TopicTreeNode rootNode; diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/incoming/MqttSubscribedPublishFlows.java b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/incoming/MqttSubscribedPublishFlows.java index d286c5659..f2f70f15e 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/incoming/MqttSubscribedPublishFlows.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/incoming/MqttSubscribedPublishFlows.java @@ -29,7 +29,7 @@ * @author Silvio Giebl */ @NotThreadSafe -public interface MqttSubscribedPublishFlows { +interface MqttSubscribedPublishFlows { void subscribe( @NotNull MqttSubscription subscription, diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttOutgoingQosHandler.java b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttOutgoingQosHandler.java index c96d3e2df..1be4c1527 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttOutgoingQosHandler.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttOutgoingQosHandler.java @@ -173,7 +173,7 @@ void request(final long n) { this.shrinkRequests = 0; subscription.request(n - shrinkRequests); } else { - this.shrinkRequests -= n; + this.shrinkRequests = shrinkRequests - (int) n; } } diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishFlowableAckLink.java b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishFlowableAckLink.java index ce3e5dd69..30b150c68 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishFlowableAckLink.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishFlowableAckLink.java @@ -32,7 +32,7 @@ /** * @author Silvio Giebl */ -public class MqttPublishFlowableAckLink extends Flowable { +class MqttPublishFlowableAckLink extends Flowable { private final @NotNull Flowable source; private final @NotNull MqttAckFlowableFlow ackFlow; diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishFlowables.java b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishFlowables.java index 9727369e7..fc2513719 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishFlowables.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishFlowables.java @@ -30,7 +30,7 @@ * @author Silvio Giebl */ @ClientScope -public class MqttPublishFlowables extends Flowable> implements Subscription { +class MqttPublishFlowables extends Flowable> implements Subscription { private static final @NotNull InternalLogger LOGGER = InternalLoggerFactory.getLogger(MqttPublishFlowables.class); diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishWithFlow.java b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishWithFlow.java index ad361d3a2..6e892218f 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishWithFlow.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/handler/publish/outgoing/MqttPublishWithFlow.java @@ -22,7 +22,7 @@ /** * @author Silvio Giebl */ -class MqttPublishWithFlow extends MqttPubOrRelWithFlow { +public class MqttPublishWithFlow extends MqttPubOrRelWithFlow { private final @NotNull MqttPublish publish; diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/handler/subscribe/MqttSubscriptionHandler.java b/src/main/java/com/hivemq/client2/internal/mqtt/handler/subscribe/MqttSubscriptionHandler.java index 50f36214e..913387dfd 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/handler/subscribe/MqttSubscriptionHandler.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/handler/subscribe/MqttSubscriptionHandler.java @@ -130,7 +130,7 @@ public void subscribe( }); } - public void unsubscribe( + void unsubscribe( final @NotNull MqttUnsubscribe unsubscribe, final @NotNull MqttSubOrUnsubAckFlow flow) { flow.getEventLoop().execute(() -> { diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/message/subscribe/MqttSubscription.java b/src/main/java/com/hivemq/client2/internal/mqtt/message/subscribe/MqttSubscription.java index cfe8abcb2..8a224e659 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/message/subscribe/MqttSubscription.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/message/subscribe/MqttSubscription.java @@ -116,14 +116,14 @@ public int hashCode() { public byte encodeSubscriptionOptions() { byte subscriptionOptions = 0; - subscriptionOptions |= retainHandling.getCode() << 4; + subscriptionOptions |= (byte) (retainHandling.getCode() << 4); if (retainAsPublished) { subscriptionOptions |= 0b0000_1000; } if (noLocal) { subscriptionOptions |= 0b0000_0100; } - subscriptionOptions |= maxQos.getCode(); + subscriptionOptions |= (byte) maxQos.getCode(); return subscriptionOptions; } diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3AsyncClientView.java b/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3AsyncClientView.java index 74fa35e03..0ad043a46 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3AsyncClientView.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3AsyncClientView.java @@ -277,7 +277,7 @@ public void publishes( return new Mqtt3BlockingClientView(delegate.toBlocking()); } - private class SubscribeViewBuilder extends Mqtt3SubscribeViewBuilder + public class SubscribeViewBuilder extends Mqtt3SubscribeViewBuilder implements SubscribeBuilder.Start.Complete, SubscribeBuilder.AfterCallback { private @Nullable Consumer callback; diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3BlockingClientView.java b/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3BlockingClientView.java index fb1cf3975..15cd15394 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3BlockingClientView.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3BlockingClientView.java @@ -173,7 +173,7 @@ public void disconnect() { return new Mqtt3AsyncClientView(delegate.toAsync()); } - private static class PublishesView implements Publishes { + public static class PublishesView implements Publishes { private final @NotNull Mqtt5BlockingClient.Publishes delegate; diff --git a/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3RxClientView.java b/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3RxClientView.java index cb04de18f..d1a096ee1 100644 --- a/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3RxClientView.java +++ b/src/main/java/com/hivemq/client2/internal/mqtt/mqtt3/Mqtt3RxClientView.java @@ -207,7 +207,7 @@ public class Mqtt3RxClientView implements Mqtt3RxClient { return new Mqtt3BlockingClientView(delegate.toBlocking()); } - private class Mqtt3SubscribeViewPublishesBuilder + public class Mqtt3SubscribeViewPublishesBuilder extends Mqtt3SubscribeViewBuilder.Publishes> { @Override