Preparing for 2.2 release

This commit is contained in:
Gideon le Grange 2015-05-05 13:20:35 +02:00
parent 158386ef44
commit 702aa45a18
3 changed files with 14 additions and 14 deletions

View File

@ -6,15 +6,17 @@ This project provides a Java client to manipulate Mikrotik routers using the rem
## Versions
**The current stable version is 2.2**
This library uses [semantic versioning](http://semver.org/)
**The current stable version is 2.1**
### Changes in version 2.2:
### Changes in version 2.1:
Version 2.2 implements AutoCloseable on ApiConnection to support Java 7's try-with-resources statement.
Version 2.1 adds the ability to use connection and command timeouts as requested by users. To see how to use these, please refer to the examples below. For more information, look at issue [#16](https://github.com/GideonLeGrange/mikrotik-java/issues/16).
#### Previous 2.x versions:
#### Previous 2.0 versions:
* 2.1 added the ability to use connection and command timeouts as.
* 2.0.3 Fixed bug #18 - An empty username in ```login()``` caused the API to hang.
* 2.0.2 Fixed bug #13 - processor thread wasn't being stopped on disconnect(), causing non-exit of application in some cases.

View File

@ -9,7 +9,7 @@
<groupId>me.legrange</groupId>
<artifactId>mikrotik</artifactId>
<version>2.1</version>
<version>2.2</version>
<packaging>jar</packaging>
<name>Mikrotik API Java Client Library</name>

View File

@ -2,27 +2,25 @@ package examples;
import java.util.List;
import java.util.Map;
import me.legrange.mikrotik.ApiConnection;
import me.legrange.mikrotik.MikrotikApiException;
/**
* Example 9: Test special characters in usernames
* Example 9: Try with resources
*
* @author gideon
*/
public class Example9 extends Example {
public class Example9 {
public static void main(String... args) throws Exception {
Example9 ex = new Example9();
ex.connect();
ex.test();
ex.disconnect();
}
private void test() throws MikrotikApiException, InterruptedException {
List<Map<String, String>> res = con.execute("/user/add name=çãáõ");
for (Map<String, String> r : res) {
System.out.println(r);
try (ApiConnection con = ApiConnection.connect(Config.HOST, ApiConnection.DEFAULT_PORT, 2000)) {
con.login(Config.USERNAME, Config.PASSWORD);
con.execute("/user/add name=eric");
}
// con.execute("/ip/firewall/filter/add chain=forward hotspot=!auth protocol=tcp src-port=8000-8084");
}
}