API in Java
101
} else {
try {
queue.put(s);
} catch (InterruptedException ex) {
ex.printStackTrace();
System.out.println("exiting reader");
return;
}
s = "";
}
}
}
}
WriteCommand.java
All writing to RouterOS API is done using this.
package libAPI;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author janisk
*/
public class WriteCommand {
private byte[] len = {0};
private DataOutputStream out = null;
private String command = "";
WriteCommand(DataOutputStream out, String command) {
this.out = out;
this.command = command.replaceAll("\n", "").trim();
}
WriteCommand(DataOutputStream out) {
this.out = out;
}
Comments to this Manuals