// Do nothing if the target domain is empty, null or contains whitespaces
log.warn("Unable to authenticate: remote domain is invalid.");
returnfalse;
}
try{
// Check if the remote domain is in the blacklist
if(!RemoteServerManager.canAccess(remoteDomain)){
log.info("Unable to authenticate: Remote domain is not accessible according to our configuration (typical causes: server federation is disabled, or domain is blacklisted).");
returnfalse;
}
log.debug("Searching for pre-existing outgoing sessions to the remote domain (if one exists, it will be re-used) ...");
// Server is shutting down while we are trying to create a new s2s connection
log.warn("Unable to authenticate: a SessionManager instance is not available. This should not occur unless Openfire is starting up or shutting down.");
log.debug("There are no pre-existing outgoing sessions to the remote domain itself. Searching for pre-existing outgoing sessions to super- or subdomains of the remote domain (if one exists, it might be re-usable) ...");
log.debug("An outgoing session to a different domain ('{}') hosted on the remote domain was found.",otherRemoteDomain);
// As this sub/superdomain is different from the original remote domain, we need to check if it supports dialback.
if(session.isUsingServerDialback())
{
log.debug("Dialback was used for '{}'. This session can be re-used.",otherRemoteDomain);
break;
}
else
{
log.debug("Dialback was not used for '{}'. This session cannot be re-used.",otherRemoteDomain);
session=null;
}
}
}
}
if(session==null){
log.debug("There are no pre-existing session to other domains hosted on the remote domain.");
}
}
if(session!=null)
{
log.debug("A pre-existing session can be re-used. The session was established using server dialback so it is possible to do piggybacking to authenticate more domains.");
if(outgoingSession!=null){// TODO this success handler behaves differently from a similar success handler above. Shouldn't those be the same?
log.debug("Successfully created new session (using dialback as a fallback)!");
returnoutgoingSession;
}else{
log.warn("Unable to create a new session: Dialback (as a fallback) failed.");
returnnull;
}
}
else
{
log.warn("Unable to create a new session: exhausted all options (not trying dialback as a fallback, as server dialback is disabled by configuration.");
// Do nothing if the target domain is empty, null or contains whitespaces
log.warn("Unable to authenticate: remote domain is invalid.");
returnfalse;
}
try{
// Check if the remote domain is in the blacklist
if(!RemoteServerManager.canAccess(remoteDomain)){
log.info("Unable to authenticate: Remote domain is not accessible according to our configuration (typical causes: server federation is disabled, or domain is blacklisted).");
returnfalse;
}
log.debug("Searching for pre-existing outgoing sessions to the remote domain (if one exists, it will be re-used) ...");
// Server is shutting down while we are trying to create a new s2s connection
log.warn("Unable to authenticate: a SessionManager instance is not available. This should not occur unless Openfire is starting up or shutting down.");
log.debug("There are no pre-existing outgoing sessions to the remote domain itself. Searching for pre-existing outgoing sessions to super- or subdomains of the remote domain (if one exists, it might be re-usable) ...");
log.debug("An outgoing session to a different domain ('{}') hosted on the remote domain was found.",otherRemoteDomain);
// As this sub/superdomain is different from the original remote domain, we need to check if it supports dialback.
if(session.isUsingServerDialback())
{
log.debug("Dialback was used for '{}'. This session can be re-used.",otherRemoteDomain);
break;
}
else
{
log.debug("Dialback was not used for '{}'. This session cannot be re-used.",otherRemoteDomain);
session=null;
}
}
}
}
if(session==null){
log.debug("There are no pre-existing session to other domains hosted on the remote domain.");
}
}
if(session!=null)
{
log.debug("A pre-existing session can be re-used. The session was established using server dialback so it is possible to do piggybacking to authenticate more domains.");
if(outgoingSession!=null){// TODO this success handler behaves differently from a similar success handler above. Shouldn't those be the same?
log.debug("Successfully created new session (using dialback as a fallback)!");
returnoutgoingSession;
}else{
log.warn("Unable to create a new session: Dialback (as a fallback) failed.");
returnnull;
}
}
else
{
log.warn("Unable to create a new session: exhausted all options (not trying dialback as a fallback, as server dialback is disabled by configuration.");