예제 #1
0
 boolean createSession(String serverName, String namespace)
     throws UnauthorizedException, XmlPullParserException, IOException {
   if ("jabber:server".equals(namespace)) {
     // The connected client is a server so create an IncomingServerSession
     session = IncomingServerSession.createSession(serverName, reader, connection);
     return true;
   }
   return false;
 }
예제 #2
0
 /**
  * Remote servers may send subsequent db:result packets so we need to process them in order to
  * validate new domains.
  *
  * @param doc the unknown DOM element that was received
  * @return true if the packet is a db:result packet otherwise false.
  */
 protected boolean processUnknowPacket(Element doc) {
   // Handle subsequent db:result packets
   if ("db".equals(doc.getNamespacePrefix()) && "result".equals(doc.getName())) {
     if (!((IncomingServerSession) session).validateSubsequentDomain(doc)) {
       open = false;
     }
     return true;
   } else if ("db".equals(doc.getNamespacePrefix()) && "verify".equals(doc.getName())) {
     // The Receiving Server is reusing an existing connection for sending the
     // Authoritative Server a request for verification of a key
     ((IncomingServerSession) session).verifyReceivedKey(doc);
     return true;
   }
   return false;
 }