Commit 1a3b3462 authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

Refactoring changes


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@618 b35dd754-fafc-0310-a699-88a17e54d16e
parent d3683ff3
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
<%@ page import="org.jivesoftware.util.*, <%@ page import="org.jivesoftware.util.*,
org.jivesoftware.admin.*, org.jivesoftware.admin.*,
org.jivesoftware.messenger.XMPPAddress,
org.jivesoftware.messenger.group.Group" org.jivesoftware.messenger.group.Group"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
org.jivesoftware.messenger.user.*, org.jivesoftware.messenger.user.*,
java.util.*, java.util.*,
java.text.*, java.text.*,
org.jivesoftware.admin.AdminPageBean" org.jivesoftware.admin.AdminPageBean,
org.jivesoftware.admin.AdminConsole"
%> %>
......
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
java.text.DateFormat, java.text.DateFormat,
java.text.NumberFormat, java.text.NumberFormat,
org.jivesoftware.admin.*, org.jivesoftware.admin.*,
org.jivesoftware.messenger.user.User" org.jivesoftware.messenger.user.User,
org.xmpp.packet.JID,
org.xmpp.packet.Presence"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
...@@ -34,9 +36,9 @@ ...@@ -34,9 +36,9 @@
// Get the session & address objects // Get the session & address objects
SessionManager sessionManager = webManager.getSessionManager(); SessionManager sessionManager = webManager.getSessionManager();
XMPPAddress address = XMPPAddress.parseJID(jid); JID address = new JID(jid);
Session currentSess = sessionManager.getSession(address); Session currentSess = sessionManager.getSession(address);
boolean isAnonymous = address.getName() == null || "".equals(address.getName()); boolean isAnonymous = address.getNode() == null || "".equals(address.getNode());
// Get a presence manager // Get a presence manager
PresenceManager presenceManager = webManager.getPresenceManager(); PresenceManager presenceManager = webManager.getPresenceManager();
...@@ -44,7 +46,7 @@ ...@@ -44,7 +46,7 @@
// Get user object // Get user object
User user = null; User user = null;
if (!isAnonymous) { if (!isAnonymous) {
user = webManager.getUserManager().getUser(address.getName()); user = webManager.getUserManager().getUser(address.getNode());
} }
// Handle a "message" click: // Handle a "message" click:
...@@ -55,9 +57,9 @@ ...@@ -55,9 +57,9 @@
// See if there are multiple sessions for this user: // See if there are multiple sessions for this user:
Collection<Session> sessions = null; Collection<Session> sessions = null;
int sessionCount = sessionManager.getSessionCount(address.getName()); int sessionCount = sessionManager.getSessionCount(address.getNode());
if (!isAnonymous && sessionCount > 1) { if (!isAnonymous && sessionCount > 1) {
sessions = sessionManager.getSessions(address.getName()); sessions = sessionManager.getSessions(address.getNode());
} }
// Date dateFormatter for all dates on this page: // Date dateFormatter for all dates on this page:
...@@ -80,7 +82,7 @@ ...@@ -80,7 +82,7 @@
<p> <p>
Below are session details for the session <b><%= address.toString() %></b>. If the Below are session details for the session <b><%= address.toString() %></b>. If the
user <b><%= address.getName() %></b> has multiple sessions open, they will appear below. user <b><%= address.getNode() %></b> has multiple sessions open, they will appear below.
</p> </p>
<div class="jive-table"> <div class="jive-table">
...@@ -106,7 +108,7 @@ user <b><%= address.getName() %></b> has multiple sessions open, they will appea ...@@ -106,7 +108,7 @@ user <b><%= address.getName() %></b> has multiple sessions open, they will appea
User Name &amp; Resource: User Name &amp; Resource:
</td> </td>
<td> <td>
<% String n = address.getName(); %> <% String n = address.getNode(); %>
<% if (n == null || "".equals(n)) { %> <% if (n == null || "".equals(n)) { %>
<i>Anonymous</i> - <%= address.getResource() %> <i>Anonymous</i> - <%= address.getResource() %>
...@@ -165,7 +167,7 @@ user <b><%= address.getName() %></b> has multiple sessions open, they will appea ...@@ -165,7 +167,7 @@ user <b><%= address.getName() %></b> has multiple sessions open, they will appea
</td> </td>
<td> <td>
<% <%
int show = currentSess.getPresence().getShow(); Presence.Show show = currentSess.getPresence().getShow();
String statusTxt = currentSess.getPresence().getStatus(); String statusTxt = currentSess.getPresence().getStatus();
if (statusTxt != null) { if (statusTxt != null) {
statusTxt = " -- " + statusTxt; statusTxt = " -- " + statusTxt;
...@@ -173,33 +175,33 @@ user <b><%= address.getName() %></b> has multiple sessions open, they will appea ...@@ -173,33 +175,33 @@ user <b><%= address.getName() %></b> has multiple sessions open, they will appea
else { else {
statusTxt = ""; statusTxt = "";
} }
if (show == Presence.SHOW_AWAY) { if (show == Presence.Show.away) {
%> %>
<img src="images/bullet-yellow-14x14.gif" width="14" height="14" border="0" title="Away"> <img src="images/bullet-yellow-14x14.gif" width="14" height="14" border="0" title="Away">
Away <%= statusTxt %> Away <%= statusTxt %>
<% <%
} else if (show == Presence.SHOW_CHAT) { } else if (show == Presence.Show.chat) {
%> %>
<img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Available to Chat"> <img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Available to Chat">
Available to Chat <%= statusTxt %> Available to Chat <%= statusTxt %>
<% <%
} else if (show == Presence.SHOW_DND) { } else if (show == Presence.Show.dnd) {
%> %>
<img src="images/bullet-red-14x14.gif" width="14" height="14" border="0" title="Do not Disturb"> <img src="images/bullet-red-14x14.gif" width="14" height="14" border="0" title="Do not Disturb">
Do Not Disturb <%= statusTxt %> Do Not Disturb <%= statusTxt %>
<% <%
} else if (show == Presence.SHOW_NONE) { } else if (show == null) {
%> %>
<img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Online"> <img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Online">
Online <%= statusTxt %> Online <%= statusTxt %>
<% <%
} else if (show == Presence.SHOW_XA) { } else if (show == Presence.Show.xa) {
%> %>
<img src="images/bullet-red-14x14.gif" width="14" height="14" border="0" title="Extended Away"> <img src="images/bullet-red-14x14.gif" width="14" height="14" border="0" title="Extended Away">
......
<%@ page import="org.jivesoftware.messenger.Session, <%@ page import="org.jivesoftware.messenger.Session,
org.jivesoftware.messenger.Presence"%> org.xmpp.packet.Presence"%>
<%-- <%--
- $RCSfile$ - $RCSfile$
- $Revision$ - $Revision$
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<td width="1%" nowrap><%= count %></td> <td width="1%" nowrap><%= count %></td>
<td width="10%" nowrap> <td width="10%" nowrap>
<% String name = sess.getAddress().getName(); %> <% String name = sess.getAddress().getNode(); %>
<a href="session-details.jsp?jid=<%= sess.getAddress() %>" title="Click for more info..." <a href="session-details.jsp?jid=<%= sess.getAddress() %>" title="Click for more info..."
><%= ((name != null && !"".equals(name)) ? name : "<i>Anonymous</i>") %></a> ><%= ((name != null && !"".equals(name)) ? name : "<i>Anonymous</i>") %></a>
...@@ -67,9 +67,9 @@ ...@@ -67,9 +67,9 @@
<% } %> <% } %>
</td> </td>
<% int _show = sess.getPresence().getShow(); <% Presence.Show _show = sess.getPresence().getShow();
String _stat = sess.getPresence().getStatus(); String _stat = sess.getPresence().getStatus();
if (_show == Presence.SHOW_AWAY) { if (_show == Presence.Show.away) {
%> %>
<td width="1%" <td width="1%"
><img src="images/bullet-yellow-14x14.gif" width="14" height="14" border="0" title="Away" ><img src="images/bullet-yellow-14x14.gif" width="14" height="14" border="0" title="Away"
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<% } %> <% } %>
</td> </td>
<% } else if (_show == Presence.SHOW_CHAT) { %> <% } else if (_show == Presence.Show.chat) { %>
<td width="1%" <td width="1%"
><img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Available to Chat" ><img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Available to Chat"
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
Available to Chat Available to Chat
</td> </td>
<% } else if (_show == Presence.SHOW_DND) { %> <% } else if (_show == Presence.Show.dnd) { %>
<td width="1%" <td width="1%"
><img src="images/bullet-red-14x14.gif" width="14" height="14" border="0" title="Do Not Disturb" ><img src="images/bullet-red-14x14.gif" width="14" height="14" border="0" title="Do Not Disturb"
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
<% } %> <% } %>
</td> </td>
<% } else if (_show == Presence.SHOW_NONE) { %> <% } else if (_show == null) { %>
<td width="1%" <td width="1%"
><img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Online" ><img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="Online"
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
Online Online
</td> </td>
<% } else if (_show == Presence.SHOW_XA) { %> <% } else if (_show == Presence.Show.xa) { %>
<td width="1%" <td width="1%"
><img src="images/bullet-yellow-14x14.gif" width="14" height="14" border="0" title="Extended Away" ><img src="images/bullet-yellow-14x14.gif" width="14" height="14" border="0" title="Extended Away"
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
org.jivesoftware.messenger.*, org.jivesoftware.messenger.*,
java.util.Date, java.util.Date,
org.jivesoftware.admin.*, org.jivesoftware.admin.*,
java.text.DateFormat" java.text.DateFormat,
org.xmpp.packet.JID"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
...@@ -37,7 +38,7 @@ ...@@ -37,7 +38,7 @@
// Close a connection if requested // Close a connection if requested
if (close) { if (close) {
XMPPAddress address = XMPPAddress.parseJID(jid); JID address = new JID(jid);
try { try {
Session sess = sessionManager.getSession(address); Session sess = sessionManager.getSession(address);
sess.getConnection().close(); sess.getConnection().close();
......
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