Issue #2563 modified server config parsing to allow for custom port

Replaced parsing code that assumed no colon in the server name, which prevented connecting to servers that didn't use the default XMPP port.


Former-commit-id: 9102b08053 [formerly 4f2aa49807] [formerly cea12a1a1d] [formerly 9102b08053 [formerly 4f2aa49807] [formerly cea12a1a1d] [formerly b01e6f0c98 [formerly cea12a1a1d [formerly b995fe2036d4c0e26e25edd7f4bffd956d82921f]]]]
Former-commit-id: b01e6f0c98
Former-commit-id: bed3b77948 [formerly 74c6fdc613] [formerly 4ae9dcc3fd65cda97138587d88156c3cc3a8281c [formerly d64d95d0c6]]
Former-commit-id: b1724173d1c849579e5b1f5b75eabd48144df579 [formerly 37be43af82]
Former-commit-id: dd6fd2532c
This commit is contained in:
Brian Clements 2014-01-06 14:14:38 -06:00
parent 869430c984
commit 4d02d8e6e7
2 changed files with 18 additions and 2 deletions

View file

@ -66,6 +66,7 @@ import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jun 18, 2012 mschenke Initial creation * Jun 18, 2012 mschenke Initial creation
* Dec 19, 2013 2563 bclement added option to connect to server not in list * Dec 19, 2013 2563 bclement added option to connect to server not in list
* Jan 06, 2014 2563 bclement moved server text parsing to ServerInput class
* *
* </pre> * </pre>
* *
@ -289,7 +290,8 @@ public class LoginDialog extends Dialog {
public void widgetSelected(SelectionEvent event) { public void widgetSelected(SelectionEvent event) {
loginData.setUserName(userText.getText().trim()); loginData.setUserName(userText.getText().trim());
loginData.setPassword(passwordText.getText().trim()); loginData.setPassword(passwordText.getText().trim());
loginData.setServer(serverText.getText().split(":")[1].trim()); loginData.setServer(ServerInput.removeDescription(serverText
.getText()));
loginData.setStatus(statusCombo.getText()); loginData.setStatus(statusCombo.getText());
loginData.setMessage(messageText.getText().trim()); loginData.setMessage(messageText.getText().trim());
Map<String, String> attributes = new HashMap<String, String>(); Map<String, String> attributes = new HashMap<String, String>();

View file

@ -47,6 +47,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Dec 18, 2013 2563 bclement Initial creation * Dec 18, 2013 2563 bclement Initial creation
* Jan 06, 2014 2563 bclement added removeDescription
* *
* </pre> * </pre>
* *
@ -64,7 +65,6 @@ public class ServerInput implements Listener {
private static final int TIMEOUT = 5000; // 5 seconds private static final int TIMEOUT = 5000; // 5 seconds
/** /**
* @param serverText * @param serverText
*/ */
@ -158,4 +158,18 @@ public class ServerInput implements Listener {
} }
} }
/**
* Remove server description from server text field
*
* @param text
* @return
*/
public static String removeDescription(String text) {
int firstColon = text.indexOf(':');
if (firstColon >= 0) {
text = text.substring(firstColon + 1);
}
return text.trim();
}
} }