From 9e0f38149d14cde26a3c5e0439ccdb2944a6b180 Mon Sep 17 00:00:00 2001 From: GideonLeGrange Date: Mon, 23 Jun 2014 11:26:15 +0200 Subject: [PATCH] Modified README to explain version 2.0.0 --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index efbfdd7..a6707b4 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ The current stable version is 1.1.6, which managed to get into Maven Central. * 1.1.2 added support for handling multi-line results, like for example /file print. * 1.1 added TLS (SSL) support to encrypt API traffic. +The latest development version is 2.0.0 which is available using the 2.0.0 branch. + +* Changed ResultListener to receive errors and completion notifications. + Getting the API --------------- @@ -116,7 +120,7 @@ Asynchronous commands We can run some commands asynchronously in order to continue receiving updates: -This example shows how to run '/interface wireless monitor' and have the result sent to a listener object, which prints it +This example shows how to run '/interface wireless monitor' and have the result sent to a listener object, which prints it: ```java String tag = con.execute("/interface/wireless/monitor .id=wlan1 return signal-to-noise", @@ -125,6 +129,14 @@ String tag = con.execute("/interface/wireless/monitor .id=wlan1 return signal-to public void receive(Map result) { System.out.println(result); } + + public void error(MikrotikApiException e) { + System.out.println("An error occurred: " + e.getMessage()); + } + + public void completed() { + System.out.println("Asynchronous command has finished"); + } } ); @@ -136,6 +148,8 @@ The above command will run and send results asynchronously as they become availa con.cancel(tag); ``` +From version 2.0.0 of the API the error() and completed() methods are part of the ResultListener interface. + References ==========