Search in sources :

Example 6 with ServerDialback

use of org.jivesoftware.openfire.server.ServerDialback in project Openfire by igniterealtime.

the class LocalIncomingServerSession method validateSubsequentDomain.

/**
 * Returns true if the request of a new domain was valid. Sessions may receive subsequent
 * domain validation request. If the validation of the new domain fails then the session and
 * the underlying TCP connection will be closed.<p>
 *
 * For optimization reasons, the same session may be servicing several domains of a
 * remote server.
 *
 * @param dbResult the DOM stanza requesting the domain validation.
 * @return true if the requested domain was valid.
 */
public boolean validateSubsequentDomain(Element dbResult) {
    final DomainPair domainPair = new DomainPair(getServerName(), fromDomain);
    ServerDialback method = new ServerDialback(getConnection(), domainPair);
    if (method.validateRemoteDomain(dbResult, getStreamID())) {
        // Add the validated domain as a valid domain
        addValidatedDomain(dbResult.attributeValue("from"));
        return true;
    }
    return false;
}
Also used : ServerDialback(org.jivesoftware.openfire.server.ServerDialback)

Aggregations

ServerDialback (org.jivesoftware.openfire.server.ServerDialback)6 OutgoingServerSocketReader (org.jivesoftware.openfire.server.OutgoingServerSocketReader)4 BasicStreamIDFactory (org.jivesoftware.openfire.spi.BasicStreamIDFactory)4 Logger (org.slf4j.Logger)4 IOException (java.io.IOException)2 InputStreamReader (java.io.InputStreamReader)2 Socket (java.net.Socket)2 SSLHandshakeException (javax.net.ssl.SSLHandshakeException)2 DocumentException (org.dom4j.DocumentException)2 Element (org.dom4j.Element)2 XMPPPacketReader (org.dom4j.io.XMPPPacketReader)2 StreamID (org.jivesoftware.openfire.StreamID)2 UnauthorizedException (org.jivesoftware.openfire.auth.UnauthorizedException)2 XmlPullParser (org.xmlpull.v1.XmlPullParser)2 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)2 JID (org.xmpp.packet.JID)2 InputStream (java.io.InputStream)1 SocketAddress (java.net.SocketAddress)1 Map (java.util.Map)1 SSLException (javax.net.ssl.SSLException)1