Commit eca01310 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[GATE-86] Added connection test functionality.

Added status message for options update.
Fixed yahoo.xml options config.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@6352 b35dd754-fafc-0310-a699-88a17e54d16e
parent 37bb5df7
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.gateway.web;
import java.net.Socket;
/**
* Connection Tester
*
* This class tests a connection with a legacy service (just simple open port tcp check).
*
* @author Daniel Henninger
*/
public class ConnectionTester {
/**
* Tests a tcp connection to a host and port.
*
* @param host Hostname (or ip address) to try to connect to.
* @param port Port to try to connect to.
* @return True or false if the connection succeeded.
*/
public boolean testConnection(String host, String port) {
try {
Socket sock = new Socket(host, Integer.parseInt(port));
sock.close();
return true;
}
catch (Exception e) {
return false;
}
}
}
...@@ -43,8 +43,8 @@ public class GatewayDWR extends DWRServlet { ...@@ -43,8 +43,8 @@ public class GatewayDWR extends DWRServlet {
document.appendChild(root); document.appendChild(root);
Element allowElement = document.createElement("allow"); Element allowElement = document.createElement("allow");
Element timElement = buildCreator("ConfigManager", "org.jivesoftware.wildfire.gateway.web.ConfigManager"); allowElement.appendChild(buildCreator("ConfigManager", "org.jivesoftware.wildfire.gateway.web.ConfigManager"));
allowElement.appendChild(timElement); allowElement.appendChild(buildCreator("ConnectionTester", "org.jivesoftware.wildfire.gateway.web.ConnectionTester"));
root.appendChild(allowElement); root.appendChild(allowElement);
} }
......
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
<leftpanel></leftpanel> <leftpanel></leftpanel>
<rightpanel> <rightpanel>
<item type="text" sysprop="plugin.gateway.yahoo.connecthost" var="host" desc="Host" default="scs.msg.yahoo.com"/> <item type="text" sysprop="plugin.gateway.yahoo.connecthost" var="host" desc="Host" default="scs.msg.yahoo.com"/>
<item type="text" sysprop="plugin.gateway.yahoo.connectport" var="port" desc="Port" port="5050"/> <item type="text" sysprop="plugin.gateway.yahoo.connectport" var="port" desc="Port" default="5050"/>
</rightpanel> </rightpanel>
</optionsconfig> </optionsconfig>
\ No newline at end of file
This diff is collapsed.
...@@ -88,17 +88,23 @@ a.jive-gatewayButtonOn { ...@@ -88,17 +88,23 @@ a.jive-gatewayButtonOn {
padding: 0px; padding: 0px;
overflow: hidden; overflow: hidden;
-moz-border-radius: 0px 0px 4px 4px; -moz-border-radius: 0px 0px 4px 4px;
} }
.jive-gatewayPanel div { .jive-gatewayPanel div {
padding: 14px 15px 5px 15px; padding: 14px 15px 5px 15px;
} }
.jive-gatewayPanel div form { .jive-gatewayPanel div form {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
.jive-formButton { .jive-formButton {
margin: 10px 5px 5px 0px; margin: 10px 5px 5px 0px;
} }
.saveResultsMsg {
margin-left: 5px;
vertical-align: middle;
font-weight: bold;
color: #009900;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment