Commit 7431bf0a authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Modified IQHandlerInfo constructor to remove unused variable.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@89 b35dd754-fafc-0310-a699-88a17e54d16e
parent f5cf8d5d
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
*/ */
package org.jivesoftware.messenger; package org.jivesoftware.messenger;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
/** /**
* <p>A simple meta-data class that stores several related tools for * <p>A simple meta-data class that stores several related tools for
* generic IQ protocol handling.</p> * generic IQ protocol handling.</p>
...@@ -36,20 +33,16 @@ public class IQHandlerInfo { ...@@ -36,20 +33,16 @@ public class IQHandlerInfo {
private String name; private String name;
private String namespace; private String namespace;
private Class iq;
/** /**
* <p>Construct an info object.</p> * <p>Construct an info object.</p>
* <p>Note: the IQ child class must have a public, no-arg constructor.</p>
* *
* @param name The name of the root iq element * @param name The name of the root iq element
* @param namespace The namespace of the root iq element * @param namespace The namespace of the root iq element
* @param iq The class of IQ packet to use in parsing
*/ */
public IQHandlerInfo(String name, String namespace, Class iq) { public IQHandlerInfo(String name, String namespace) {
this.name = name; this.name = name;
this.namespace = namespace; this.namespace = namespace;
this.iq = iq;
} }
/** /**
...@@ -69,24 +62,4 @@ public class IQHandlerInfo { ...@@ -69,24 +62,4 @@ public class IQHandlerInfo {
public String getNamespace() { public String getNamespace() {
return namespace; return namespace;
} }
/**
* <p>Obtain the name of the root iq element for this packet type.</p>
*
* @return the name of the root iq element.
*/
/*public IQ parse(XMLStreamReader xpp) throws XMLStreamException {
IQ packet = null;
try {
packet = (IQ)iq.newInstance();
packet.parse(xpp);
}
catch (InstantiationException e) {
throw new XMLStreamException(e.getMessage());
}
catch (IllegalAccessException e) {
throw new XMLStreamException(e.getMessage());
}
return packet;
}*/
} }
...@@ -14,7 +14,6 @@ import org.jivesoftware.messenger.container.TrackInfo; ...@@ -14,7 +14,6 @@ import org.jivesoftware.messenger.container.TrackInfo;
import org.jivesoftware.messenger.forms.XDataForm; import org.jivesoftware.messenger.forms.XDataForm;
import org.jivesoftware.messenger.*; import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.UnauthorizedException; import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.spi.IQImpl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
...@@ -51,7 +50,7 @@ public class IQDiscoInfoHandler extends IQDiscoHandler { ...@@ -51,7 +50,7 @@ public class IQDiscoInfoHandler extends IQDiscoHandler {
public IQDiscoInfoHandler() { public IQDiscoInfoHandler() {
super("XMPP Disco Info Handler"); super("XMPP Disco Info Handler");
info = new IQHandlerInfo("query", "http://jabber.org/protocol/disco#info", IQImpl.class); info = new IQHandlerInfo("query", "http://jabber.org/protocol/disco#info");
serverFeatures.add("http://jabber.org/protocol/disco#info"); serverFeatures.add("http://jabber.org/protocol/disco#info");
} }
......
...@@ -13,7 +13,6 @@ package org.jivesoftware.messenger.disco; ...@@ -13,7 +13,6 @@ package org.jivesoftware.messenger.disco;
import org.jivesoftware.messenger.container.TrackInfo; import org.jivesoftware.messenger.container.TrackInfo;
import org.jivesoftware.messenger.*; import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.UnauthorizedException; import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.spi.IQImpl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
...@@ -53,7 +52,7 @@ public class IQDiscoItemsHandler extends IQDiscoHandler implements ServerFeature ...@@ -53,7 +52,7 @@ public class IQDiscoItemsHandler extends IQDiscoHandler implements ServerFeature
public IQDiscoItemsHandler() { public IQDiscoItemsHandler() {
super("XMPP Disco Items Handler"); super("XMPP Disco Items Handler");
info = new IQHandlerInfo("query", "http://jabber.org/protocol/disco#items", IQImpl.class); info = new IQHandlerInfo("query", "http://jabber.org/protocol/disco#items");
} }
public IQHandlerInfo getInfo() { public IQHandlerInfo getInfo() {
......
...@@ -17,7 +17,6 @@ import org.jivesoftware.messenger.IQ; ...@@ -17,7 +17,6 @@ import org.jivesoftware.messenger.IQ;
import org.jivesoftware.messenger.IQHandlerInfo; import org.jivesoftware.messenger.IQHandlerInfo;
import org.jivesoftware.messenger.PayloadFragment; import org.jivesoftware.messenger.PayloadFragment;
import org.jivesoftware.messenger.XMPPDOMFragment; import org.jivesoftware.messenger.XMPPDOMFragment;
import org.jivesoftware.messenger.spi.IQImpl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
...@@ -57,7 +56,7 @@ public class IQAgentsHandler extends IQHandler implements ServerFeaturesProvider ...@@ -57,7 +56,7 @@ public class IQAgentsHandler extends IQHandler implements ServerFeaturesProvider
public IQAgentsHandler() { public IQAgentsHandler() {
super("XMPP WorkgroupAgent handler"); super("XMPP WorkgroupAgent handler");
info = new IQHandlerInfo("query", "jabber:iq:agents", IQImpl.class); info = new IQHandlerInfo("query", "jabber:iq:agents");
} }
public IQ handleIQ(IQ packet) { public IQ handleIQ(IQ packet) {
......
...@@ -17,7 +17,6 @@ import org.jivesoftware.messenger.*; ...@@ -17,7 +17,6 @@ import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.AuthFactory; import org.jivesoftware.messenger.auth.AuthFactory;
import org.jivesoftware.messenger.auth.AuthToken; import org.jivesoftware.messenger.auth.AuthToken;
import org.jivesoftware.messenger.auth.UnauthorizedException; import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.spi.IQImpl;
import org.jivesoftware.messenger.user.UserManager; import org.jivesoftware.messenger.user.UserManager;
import org.jivesoftware.messenger.user.UserNotFoundException; import org.jivesoftware.messenger.user.UserNotFoundException;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -62,7 +61,7 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo { ...@@ -62,7 +61,7 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
*/ */
public IQAuthHandler() { public IQAuthHandler() {
super("XMPP Authentication handler"); super("XMPP Authentication handler");
info = new IQHandlerInfo("query", "jabber:iq:auth", IQImpl.class); info = new IQHandlerInfo("query", "jabber:iq:auth");
probeResponse = DocumentHelper.createElement(QName.get("query", "jabber:iq:auth")); probeResponse = DocumentHelper.createElement(QName.get("query", "jabber:iq:auth"));
probeResponse.add(DocumentHelper.createElement("username")); probeResponse.add(DocumentHelper.createElement("username"));
......
...@@ -14,7 +14,6 @@ import org.jivesoftware.messenger.container.TrackInfo; ...@@ -14,7 +14,6 @@ import org.jivesoftware.messenger.container.TrackInfo;
import org.jivesoftware.messenger.disco.ServerFeaturesProvider; import org.jivesoftware.messenger.disco.ServerFeaturesProvider;
import org.jivesoftware.messenger.*; import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.UnauthorizedException; import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.spi.IQImpl;
import org.jivesoftware.messenger.user.UserNotFoundException; import org.jivesoftware.messenger.user.UserNotFoundException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
...@@ -53,7 +52,7 @@ public class IQPrivateHandler extends IQHandler implements ServerFeaturesProvide ...@@ -53,7 +52,7 @@ public class IQPrivateHandler extends IQHandler implements ServerFeaturesProvide
public IQPrivateHandler() { public IQPrivateHandler() {
super("XMPP Private Storage Handler"); super("XMPP Private Storage Handler");
info = new IQHandlerInfo("query", "jabber:iq:private", IQImpl.class); info = new IQHandlerInfo("query", "jabber:iq:private");
} }
public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException { public IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException {
......
...@@ -22,7 +22,6 @@ import org.jivesoftware.util.Log; ...@@ -22,7 +22,6 @@ import org.jivesoftware.util.Log;
import org.jivesoftware.messenger.*; import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.Permissions; import org.jivesoftware.messenger.auth.Permissions;
import org.jivesoftware.messenger.auth.UnauthorizedException; import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.spi.IQImpl;
import org.jivesoftware.messenger.spi.PresenceImpl; import org.jivesoftware.messenger.spi.PresenceImpl;
import org.jivesoftware.messenger.user.User; import org.jivesoftware.messenger.user.User;
import org.jivesoftware.messenger.user.UserAlreadyExistsException; import org.jivesoftware.messenger.user.UserAlreadyExistsException;
...@@ -81,7 +80,7 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid ...@@ -81,7 +80,7 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
*/ */
public IQRegisterHandler() { public IQRegisterHandler() {
super("XMPP Registration Handler"); super("XMPP Registration Handler");
info = new IQHandlerInfo("query", "jabber:iq:register", IQImpl.class); info = new IQHandlerInfo("query", "jabber:iq:register");
} }
public void initialize(ModuleContext context, Container container) { public void initialize(ModuleContext context, Container container) {
......
...@@ -17,7 +17,6 @@ import org.jivesoftware.util.Log; ...@@ -17,7 +17,6 @@ import org.jivesoftware.util.Log;
import org.jivesoftware.messenger.*; import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.UnauthorizedException; import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.chatbot.Chatbot; import org.jivesoftware.messenger.chatbot.Chatbot;
import org.jivesoftware.messenger.spi.IQImpl;
import org.jivesoftware.messenger.user.*; import org.jivesoftware.messenger.user.*;
import org.jivesoftware.messenger.user.spi.IQRosterItemImpl; import org.jivesoftware.messenger.user.spi.IQRosterItemImpl;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -61,7 +60,7 @@ public class IQRosterHandler extends IQHandler implements ServerFeaturesProvider ...@@ -61,7 +60,7 @@ public class IQRosterHandler extends IQHandler implements ServerFeaturesProvider
public IQRosterHandler() { public IQRosterHandler() {
super("XMPP Roster Handler"); super("XMPP Roster Handler");
info = new IQHandlerInfo("query", "jabber:iq:roster", IQImpl.class); info = new IQHandlerInfo("query", "jabber:iq:roster");
} }
/** /**
......
...@@ -13,7 +13,6 @@ package org.jivesoftware.messenger.handler; ...@@ -13,7 +13,6 @@ package org.jivesoftware.messenger.handler;
import org.jivesoftware.messenger.disco.ServerFeaturesProvider; import org.jivesoftware.messenger.disco.ServerFeaturesProvider;
import org.jivesoftware.messenger.IQ; import org.jivesoftware.messenger.IQ;
import org.jivesoftware.messenger.IQHandlerInfo; import org.jivesoftware.messenger.IQHandlerInfo;
import org.jivesoftware.messenger.spi.IQImpl;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -50,7 +49,7 @@ public class IQTimeHandler extends IQHandler implements ServerFeaturesProvider { ...@@ -50,7 +49,7 @@ public class IQTimeHandler extends IQHandler implements ServerFeaturesProvider {
public IQTimeHandler() { public IQTimeHandler() {
super("XMPP Server Time Handler"); super("XMPP Server Time Handler");
info = new IQHandlerInfo("query", "jabber:iq:time", IQImpl.class); info = new IQHandlerInfo("query", "jabber:iq:time");
responseElement = DocumentHelper.createElement(QName.get("query", "jabber:iq:time")); responseElement = DocumentHelper.createElement(QName.get("query", "jabber:iq:time"));
responseElement.addElement("utc"); responseElement.addElement("utc");
responseElement.addElement("tz").setText(TIME_FORMAT.getTimeZone().getDisplayName()); responseElement.addElement("tz").setText(TIME_FORMAT.getTimeZone().getDisplayName());
......
...@@ -16,7 +16,6 @@ import org.jivesoftware.messenger.IQ; ...@@ -16,7 +16,6 @@ import org.jivesoftware.messenger.IQ;
import org.jivesoftware.messenger.IQHandlerInfo; import org.jivesoftware.messenger.IQHandlerInfo;
import org.jivesoftware.messenger.PacketException; import org.jivesoftware.messenger.PacketException;
import org.jivesoftware.messenger.XMPPServer; import org.jivesoftware.messenger.XMPPServer;
import org.jivesoftware.messenger.spi.IQImpl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
...@@ -52,7 +51,7 @@ public class IQVersionHandler extends IQHandler implements ServerFeaturesProvide ...@@ -52,7 +51,7 @@ public class IQVersionHandler extends IQHandler implements ServerFeaturesProvide
public IQVersionHandler() { public IQVersionHandler() {
super("XMPP Server Version Handler"); super("XMPP Server Version Handler");
info = new IQHandlerInfo("query", "jabber:iq:version", IQImpl.class); info = new IQHandlerInfo("query", "jabber:iq:version");
if (bodyElement == null) { if (bodyElement == null) {
bodyElement = DocumentHelper.createElement(QName.get("query", "jabber:iq:version")); bodyElement = DocumentHelper.createElement(QName.get("query", "jabber:iq:version"));
bodyElement.addElement("name").setText("Jive Messenger"); bodyElement.addElement("name").setText("Jive Messenger");
......
...@@ -13,7 +13,6 @@ package org.jivesoftware.messenger.handler; ...@@ -13,7 +13,6 @@ package org.jivesoftware.messenger.handler;
import org.jivesoftware.messenger.container.TrackInfo; import org.jivesoftware.messenger.container.TrackInfo;
import org.jivesoftware.messenger.*; import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.UnauthorizedException; import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.spi.IQImpl;
import org.jivesoftware.messenger.user.User; import org.jivesoftware.messenger.user.User;
import org.jivesoftware.messenger.user.UserManager; import org.jivesoftware.messenger.user.UserManager;
import org.jivesoftware.messenger.user.UserNotFoundException; import org.jivesoftware.messenger.user.UserNotFoundException;
...@@ -62,7 +61,7 @@ public class IQvCardHandler extends IQHandler { ...@@ -62,7 +61,7 @@ public class IQvCardHandler extends IQHandler {
public IQvCardHandler() { public IQvCardHandler() {
super("XMPP vCard Handler"); super("XMPP vCard Handler");
info = new IQHandlerInfo("vcard", "vcard-temp", IQImpl.class); info = new IQHandlerInfo("vcard", "vcard-temp");
} }
public synchronized IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException { public synchronized IQ handleIQ(IQ packet) throws UnauthorizedException, PacketException {
......
...@@ -33,7 +33,6 @@ import org.jivesoftware.util.Log; ...@@ -33,7 +33,6 @@ import org.jivesoftware.util.Log;
import org.jivesoftware.messenger.*; import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.UnauthorizedException; import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.handler.IQHandler; import org.jivesoftware.messenger.handler.IQHandler;
import org.jivesoftware.messenger.spi.IQImpl;
/** /**
* This class is not an actual IQHandler since all the packets with namespace * This class is not an actual IQHandler since all the packets with namespace
...@@ -58,7 +57,7 @@ public class IQMUCRegisterHandler extends IQHandler { ...@@ -58,7 +57,7 @@ public class IQMUCRegisterHandler extends IQHandler {
public IQMUCRegisterHandler(MultiUserChatServer mucServer) { public IQMUCRegisterHandler(MultiUserChatServer mucServer) {
super("XMPP MUC Registration Handler"); super("XMPP MUC Registration Handler");
info = new IQHandlerInfo("query", "jabber:iq:register", IQImpl.class); info = new IQHandlerInfo("query", "jabber:iq:register");
this.mucServer = mucServer; this.mucServer = mucServer;
initialize(); initialize();
} }
......
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