|
|
@ -40,6 +40,7 @@ public class ServerSetting implements SimpleListItem { |
|
|
|
private final Daemon type; |
|
|
|
private final Daemon type; |
|
|
|
private final String address; |
|
|
|
private final String address; |
|
|
|
private final String localAddress; |
|
|
|
private final String localAddress; |
|
|
|
|
|
|
|
private final int localPort; |
|
|
|
private final String localNetwork; |
|
|
|
private final String localNetwork; |
|
|
|
private final int port; |
|
|
|
private final int port; |
|
|
|
private final String folder; |
|
|
|
private final String folder; |
|
|
@ -65,6 +66,7 @@ public class ServerSetting implements SimpleListItem { |
|
|
|
* @param type The server daemon type |
|
|
|
* @param type The server daemon type |
|
|
|
* @param address The server domain name or IP address |
|
|
|
* @param address The server domain name or IP address |
|
|
|
* @param localAddress The server domain or IP address when connected to the server's local network |
|
|
|
* @param localAddress The server domain or IP address when connected to the server's local network |
|
|
|
|
|
|
|
* @param localPort The port on which the server is running in the server's local network |
|
|
|
* @param localNetwork The server's local network SSID |
|
|
|
* @param localNetwork The server's local network SSID |
|
|
|
* @param port The port on which the server daemon is running |
|
|
|
* @param port The port on which the server daemon is running |
|
|
|
* @param sslTrustKey The specific key that will be accepted. |
|
|
|
* @param sslTrustKey The specific key that will be accepted. |
|
|
@ -78,16 +80,17 @@ public class ServerSetting implements SimpleListItem { |
|
|
|
* @param timeout The number of seconds to wait before timing out a connection attempt |
|
|
|
* @param timeout The number of seconds to wait before timing out a connection attempt |
|
|
|
* @param isAutoGenerated Whether this setting was generated rather than manually inputed by the user |
|
|
|
* @param isAutoGenerated Whether this setting was generated rather than manually inputed by the user |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public ServerSetting(int key, String name, Daemon type, String address, String localAddress, String localNetwork, |
|
|
|
public ServerSetting(int key, String name, Daemon type, String address, String localAddress, int localPort, |
|
|
|
int port, boolean ssl, boolean sslTrustAll, String sslTrustKey, String folder, boolean useAuthentication, |
|
|
|
String localNetwork, int port, boolean ssl, boolean sslTrustAll, String sslTrustKey, String folder, |
|
|
|
String username, String password, String extraPass, OS os, String downloadDir, String ftpUrl, |
|
|
|
boolean useAuthentication, String username, String password, String extraPass, OS os, String downloadDir, |
|
|
|
String ftpPassword, int timeout, boolean alarmOnFinishedDownload, boolean alarmOnNewTorrent, |
|
|
|
String ftpUrl, String ftpPassword, int timeout, boolean alarmOnFinishedDownload, boolean alarmOnNewTorrent, |
|
|
|
boolean isAutoGenerated) { |
|
|
|
boolean isAutoGenerated) { |
|
|
|
this.key = key; |
|
|
|
this.key = key; |
|
|
|
this.name = name; |
|
|
|
this.name = name; |
|
|
|
this.type = type; |
|
|
|
this.type = type; |
|
|
|
this.address = address; |
|
|
|
this.address = address; |
|
|
|
this.localAddress = localAddress; |
|
|
|
this.localAddress = localAddress; |
|
|
|
|
|
|
|
this.localPort = localPort; |
|
|
|
this.localNetwork = localNetwork; |
|
|
|
this.localNetwork = localNetwork; |
|
|
|
this.port = port; |
|
|
|
this.port = port; |
|
|
|
this.ssl = ssl; |
|
|
|
this.ssl = ssl; |
|
|
@ -131,6 +134,10 @@ public class ServerSetting implements SimpleListItem { |
|
|
|
return localAddress; |
|
|
|
return localAddress; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int getLocalPort() { |
|
|
|
|
|
|
|
return localPort; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getLocalNetwork() { |
|
|
|
public String getLocalNetwork() { |
|
|
|
return localNetwork; |
|
|
|
return localNetwork; |
|
|
|
} |
|
|
|
} |
|
|
@ -254,7 +261,7 @@ public class ServerSetting implements SimpleListItem { |
|
|
|
* Returns the appropriate daemon adapter to which tasks can be executed, in accordance with this server's settings |
|
|
|
* Returns the appropriate daemon adapter to which tasks can be executed, in accordance with this server's settings |
|
|
|
* @param connectedToNetwork The name of the (wifi) network we are currently connected to, or null if this could not |
|
|
|
* @param connectedToNetwork The name of the (wifi) network we are currently connected to, or null if this could not |
|
|
|
* be determined |
|
|
|
* be determined |
|
|
|
* @param context |
|
|
|
* @param context |
|
|
|
* @return An IDaemonAdapter instance of the specific torrent client daemon type |
|
|
|
* @return An IDaemonAdapter instance of the specific torrent client daemon type |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public IDaemonAdapter createServerAdapter(String connectedToNetwork, Context context) { |
|
|
|
public IDaemonAdapter createServerAdapter(String connectedToNetwork, Context context) { |
|
|
@ -276,9 +283,10 @@ public class ServerSetting implements SimpleListItem { |
|
|
|
Log.d(caller, "Creating adapter for " + name + " of type " + type.name() + ": connected to " |
|
|
|
Log.d(caller, "Creating adapter for " + name + " of type " + type.name() + ": connected to " |
|
|
|
+ connectedToNetwork + " and configured local network is " + localNetwork); |
|
|
|
+ connectedToNetwork + " and configured local network is " + localNetwork); |
|
|
|
return new DaemonSettings(name, type, |
|
|
|
return new DaemonSettings(name, type, |
|
|
|
connectedToNetwork != null && connectedToNetwork.equals(localNetwork) ? localAddress : address, port, |
|
|
|
connectedToNetwork != null && connectedToNetwork.equals(localNetwork) ? localAddress : address, |
|
|
|
ssl, sslTrustAll, sslTrustKey, folder, useAuthentication, username, password, extraPass, os, |
|
|
|
connectedToNetwork != null && connectedToNetwork.equals(localNetwork) ? localPort : port, ssl, |
|
|
|
downloadDir, ftpUrl, ftpPassword, timeout, alarmOnFinishedDownload, alarmOnNewTorrent, |
|
|
|
sslTrustAll, sslTrustKey, folder, useAuthentication, username, password, extraPass, os, downloadDir, |
|
|
|
Integer.toString(key), isAutoGenerated); |
|
|
|
ftpUrl, ftpPassword, timeout, alarmOnFinishedDownload, alarmOnNewTorrent, Integer.toString(key), |
|
|
|
|
|
|
|
isAutoGenerated); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|