mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 04:02:15 +02:00
Additional minor refactoring.
This commit is contained in:
parent
8b3a5d9c3a
commit
736dc3a0b8
@ -1,11 +1,11 @@
|
||||
public class Client implements ClientEventReceiver {
|
||||
private ClientImpl client_impl;
|
||||
public class Client implements OpenVPNClientThread.EventReceiver {
|
||||
private OpenVPNClientThread client_impl;
|
||||
|
||||
static class ConfigError extends Exception {
|
||||
public static class ConfigError extends Exception {
|
||||
public ConfigError(String msg) { super(msg); }
|
||||
}
|
||||
|
||||
static class CredsUnspecifiedError extends Exception {
|
||||
public static class CredsUnspecifiedError extends Exception {
|
||||
public CredsUnspecifiedError(String msg) { super(msg); }
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ public class Client implements ClientEventReceiver {
|
||||
|
||||
public Client(String config_text, String username, String password) throws ConfigError, CredsUnspecifiedError {
|
||||
// init client implementation object
|
||||
client_impl = new ClientImpl();
|
||||
client_impl = new OpenVPNClientThread();
|
||||
|
||||
// load/eval config
|
||||
Config config = new Config();
|
||||
|
@ -1,4 +0,0 @@
|
||||
public interface ClientEventReceiver {
|
||||
void event(Event event);
|
||||
void log(LogInfo loginfo);
|
||||
}
|
@ -1,12 +1,17 @@
|
||||
public class ClientImpl extends OpenVPNClientBase implements Runnable {
|
||||
private ClientEventReceiver parent;
|
||||
public class OpenVPNClientThread extends OpenVPNClientBase implements Runnable {
|
||||
private EventReceiver parent;
|
||||
private Status connect_status;
|
||||
|
||||
public ClientImpl() {
|
||||
public interface EventReceiver {
|
||||
void event(Event event);
|
||||
void log(LogInfo loginfo);
|
||||
}
|
||||
|
||||
public OpenVPNClientThread() {
|
||||
parent = null;
|
||||
}
|
||||
|
||||
public Status connect(ClientEventReceiver parent_arg) {
|
||||
public Status connect(EventReceiver parent_arg) {
|
||||
// direct client callbacks to parent
|
||||
parent = parent_arg;
|
||||
|
Loading…
Reference in New Issue
Block a user