1 11 12 package org.jivesoftware.messenger.net; 13 14 import org.dom4j.Element; 15 import org.jivesoftware.messenger.component.ComponentSession; 16 import org.jivesoftware.messenger.PacketRouter; 17 import org.jivesoftware.messenger.auth.UnauthorizedException; 18 import org.xmlpull.v1.XmlPullParserException; 19 20 import java.io.IOException ; 21 import java.net.Socket ; 22 23 29 public class ComponentSocketReader extends SocketReader { 30 31 public ComponentSocketReader(PacketRouter router, String serverName, Socket socket, 32 SocketConnection connection) { 33 super(router, serverName, socket, connection); 34 } 35 36 43 protected boolean processUnknowPacket(Element doc) { 44 return false; 45 } 46 47 boolean createSession(String namespace) throws UnauthorizedException, XmlPullParserException, 48 IOException { 49 if ("jabber:component:accept".equals(namespace)) { 50 session = ComponentSession.createSession(serverName, reader, connection); 52 return true; 53 } 54 return false; 55 } 56 } 57 | Popular Tags |