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

[MQTTv5] Enable use of Java's try-with-resources statement #1055

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void testMatchedTopicFilterWildcards() throws Exception {
String[][] matchingTopics = new String[][] { { "sport/tennis/player1/#", "sport/tennis/player1" },
{ "sport/tennis/player1/#", "sport/tennis/player1/ranking" },
{ "sport/tennis/player1/#", "sport/tennis/player1/score/wimbledon" }, { "sport/#", "sport" },
{ "#", "sport/tennis/player1" } };
{ "#", "sport/tennis/player1" } , {"sport/+/player1/ranking/#","sport/tennis/player1/ranking"} };

for (String[] pair : matchingTopics) {
Assert.assertTrue(pair[0] + " should match " + pair[1], MqttTopicValidator.isMatched(pair[0], pair[1]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.eclipse.paho.mqttv5.common.MqttSubscription;
import org.eclipse.paho.mqttv5.common.packet.MqttProperties;

public interface IMqttAsyncClient {
public interface IMqttAsyncClient extends AutoCloseable {

/**
* Connects to an MQTT server using the default options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
* style. The blocking client provides compatibility with earlier versions
* of the MQTT client.</p>
*/
public interface IMqttClient { //extends IMqttAsyncClient {
public interface IMqttClient extends AutoCloseable { //extends IMqttAsyncClient {
/**
* Connects to an MQTT server using the default options.
* <p>The default options are specified in {@link MqttConnectionOptions} class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* It is up to the persistence interface to log any exceptions or error information
* which may be required when diagnosing a persistence failure.</p>
*/
public interface MqttClientPersistence {
public interface MqttClientPersistence extends AutoCloseable {
/**
* Initialise the persistent store.
* If a persistent store exists for this client ID then open it, otherwise
Expand Down
Loading