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

"Drawing up" the web interface a tad. Also playing with threads for the...

"Drawing up" the web interface a tad.  Also playing with threads for the sessions again.  Still don't think I'm doing it right.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@5786 b35dd754-fafc-0310-a699-88a17e54d16e
parent f0e58cb9
......@@ -14,6 +14,7 @@ import org.xmpp.packet.JID;
import org.jivesoftware.wildfire.user.UserNotFoundException;
import org.jivesoftware.wildfire.roster.RosterItem;
import org.jivesoftware.wildfire.roster.Roster;
import org.jivesoftware.util.Log;
import java.util.TreeMap;
......@@ -40,6 +41,7 @@ public abstract class TransportSession implements Runnable {
this.jid = new JID(jid.toBareJID());
this.registration = registration;
this.transport = transport;
Log.debug("Created "+transport.getType()+" session for "+jid+" as '"+registration.getUsername()+"'");
}
/**
......@@ -55,6 +57,7 @@ public abstract class TransportSession implements Runnable {
this.registration = registration;
this.transport = transport;
addResource(jid.getResource(), priority);
Log.debug("Created "+transport.getType()+" session for "+jid+" as '"+registration.getUsername()+"'");
}
/**
......
......@@ -46,7 +46,7 @@ public class TransportSessionManager {
/**
* The actual repear task.
*/
@SuppressWarnings({"FieldCanBeLocal"}) private SessionReaper sessionReaper;
private SessionReaper sessionReaper;
/**
* The transport we are associated with.
......
......@@ -81,8 +81,8 @@ public class IRCTransport extends BaseTransport {
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) {
Log.debug("Logging in to IRC gateway.");
TransportSession session = new IRCSession(registration, jid, this, priority);
// Thread sessionThread = new Thread(session);
// sessionThread.start();
Thread sessionThread = new Thread(session);
sessionThread.start();
((IRCSession)session).logIn(presenceType, verboseStatus);
return session;
}
......@@ -95,7 +95,7 @@ public class IRCTransport extends BaseTransport {
public void registrationLoggedOut(TransportSession session) {
Log.debug("Logging out of IRC gateway.");
((IRCSession)session).logOut();
// session.sessionDone();
session.sessionDone();
// Just in case.
session.setLoginStatus(TransportLoginStatus.LOGGED_OUT);
}
......
......@@ -83,8 +83,8 @@ public class MSNTransport extends BaseTransport {
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) {
Log.debug("Logging in to MSN gateway.");
TransportSession session = new MSNSession(registration, jid, this, priority);
// Thread sessionThread = new Thread(session);
// sessionThread.start();
Thread sessionThread = new Thread(session);
sessionThread.start();
((MSNSession)session).logIn(presenceType, verboseStatus);
return session;
}
......@@ -97,7 +97,7 @@ public class MSNTransport extends BaseTransport {
public void registrationLoggedOut(TransportSession session) {
Log.debug("Logging out of MSN gateway.");
((MSNSession)session).logOut();
// session.sessionDone();
session.sessionDone();
// Just in case.
session.setLoginStatus(TransportLoginStatus.LOGGED_OUT);
}
......
......@@ -84,8 +84,8 @@ public class OSCARTransport extends BaseTransport {
*/
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) {
TransportSession session = new OSCARSession(registration, jid, this, priority);
// Thread sessionThread = new Thread(session);
// sessionThread.start();
Thread sessionThread = new Thread(session);
sessionThread.start();
((OSCARSession)session).logIn(presenceType, verboseStatus);
return session;
}
......@@ -97,7 +97,7 @@ public class OSCARTransport extends BaseTransport {
*/
public void registrationLoggedOut(TransportSession session) {
((OSCARSession)session).logOut();
// session.sessionDone();
session.sessionDone();
// Just in case.
session.setLoginStatus(TransportLoginStatus.LOGGED_OUT);
}
......
......@@ -83,8 +83,8 @@ public class YahooTransport extends BaseTransport {
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) {
Log.debug("Logging in to Yahoo gateway.");
TransportSession session = new YahooSession(registration, jid, this, priority);
// Thread sessionThread = new Thread(session);
// sessionThread.start();
Thread sessionThread = new Thread(session);
sessionThread.start();
((YahooSession)session).logIn(presenceType, verboseStatus);
return session;
}
......@@ -97,7 +97,7 @@ public class YahooTransport extends BaseTransport {
public void registrationLoggedOut(TransportSession session) {
Log.debug("Logging out of Yahoo gateway.");
((YahooSession)session).logOut();
// session.sessionDone();
session.sessionDone();
// Just in case.
session.setLoginStatus(TransportLoginStatus.LOGGED_OUT);
}
......
......@@ -44,7 +44,8 @@
</div>
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>tests" style="display: none;">
<div>
<i>This is not yet functional.</i><br />
<span style="font-weight: bold">Connect to host:</span> <span id="testhost">ninja</span><br />
<span style="font-weight: bold">Connect to port:</span> <span id="testport">1234</span><br />
<form action="">
<input type="submit" name="submit" value="Test Connection" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>tests,jive<%= this.gatewayType.toString().toUpperCase() %>tests); return false" class="jive-formButton">
</form>
......@@ -52,22 +53,64 @@
</div>
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>options" style="display: none;">
<div>
<i>This is not yet functional.</i><br />
<form action="">
<!-- <input type="checkbox" name="filetransfer" value="enabled"> Enable file transfer<br> -->
<!-- <input type="checkbox" name="reconnect" value="enabled"> Reconnect on disconnect<br> -->
<input type="submit" name="submit" value="Save Options" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options,jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" class="jive-formButton">
<table border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td align="left" width="50%">
<table border="0" cellpadding="1" cellspacing="2">
<tr valign="middle">
<td width="1%"><input type="checkbox" name="filetransfer" value="enabled"></td>
<td>Enable file transfer</td>
</tr>
<tr valign="middle">
<td width="1%"><input type="checkbox" name="reconnect" value="enabled"></td>
<td>Reconnect on disconnect</td>
</tr>
<tr valign="middle">
<td width="1%">&nbsp;</td>
<td>Reconnect Attemps: <input type="text" style="margin: 0.0px; padding: 0.0px" name="reconnect_attempts" size="4" maxlength="4" value="10" /></td>
</tr>
</table>
</td>
<td align="left" width="50%">
<table border="0">
<tr valign="middle">
<td align="right" width="1%">Host:</td>
<td><input type="text" name="host" value="blar" onChange="getElementById('testhost').innerHTML = this.value" /></td>
</tr>
<tr valign="middle">
<td align="right" width="1%">Port:</td>
<td><input type="text" name="host" value="1234" onChange="getElementById('testport').innerHTML = this.value" /></td>
</tr>
</table>
</td>
</tr>
</table>
<input type="submit" name="submit" value="Save Options" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options,jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" class="jive-formButton">
<input type="reset" name="cancel" value="Cancel" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options,jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" class="jive-formButton">
</form>
</div>
</div>
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>perms" style="display: none;">
<div>
<i>This is not yet functional.</i><br />
<form action="">
<input type="radio" name="userreg" value="all" checked> All users can register<br>
<input type="radio" name="userreg" value="specific"> These users and/or groups can register<br>
<input type="radio" name="userreg" value="manual"> Manual registration only (see the Registrations section to manage)<br>
<input type="radio" name="userreg" value="all" onClick="getElementById('userreg_specific').style.display = 'none'" checked> All users can register<br>
<input type="radio" name="userreg" value="specific" onClick="getElementById('userreg_specific').style.display = 'block'"> These users and/or groups can register<br>
<div id="userreg_specific" style="display: none; margin: 0; padding: 0; font-size: 80%">
<table border="0" cellpadding="0" cellspacing="0" style="padding-left: 30.0px">
<tr valign="top">
<td align="left">
<span style="font-weight: bold">Users</span> <a href="">(Modify Users)</a><br />
(none selected)
</td>
<td align="left" style="padding-left: 30.0px">
<span style="font-weight: bold">Groups</span> <a href="">(Modify Groups)</a><br />
(none selected)
</td>
</tr>
</table>
</div>
<input type="radio" name="userreg" value="manual" onClick="getElementById('userreg_specific').style.display = 'none'"> Manual registration only (see the Registrations section to manage)<br>
<input type="submit" name="submit" value="Save Permissions" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>perms,jive<%= this.gatewayType.toString().toUpperCase() %>options); return false" class="jive-formButton">
<input type="reset" name="cancel" value="Cancel" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>perms,jive<%= this.gatewayType.toString().toUpperCase() %>options); return false" class="jive-formButton">
</form>
......
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