aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/ircaccregwizz
diff options
context:
space:
mode:
authorDanny van Heumen <danny@dannyvanheumen.nl>2015-04-03 16:47:44 +0200
committerDanny van Heumen <danny@dannyvanheumen.nl>2015-04-03 21:37:01 +0200
commit976559f5b1c8aab2467a9159b6ad5a9dbe3c4b6c (patch)
treebf7ce2469a67b833e6a0c39c424a83b6a601caa3 /src/net/java/sip/communicator/plugin/ircaccregwizz
parent8319f99727366d3544c2b2288d369832d46b3f45 (diff)
downloadjitsi-976559f5b1c8aab2467a9159b6ad5a9dbe3c4b6c.zip
jitsi-976559f5b1c8aab2467a9159b6ad5a9dbe3c4b6c.tar.gz
jitsi-976559f5b1c8aab2467a9159b6ad5a9dbe3c4b6c.tar.bz2
Added option for resolving all DNS lookups through SOCKS proxy.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/ircaccregwizz')
-rw-r--r--src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java25
-rw-r--r--src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistration.java58
-rw-r--r--src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java24
3 files changed, 97 insertions, 10 deletions
diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java
index cdaf60f..18ede51 100644
--- a/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java
+++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java
@@ -114,6 +114,9 @@ public class FirstWizardPage
= new SIPCommCheckBox(
Resources.getString("plugin.ircaccregwizz.AUTO_NICK_CHANGE"));
+ private JCheckBox resolveDnsThroughProxy = new SIPCommCheckBox(
+ Resources.getString("plugin.ircaccregwizz.RESOLVE_DNS_THROUGH_PROXY"));
+
private JCheckBox defaultPort = new SIPCommCheckBox(
Resources.getString("plugin.ircaccregwizz.USE_DEFAULT_PORT"));
@@ -182,6 +185,7 @@ public class FirstWizardPage
this.portField.setEnabled(false);
this.rememberPassBox.setEnabled(false);
this.useSecureConnection.setEnabled(true);
+ this.resolveDnsThroughProxy.setEnabled(true);
}
/**
@@ -208,6 +212,7 @@ public class FirstWizardPage
this.passField.setEnabled(false);
this.rememberPassBox.setSelected(true);
this.autoNickChange.setSelected(true);
+ this.resolveDnsThroughProxy.setSelected(true);
this.defaultPort.setSelected(true);
this.passwordNotRequired.setSelected(true);
this.useSecureConnection.setSelected(true);
@@ -267,10 +272,14 @@ public class FirstWizardPage
serverPanel.setBorder(BorderFactory.createTitledBorder(
Resources.getString("plugin.ircaccregwizz.IRC_SERVER")));
- optionsPanel.add(rememberPassBox, BorderLayout.NORTH);
- optionsPanel.add(autoNickChange, BorderLayout.CENTER);
- JPanel partition = new TransparentPanel();
- optionsPanel.add(partition);
+ final JPanel optionsSubPanel = new TransparentPanel();
+ optionsSubPanel.setLayout(new BoxLayout(optionsSubPanel, BoxLayout.Y_AXIS));
+ optionsPanel.add(optionsSubPanel, BorderLayout.WEST);
+ optionsSubPanel.add(rememberPassBox);
+ optionsSubPanel.add(autoNickChange);
+ final JPanel partition = new TransparentPanel();
+ optionsSubPanel.add(resolveDnsThroughProxy);
+ optionsPanel.add(partition, BorderLayout.SOUTH);
partition.setLayout(new BorderLayout());
partition.add(enableContactPresenceTask, BorderLayout.WEST);
partition.add(enableChatRoomPresenceTask, BorderLayout.EAST);
@@ -404,6 +413,8 @@ public class FirstWizardPage
&& this.saslEnabled.isSelected());
registration.setSaslUser(this.saslUserIdField.getText());
registration.setSaslRole(this.saslRoleField.getText());
+ registration.setResolveDnsThroughProxy(this.resolveDnsThroughProxy
+ .isSelected());
isCommitted = true;
}
@@ -507,6 +518,10 @@ public class FirstWizardPage
accountID.getAccountPropertyBoolean(
ProtocolProviderFactory.DEFAULT_ENCRYPTION, true);
+ boolean resolveDnsThroughProxy =
+ accountID.getAccountPropertyBoolean(
+ IrcAccountRegistrationWizard.RESOLVE_DNS_THROUGH_PROXY, true);
+
boolean contactPresenceTaskEnabled =
accountID.getAccountPropertyBoolean(
IrcAccountRegistrationWizard.CONTACT_PRESENCE_TASK, true);
@@ -552,6 +567,8 @@ public class FirstWizardPage
new Boolean(autoNickChange).booleanValue());
}
+ this.resolveDnsThroughProxy.setSelected(resolveDnsThroughProxy);
+
if (noPasswordRequired != null)
{
boolean isPassRequired = !Boolean.valueOf(noPasswordRequired);
diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistration.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistration.java
index 08a71fd..435157a 100644
--- a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistration.java
+++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistration.java
@@ -26,6 +26,7 @@ public class IrcAccountRegistration
private boolean saslEnabled;
private String saslUser;
private String saslRole;
+ private boolean resolveDnsThroughProxy;
/**
* Option for activating contact presence task.
@@ -186,7 +187,7 @@ public class IrcAccountRegistration
/**
* Indicates if the the connection must be secure or not.
- *
+ *
* @return returns <code>true</code> to indicate that the connection should
* be secure, or false for unsecured connection.
*/
@@ -197,7 +198,7 @@ public class IrcAccountRegistration
/**
* Set the <tt>useSecureConnection</tt> property.
- *
+ *
* @param secureConnection true to require secure connection, or false
* for unsecured connections
*/
@@ -246,33 +247,86 @@ public class IrcAccountRegistration
this.chatroomPresenceTaskEnabled = value;
}
+ /**
+ * Get SASL enable status.
+ *
+ * @return Returns <tt>true</tt> if SASL is enabled, or <tt>false</tt> if
+ * SASL is disabled.
+ */
public boolean isSaslEnabled()
{
return this.saslEnabled;
}
+ /**
+ * Set SASL enabled.
+ *
+ * @param enabled <tt>true</tt> to enable SASL, <tt>false</tt> to disable
+ */
public void setSaslEnabled(final boolean enabled)
{
this.saslEnabled = enabled;
}
+ /**
+ * Get SASL user name.
+ *
+ * @return Returns SASL user name.
+ */
public String getSaslUser()
{
return this.saslUser;
}
+ /**
+ * Set SASL user name. (Mandatory)
+ *
+ * @param user SASL user name
+ */
public void setSaslUser(final String user)
{
this.saslUser = user;
}
+ /**
+ * Get SASL authorization role. (Optional)
+ *
+ * @return Returns the SASL authorization role if configured, of
+ * <tt>null</tt> if no role known.
+ */
public String getSaslRole()
{
return this.saslRole;
}
+ /**
+ * Set SASL authorization role.
+ *
+ * @param role the SASL authorization role
+ */
public void setSaslRole(final String role)
{
this.saslRole = role;
}
+
+ /**
+ * Get property for resolving DNS names through configured proxy server.
+ * <tt>true</tt> to resolve DNS names through configured proxy server, or
+ * <tt>false</tt> to resolve using own DNS server.
+ */
+ public boolean isResolveDnsThroughProxy()
+ {
+ return this.resolveDnsThroughProxy;
+ }
+
+ /**
+ * Set property for resolving DNS through configured proxy server.
+ *
+ * @param value <tt>true</tt> to enable resolving through proxy server, or
+ * <tt>false</tt> to resolve via local DNS server
+ */
+ public void setResolveDnsThroughProxy(final boolean value)
+ {
+ this.resolveDnsThroughProxy = value;
+ }
}
diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java
index 7f26e69..a1c71ff 100644
--- a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java
+++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java
@@ -61,7 +61,16 @@ public class IrcAccountRegistrationWizard
* Property for SASL authorization role.
*/
public static final String SASL_ROLE = "SASL_ROLE";
-
+
+ /**
+ * Property for resolving DNS names through configured proxy server.
+ */
+ public static final String RESOLVE_DNS_THROUGH_PROXY =
+ "RESOLVE_DNS_THROUGH_PROXY";
+
+ /**
+ * Logger.
+ */
private final Logger logger
= Logger.getLogger(IrcAccountRegistrationWizard.class);
@@ -198,6 +207,9 @@ public class IrcAccountRegistrationWizard
summaryTable.put(
Resources.getString("plugin.ircaccregwizz.USE_SECURE_CONNECTION"),
registration.isSecureConnection() ? yes : no);
+ summaryTable.put(Resources
+ .getString("plugin.ircaccregwizz.RESOLVE_DNS_THROUGH_PROXY"),
+ registration.isResolveDnsThroughProxy() ? yes : no);
summaryTable
.put(Resources
.getString("plugin.ircaccregwizz.ENABLE_CONTACT_PRESENCE"),
@@ -294,14 +306,18 @@ public class IrcAccountRegistrationWizard
accountProperties.put(
ProtocolProviderFactory.AUTO_CHANGE_USER_NAME,
- new Boolean(registration.isAutoChangeNick()).toString());
+ Boolean.toString(registration.isAutoChangeNick()));
+
+ accountProperties.put(
+ IrcAccountRegistrationWizard.RESOLVE_DNS_THROUGH_PROXY,
+ Boolean.toString(registration.isResolveDnsThroughProxy()));
accountProperties.put(
ProtocolProviderFactory.NO_PASSWORD_REQUIRED,
- new Boolean(!registration.isRequiredPassword()).toString());
+ Boolean.toString(!registration.isRequiredPassword()));
accountProperties.put(ProtocolProviderFactory.DEFAULT_ENCRYPTION,
- new Boolean(registration.isSecureConnection()).toString());
+ Boolean.toString(registration.isSecureConnection()).toString());
// Presence-based background tasks
accountProperties.put(CONTACT_PRESENCE_TASK,