public class LocalIncomingServerSession extends LocalServerSession implements IncomingServerSession
Currently only the Server Dialback method is being used for authenticating the remote server. Once the remote server has been authenticated incoming packets will be processed by this server. It is also possible for remote servers to authenticate more domains once the session has been established. For optimization reasons the existing connection is used between the servers. Therefore, the incoming server session holds the list of authenticated domains which are allowed to send packets to this server.
Using the Server Dialback method it is possible that this server may also act as the Authoritative Server. This implies that an incoming connection will be established with this server for authenticating a domain. This incoming connection will only last for a brief moment and after the domain has been authenticated the connection will be closed and no session will exist.
inboundAllowed, outboundAllowed, usingServerDialback
CHARSET, conn, sessionManager, status, streamManager
MAJOR_VERSION, MINOR_VERSION, STATUS_AUTHENTICATED, STATUS_CLOSED, STATUS_CONNECTED
Constructor and Description |
---|
LocalIncomingServerSession(String serverName,
Connection connection,
StreamID streamID,
String fromDomain) |
Modifier and Type | Method and Description |
---|---|
void |
addValidatedDomain(String domain)
Adds a new validated domain, subdomain or virtual host to the list of
validated domains for the remote server.
|
static LocalIncomingServerSession |
createSession(String serverName,
org.dom4j.io.XMPPPacketReader reader,
SocketConnection connection)
Creates a new session that will receive packets.
|
String |
getAvailableStreamFeatures()
Returns a text with the available stream features.
|
String |
getDefaultIdentity() |
String |
getLocalDomain()
Returns the domain or subdomain of the local server used by the remote server
when validating the session.
|
Collection<String> |
getValidatedDomains()
Returns a collection with all the domains, subdomains and virtual hosts that where
validated.
|
boolean |
isValidDomain(String domain)
Returns true if the specified domain has been validated for this session.
|
void |
removeValidatedDomain(String domain)
Removes the previously validated domain from the list of validated domains.
|
void |
setLocalDomain(String domain)
Sets the domain or subdomain of the local server used by the remote server when asking
to validate the session.
|
void |
tlsAuth() |
boolean |
validateSubsequentDomain(org.dom4j.Element dbResult)
Returns true if the request of a new domain was valid.
|
void |
verifyReceivedKey(org.dom4j.Element doc)
Verifies the received key sent by the remote server.
|
isUsingServerDialback
close, decodeVersion, deliverRawText, getAddress, getCipherSuiteName, getConnection, getCreationDate, getHostAddress, getHostName, getLanguage, getLastActiveDate, getNumClientPackets, getNumServerPackets, getPeerCertificates, getServerName, getSessionData, getStatus, getStreamID, getStreamManager, incrementClientPacketCount, incrementServerPacketCount, isClosed, isSecure, isUsingSelfSignedCertificate, process, removeSessionData, setAddress, setSessionData, setStatus, toString, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isUsingServerDialback
close, deliverRawText, getAddress, getCipherSuiteName, getCreationDate, getHostAddress, getHostName, getLanguage, getLastActiveDate, getNumClientPackets, getNumServerPackets, getPeerCertificates, getServerName, getStatus, getStreamID, isClosed, isSecure, process, validate
public LocalIncomingServerSession(String serverName, Connection connection, StreamID streamID, String fromDomain)
public static LocalIncomingServerSession createSession(String serverName, org.dom4j.io.XMPPPacketReader reader, SocketConnection connection) throws org.xmlpull.v1.XmlPullParserException, IOException
serverName
- hostname of this server.reader
- reader on the new established connection with the remote server.connection
- the new established connection with the remote server.org.xmlpull.v1.XmlPullParserException
- if an error occurs while parsing the XML.IOException
- if an input/output error occurs while using the connection.public String getDefaultIdentity()
public boolean validateSubsequentDomain(org.dom4j.Element dbResult)
For optimization reasons, the same session may be servicing several domains of a remote server.
dbResult
- the DOM stanza requesting the domain validation.public boolean isValidDomain(String domain)
In the spirit of being flexible we allow remote servers to not register subdomains and even so consider subdomains that include the server domain in their domain part as valid domains.
domain
- the domain to validate.public Collection<String> getValidatedDomains()
getValidatedDomains
in interface IncomingServerSession
public void addValidatedDomain(String domain)
domain
- the new validated domain, subdomain or virtual host to add.public void removeValidatedDomain(String domain)
domain
- the domain, subdomain or virtual host to remove from the list of
validated domains.public String getLocalDomain()
getLocalDomain
in interface IncomingServerSession
public void setLocalDomain(String domain)
domain
- the domain or subdomain of the local server used when validating the
session.public void verifyReceivedKey(org.dom4j.Element doc)
doc
- the received Element that contains the key to verify.public String getAvailableStreamFeatures()
LocalSession
getAvailableStreamFeatures
in class LocalServerSession
public void tlsAuth()
Copyright © 2003-2008 Jive Software.