|
Openfire 3.4.3 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.session.LocalSession org.jivesoftware.openfire.session.LocalIncomingServerSession
public class LocalIncomingServerSession
Server-to-server communication is done using two TCP connections between the servers. One connection is used for sending packets while the other connection is used for receiving packets. The IncomingServerSession represents the connection to a remote server that will only be used for receiving packets.
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.
Field Summary |
---|
Fields inherited from class org.jivesoftware.openfire.session.LocalSession |
---|
CHARSET, conn, sessionManager, status |
Fields inherited from interface org.jivesoftware.openfire.session.Session |
---|
MAJOR_VERSION, MINOR_VERSION, STATUS_AUTHENTICATED, STATUS_CLOSED, STATUS_CONNECTED |
Constructor Summary | |
---|---|
LocalIncomingServerSession(String serverName,
Connection connection,
StreamID streamID)
|
Method Summary | |
---|---|
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 |
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. |
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. |
Methods inherited from class org.jivesoftware.openfire.session.LocalSession |
---|
close, decodeVersion, deliverRawText, getAddress, getConnection, getCreationDate, getHostAddress, getHostName, getLastActiveDate, getNumClientPackets, getNumServerPackets, getServerName, getSessionData, getStatus, getStreamID, incrementClientPacketCount, incrementServerPacketCount, isClosed, isSecure, process, removeSessionData, setAddress, setSessionData, setStatus, toString, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jivesoftware.openfire.session.Session |
---|
close, deliverRawText, getAddress, getCreationDate, getHostAddress, getHostName, getLastActiveDate, getNumClientPackets, getNumServerPackets, getServerName, getStatus, getStreamID, isClosed, isSecure, process, validate |
Constructor Detail |
---|
public LocalIncomingServerSession(String serverName, Connection connection, StreamID streamID)
Method Detail |
---|
public static LocalIncomingServerSession createSession(String serverName, org.dom4j.io.XMPPPacketReader reader, SocketConnection connection) throws org.xmlpull.v1.XmlPullParserException, IOException
Currently the Server Dialback method is the only way to authenticate a remote server. Since
Server Dialback requires an Authoritative Server, it is possible for this server to receive
an incoming connection that will only exist until the requested domain has been validated.
In this case, this method will return null since the connection is closed after
the domain was validated. See
ServerDialback.createIncomingSession(org.dom4j.io.XMPPPacketReader)
for more
information.
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 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 LocalSession
|
Openfire 3.4.3 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |