Commit 82ff34ca authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Bunch of cleanup type work. Decided to package together all required icons...

Bunch of cleanup type work.  Decided to package together all required icons regardless of if they are available elsewhere.  Added error page, apparantly I do indeed need one too.  Basically some adapting work to IntelliJ 6.0.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5653 b35dd754-fafc-0310-a699-88a17e54d16e
parent 1b064931
......@@ -155,6 +155,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @return list of packets that will be sent back to the message sender.
*/
private List<Packet> processPacket(Message packet) {
Log.debug("Received message packet: "+packet.toXML());
List<Packet> reply = new ArrayList<Packet>();
JID from = packet.getFrom();
JID to = packet.getTo();
......@@ -195,6 +196,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @return list of packets that will be sent back to the presence requester.
*/
private List<Packet> processPacket(Presence packet) {
Log.debug("Received presence packet: "+packet.toXML());
List<Packet> reply = new ArrayList<Packet>();
JID from = packet.getFrom();
JID to = packet.getTo();
......@@ -359,6 +361,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @return list of packets that will be sent back to the IQ requester.
*/
private List<Packet> processPacket(IQ packet) {
Log.debug("Received iq packet: "+packet.toXML());
List<Packet> reply = new ArrayList<Packet>();
if (packet.getType() == IQ.Type.error) {
......@@ -834,35 +837,35 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
}
/**
* Returns the type of the transport.
* @return the type of the transport.
*/
public TransportType getType() {
return transportType;
}
/**
* Returns the description of the transport.
* @return the description of the transport.
*/
public String getDescription() {
return description;
}
/**
* Returns the component manager of the transport.
* @return the component manager of the transport.
*/
public ComponentManager getComponentManager() {
return componentManager;
}
/**
* Returns the registration manager of the transport.
* @return the registration manager of the transport.
*/
public RegistrationManager getRegistrationManager() {
return registrationManager;
}
/**
* Returns the session manager of the transport.
* @return the session manager of the transport.
*/
public TransportSessionManager getSessionManager() {
return sessionManager;
......@@ -874,7 +877,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
private String versionString = null;
/**
* Returns the version string of the gateway.
* @return the version string of the gateway.
*/
public String getVersionString() {
if (versionString == null) {
......@@ -1280,6 +1283,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @param packet Packet to be sent.
*/
public void sendPacket(Packet packet) {
Log.debug("Sending packet: "+packet.toXML());
try {
this.componentManager.sendPacket(this, packet);
}
......@@ -1294,6 +1298,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @see org.jivesoftware.wildfire.roster.RosterEventListener#addingContact(org.jivesoftware.wildfire.roster.Roster, org.jivesoftware.wildfire.roster.RosterItem, boolean)
*/
public boolean addingContact(Roster roster, RosterItem item, boolean persistent) {
Log.debug("addingContact "+roster.getUsername()+":"+item.getJid()+" is "+persistent);
if (item.getJid().getDomain().equals(this.getJID()) && item.getJid().getNode() != null) {
return false;
}
......@@ -1306,6 +1311,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @see org.jivesoftware.wildfire.roster.RosterEventListener#contactUpdated(org.jivesoftware.wildfire.roster.Roster, org.jivesoftware.wildfire.roster.RosterItem)
*/
public void contactUpdated(Roster roster, RosterItem item) {
Log.debug("contactUpdated "+roster.getUsername()+":"+item.getJid());
if (!item.getJid().getDomain().equals(this.getJID().getDomain())) {
// Not ours, not our problem.
return;
......@@ -1329,10 +1335,15 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @see org.jivesoftware.wildfire.roster.RosterEventListener#contactAdded(org.jivesoftware.wildfire.roster.Roster, org.jivesoftware.wildfire.roster.RosterItem)
*/
public void contactAdded(Roster roster, RosterItem item) {
Log.debug("contactAdded "+roster.getUsername()+":"+item.getJid());
if (!item.getJid().getDomain().equals(this.getJID().getDomain())) {
// Not ours, not our problem.
return;
}
if (item.getJid().getNode() == null) {
// Gateway itself, don't care.
return;
}
try {
TransportSession session = sessionManager.getSession(roster.getUsername());
session.addContact(item);
......@@ -1348,10 +1359,15 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @see org.jivesoftware.wildfire.roster.RosterEventListener#contactDeleted(org.jivesoftware.wildfire.roster.Roster, org.jivesoftware.wildfire.roster.RosterItem)
*/
public void contactDeleted(Roster roster, RosterItem item) {
Log.debug("contactDeleted "+roster.getUsername()+":"+item.getJid());
// if (!item.getJid().getDomain().equals(this.getJID().getDomain())) {
// // Not ours, not our problem.
// return;
// }
// if (item.getJid().getNode() == null) {
// // TODO: The gateway itself was removed?
// return;
// }
// try {
// TransportSession session = sessionManager.getSession(roster.getUsername());
// session.removeContact(item);
......@@ -1367,8 +1383,9 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @see org.jivesoftware.wildfire.roster.RosterEventListener#rosterLoaded(org.jivesoftware.wildfire.roster.Roster)
*/
public void rosterLoaded(Roster roster) {
Log.debug("rosterLoaded "+roster.getUsername());
// Don't care
// TODO: Evaluate if we could use this.
// TODO: Evaluate if we could use this, maybe an opportunity to clean up.
}
/**
......@@ -1377,7 +1394,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @see org.jivesoftware.wildfire.user.PresenceEventListener#availableSession(org.jivesoftware.wildfire.ClientSession, org.xmpp.packet.Presence)
*/
public void availableSession(ClientSession session, Presence presence) {
Log.debug("availableSession "+session+":"+presence);
}
/**
......@@ -1386,6 +1403,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @see org.jivesoftware.wildfire.user.PresenceEventListener#unavailableSession(org.jivesoftware.wildfire.ClientSession, org.xmpp.packet.Presence)
*/
public void unavailableSession(ClientSession session, Presence presence) {
Log.debug("unavailableSession "+session+":"+presence);
}
......@@ -1395,7 +1413,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @see org.jivesoftware.wildfire.user.PresenceEventListener#presencePriorityChanged(org.jivesoftware.wildfire.ClientSession, org.xmpp.packet.Presence)
*/
public void presencePriorityChanged(ClientSession session, Presence presence) {
Log.debug("presencePriorityChanged "+session+":"+presence);
}
/**
......@@ -1404,7 +1422,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @see org.jivesoftware.wildfire.user.PresenceEventListener#presenceChanged(org.jivesoftware.wildfire.ClientSession, org.xmpp.packet.Presence)
*/
public void presenceChanged(ClientSession session, Presence presence) {
Log.debug("presenceChanged "+session+":"+presence);
}
/**
......@@ -1414,6 +1432,7 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* @param jid JID that is logged into the transport.
* @param presenceType Type of presence.
* @param verboseStatus Longer status description.
* @param priority Priority of the session (from presence packet).
* @return A session instance for the new login.
*/
public abstract TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority);
......@@ -1454,21 +1473,30 @@ public abstract class BaseTransport implements Component, RosterEventListener, P
* You would write this out as if the entry textfields for the username and password
* are after it/on the same page. So something along these lines would be good:
* Please enter your legacy username and password.
*
* @return String phrase for registration.
*/
public abstract String getTerminologyRegistration();
/**
* Returns true or false whether the password is required.
* Is a password required for this service?
*
* @return True or false whether the password is required.
*/
public abstract Boolean isPasswordRequired();
/**
* Returns true or false whether the nickname is required.
* Is a nickname required for this service?
*
* @return True or false whether the nickname is required.
*/
public abstract Boolean isNicknameRequired();
/**
* Returns true or false whether the passed username is valud for the service.
* Is the specified username valid?
*
* @param username Username to validate.
* @return True or false whether the passed username is valud for the service.
*/
public abstract Boolean isUsernameValid(String username);
......
......@@ -95,6 +95,8 @@ public class GatewayPlugin implements Plugin {
/**
* Starts a transport service, identified by subdomain. The transport
* service will only start if it is enabled.
*
* @param serviceName name of service to start.
*/
private void maybeStartService(String serviceName) {
TransportInstance trInstance = transports.get(serviceName);
......@@ -103,6 +105,8 @@ public class GatewayPlugin implements Plugin {
/**
* Enables a transport service, identified by subdomain.
*
* @param serviceName name of service to enable.
*/
public void enableService(String serviceName) {
TransportInstance trInstance = transports.get(serviceName);
......@@ -111,6 +115,8 @@ public class GatewayPlugin implements Plugin {
/**
* Disables a transport service, identified by subdomain.
*
* @param serviceName name of service to disable.
*/
public void disableService(String serviceName) {
TransportInstance trInstance = transports.get(serviceName);
......@@ -119,6 +125,9 @@ public class GatewayPlugin implements Plugin {
/**
* Returns the state of a transport service, identified by subdomain.
*
* @param serviceName name of service to check.
* @return True of false if service is enabled.
*/
public Boolean serviceEnabled(String serviceName) {
TransportInstance trInstance = transports.get(serviceName);
......@@ -127,6 +136,9 @@ public class GatewayPlugin implements Plugin {
/**
* Returns the transport instance, identified by subdomain.
*
* @param serviceName name of service to get instance of.
* @return Instance of service requested.
*/
public TransportInstance getTransportInstance(String serviceName) {
return transports.get(serviceName);
......
......@@ -218,6 +218,8 @@ public class PseudoRosterItem {
/**
* Inserts a new roster item into the database.
*
* @throws SQLException if the SQL statement is wrong for whatever reason.
*/
private void insertIntoDb() throws SQLException {
Connection con = null;
......@@ -253,6 +255,8 @@ public class PseudoRosterItem {
/**
* Removeds a roster item from the database.
*
* @throws SQLException if the SQL statement is wrong for whatever reason.
*/
private void removeFromDb() throws SQLException {
Connection con = null;
......
......@@ -61,6 +61,7 @@ public class PseudoRosterManager {
* @param jid To retrieve the roster for.
* @param type TransportType the roster is for.
* @return A Pseudo roster
* @throws UserNotFoundException if the user is not actually registered.
*/
public PseudoRoster getPseudoRoster(JID jid, TransportType type) throws UserNotFoundException {
Collection<Registration> registrations = registrationManager.getRegistrations(jid, type);
......@@ -76,6 +77,7 @@ public class PseudoRosterManager {
* Removes a pseudo roster entirely.
*
* @param registrationID ID to be removed.
* @throws SQLException if the SQL statement is wrong for whatever reason.
*/
public void removePseudoRoster(Long registrationID) throws SQLException {
Connection con = null;
......
......@@ -65,6 +65,7 @@ public class Registration {
* @param transportType the type of the transport.
* @param username the username on the transport.
* @param password the password on the transport.
* @param nickname the nickname on the transport.
*/
public Registration(JID jid, TransportType transportType, String username, String password, String nickname) {
if (jid == null || transportType == null || username == null) {
......@@ -154,7 +155,8 @@ public class Registration {
/**
* Sets the password used for logging in to the transport.
* @param password
*
* @param password new password for registration.
*/
public void setPassword(String password) {
this.password = password;
......@@ -184,7 +186,8 @@ public class Registration {
/**
* Sets the username used for logging in to the transport.
* @param username
*
* @param username New username for transport registration.
*/
public void setUsername(String username) {
if (username == null) {
......@@ -210,7 +213,8 @@ public class Registration {
/**
* Sets the nickname used for logging in to the transport.
* @param nickname
*
* @param nickname New nickname for transport registration.
*/
public void setNickname(String nickname) {
this.nickname = nickname;
......@@ -285,6 +289,8 @@ public class Registration {
/**
* Inserts a new registration into the database.
*
* @throws SQLException if the SQL statement is wrong for whatever reason.
*/
private void insertIntoDb() throws SQLException {
this.registrationID = SequenceManager.nextID(this);
......
......@@ -51,6 +51,8 @@ public class TransportBuddy {
/**
* Retrieves the name of the contact.
*
* @return Name of contact.
*/
public String getName() {
return contactname;
......@@ -58,6 +60,8 @@ public class TransportBuddy {
/**
* Retrieves the nickname of the contact.
*
* @return Nickname of contact.
*/
public String getNickname() {
return nickname;
......@@ -65,6 +69,8 @@ public class TransportBuddy {
/**
* Retrieves the group of the contact.
*
* @return Group contact is in.
*/
public String getGroup() {
return group;
......
......@@ -163,6 +163,8 @@ public class TransportInstance implements PropertyEventListener {
/**
* Retrieves actual transport associated with this instance.
*
* @return Transport that the instance is associated with.
*/
public BaseTransport getTransport() {
return transport;
......
......@@ -89,6 +89,9 @@ public abstract class TransportSession implements Runnable {
/**
* Associates a resource with the session, and tracks it's priority.
*
* @param resource Resource string
* @param priority Priority of resource
*/
public void addResource(String resource, Integer priority) {
resources.put(priority, resource);
......@@ -96,6 +99,8 @@ public abstract class TransportSession implements Runnable {
/**
* Removes an association of a resource with the session.
*
* @param resource Resource string
*/
public void removeResource(String resource) {
for (Integer i : resources.keySet()) {
......@@ -228,6 +233,8 @@ public abstract class TransportSession implements Runnable {
/**
* Updates the login status.
*
* @param status New login status.
*/
public void setLoginStatus(TransportLoginStatus status) {
loginStatus = status;
......@@ -235,6 +242,8 @@ public abstract class TransportSession implements Runnable {
/**
* Retrieves the current login status.
*
* @return Login status of session.
*/
public TransportLoginStatus getLoginStatus() {
return loginStatus;
......@@ -242,6 +251,8 @@ public abstract class TransportSession implements Runnable {
/**
* Returns true only if we are completely logged in.
*
* @return True or false whether we are currently completely logged in.
*/
public Boolean isLoggedIn() {
return (loginStatus == TransportLoginStatus.LOGGED_IN);
......
......@@ -55,6 +55,8 @@ public class TransportSessionManager {
/**
* Creates the transport session manager instance and initializes.
*
* @param transport Transport associated with this session manager.
*/
TransportSessionManager(BaseTransport transport) {
this.transport = transport;
......
......@@ -61,6 +61,8 @@ public class IRCListener implements IRCEventListener {
/**
* Retrieves the session this listener is associated with.
*
* @return The session the listener is associated with.
*/
public IRCSession getSession() {
return session;
......
......@@ -113,6 +113,8 @@ public class IRCSession extends TransportSession {
/**
* Retrieves the buddy status list.
*
* @return Hash of buddies mapped to presence type.
*/
public ConcurrentHashMap<String, PresenceType> getBuddyStatuses() {
return buddyStatuses;
......@@ -122,6 +124,7 @@ public class IRCSession extends TransportSession {
* Gets the current presence status of a buddy.
*
* @param username Username to look up.
* @return Presence type of a particular buddy.
*/
public PresenceType getBuddyStatus(String username) {
return buddyStatuses.get(username);
......@@ -148,7 +151,7 @@ public class IRCSession extends TransportSession {
}
/**
* Returns the IRC connection associated with this session.
* @return the IRC connection associated with this session.
*/
public IRCConnection getConnection() {
return conn;
......
......@@ -106,6 +106,7 @@ public class IRCTransport extends BaseTransport {
*
* @param jabStatus Jabber presence type.
* @param verboseStatus Verbose status information.
* @return IRC status string.
*/
public String convertJabStatusToIRC(PresenceType jabStatus, String verboseStatus) {
if (jabStatus == PresenceType.available) {
......
......@@ -61,6 +61,9 @@ public class MSNListener extends MsnAdapter {
/**
* Handles incoming system messages from MSN.
*
* @param switchboard Switchboard session the message is associated with.
* @param message MSN message.
*/
public void systemMessageReceived(MsnSwitchboard switchboard, MsnInstantMessage message) {
Message m = new Message();
......
......@@ -97,6 +97,8 @@ public class MSNSession extends TransportSession {
/**
* Retrieves the manager for this session.
*
* @return Messenger instance the session is associated with.
*/
public MsnMessenger getManager() {
return msnMessenger;
......@@ -104,6 +106,8 @@ public class MSNSession extends TransportSession {
/**
* Records information about a person on the user's contact list.
*
* @param msnContact MSN contact we are storing a copy of.
*/
public void storeFriend(MsnContact msnContact) {
msnContacts.put(msnContact.getEmail().toString(), msnContact);
......@@ -111,6 +115,8 @@ public class MSNSession extends TransportSession {
/**
* Records information about a group on the user's contact list.
*
* @param msnGroup MSN group we are storing a copy of.
*/
public void storeGroup(MsnGroup msnGroup) {
msnGroups.put(msnGroup.getGroupName(), msnGroup);
......
......@@ -107,6 +107,7 @@ public class MSNTransport extends BaseTransport {
* Converts a jabber status to an MSN status.
*
* @param jabStatus Jabber presence type.
* @return MSN user status id.
*/
public MsnUserStatus convertJabStatusToMSN(PresenceType jabStatus) {
if (jabStatus == PresenceType.available) {
......@@ -136,6 +137,7 @@ public class MSNTransport extends BaseTransport {
* Sets up a presence packet according to MSN status.
*
* @param msnStatus MSN ContactStatus constant.
* @param packet Presence packet to set up.
*/
public void setUpPresencePacket(Presence packet, MsnUserStatus msnStatus) {
if (msnStatus.equals(MsnUserStatus.ONLINE)) {
......
......@@ -49,7 +49,7 @@ public class SnacManager {
if (handlers == null) {
handlers = new LinkedList<BasicFlapConnection>();
conns.put((Integer)familyCode, handlers);
conns.put(familyCode, handlers);
}
if (!handlers.contains(conn)) {
......
......@@ -107,6 +107,7 @@ public class YahooTransport extends BaseTransport {
* Converts a jabber status to an Yahoo status.
*
* @param jabStatus Jabber presence type.
* @return Yahoo status identifier.
*/
public long convertJabStatusToYahoo(PresenceType jabStatus) {
if (jabStatus == PresenceType.available) {
......@@ -135,6 +136,7 @@ public class YahooTransport extends BaseTransport {
/**
* Sets up a presence packet according to Yahoo status.
*
* @param packet Presence packet to be set up.
* @param yahooStatus Yahoo StatusConstants constant.
*/
public void setUpPresencePacket(Presence packet, long yahooStatus) {
......
<%@ page import="java.io.*,
org.jivesoftware.util.JiveGlobals,
org.jivesoftware.wildfire.auth.UnauthorizedException"
isErrorPage="true"
%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<% boolean debug = "true".equals(JiveGlobals.getProperty("skin.default.debug"));
if (debug) {
exception.printStackTrace();
}
%>
<% if (exception instanceof UnauthorizedException) { %>
<p>
<fmt:message key="error.admin_privileges" />
</p>
<% } %>
<% if (exception != null) {
StringWriter sout = new StringWriter();
PrintWriter pout = new PrintWriter(sout);
exception.printStackTrace(pout);
%>
<fmt:message key="error.exception" />
<pre>
<%= sout.toString() %>
</pre>
<% } %>
\ No newline at end of file
......@@ -263,7 +263,7 @@
<div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td class="jive-icon"><img src="/images/success-16x16.gif" width="16"
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16"
height="16" border="0" alt=""></td>
<td class="jive-icon-label">
<fmt:message key="gateway.web.registrations.regsuccess" />
......@@ -280,7 +280,7 @@
<div class="jive-error">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td class="jive-icon"><img src="/images/error-16x16.gif" width="16"
<tr><td class="jive-icon"><img src="images/error-16x16.gif" width="16"
height="16" border="0" alt=""></td>
<td class="jive-icon-label">
<fmt:message key="gateway.web.registrations.regfailure" />
......@@ -467,8 +467,8 @@
<td><%= result.jid %></td>
<td><span class="jive-gateway-<%= result.linestatus %> jive-gateway-<%= result.type.toUpperCase() %><%= ((result.sessionActive) ? "on" : "off") %>"><%= result.username %></span></td>
<td><%= result.lastLogin %></td>
<td align="center"><a href="" onClick="toggleEdit(<%= result.id %>); return false"><img src="/images/edit-16x16.gif" alt="" border="0"></a></td>
<td align="center"><form method="post" id="deleteRegistration<%= result.id %>" name="deleteRegistration<%= result.id %>" action="gateway-registrations.jsp"><input type="hidden" name="action" value="delete" /><input type="hidden" name="deleteid" value="<%= result.id %>" /><a href="" onClick="if (confirm('<fmt:message key="gateway.web.registrations.confirmdelete" />')) { document.getElementById('deleteRegistration<%= result.id %>').submit(); return false; } else { return false; }"><img src="/images/delete-16x16.gif" alt="" border="0"></a></form></td>
<td align="center"><a href="" onClick="toggleEdit(<%= result.id %>); return false"><img src="images/edit-16x16.gif" alt="" border="0"></a></td>
<td align="center"><form method="post" id="deleteRegistration<%= result.id %>" name="deleteRegistration<%= result.id %>" action="gateway-registrations.jsp"><input type="hidden" name="action" value="delete" /><input type="hidden" name="deleteid" value="<%= result.id %>" /><a href="" onClick="if (confirm('<fmt:message key="gateway.web.registrations.confirmdelete" />')) { document.getElementById('deleteRegistration<%= result.id %>').submit(); return false; } else { return false; }"><img src="images/delete-16x16.gif" alt="" border="0"></a></form></td>
</tr>
<tr id="jiveRegistrationEdit<%= result.id %>" style="display: none;">
<td align="center"><img src="images/im_<%= result.status %>.gif" alt="<%= result.status %>" border="0"></td>
......
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