Class ServerStanzaHandler
Server-to-server communication requires two TCP connections between the servers where one is used for sending packets whilst the other connection is used for receiving packets. The connection used for receiving packets will use a ServerStanzaHandler since the other connection will not receive packets.
- Author:
- Gaston Dombiak, Alex Gidman, Matthew Vivian
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SystemProperty<Boolean>
Controls if JIDs that are in the addresses of stanzas supplied by remote domains are validated.Fields inherited from class org.jivesoftware.openfire.net.StanzaHandler
connection, PROPERTY_OVERWRITE_EMPTY_TO, router, saslStatus, session, sessionCreated, startedSASL, startedTLS, waitingCompressionACK
-
Constructor Summary
ConstructorsConstructorDescriptionServerStanzaHandler
(PacketRouter router, Connection connection, boolean directTLS) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
createSession
(org.xmlpull.v1.XmlPullParser xpp) Uses the XPP to grab the opening stream tag and create an active session object.protected org.dom4j.Document
protected void
processIQ
(org.xmpp.packet.IQ packet) Process the received IQ packet.protected void
processMessage
(org.xmpp.packet.Message packet) Process the received Message packet.protected void
processPresence
(org.xmpp.packet.Presence packet) Process the received Presence packet.protected void
tlsNegotiated
(org.xmlpull.v1.XmlPullParser xpp) TLS negotiation was successful so open a new stream and offer the new stream features.Methods inherited from class org.jivesoftware.openfire.net.StanzaHandler
closeNeverEncryptedConnection, compressClient, compressionSuccessful, getAddress, initiateSession, isEndOfStream, isHostUnknown, isStartOfStream, isStreamManagementStanza, negotiateTLS, process, processStanza, saslSuccessful, setSession
-
Field Details
-
SKIP_JID_VALIDATION
Controls if JIDs that are in the addresses of stanzas supplied by remote domains are validated.
-
-
Constructor Details
-
ServerStanzaHandler
-
-
Method Details
-
createSession
protected void createSession(org.xmlpull.v1.XmlPullParser xpp) throws org.xmlpull.v1.XmlPullParserException, IOException Description copied from class:StanzaHandler
Uses the XPP to grab the opening stream tag and create an active session object. The session to create will depend on the sent namespace. In all cases, the method obtains the opening stream tag, checks for errors, and either creates a session or returns an error and kills the connection. If the connection remains open, the XPP will be set to be ready for the first packet. A call to next() should result in an START_TAG state with the first packet in the stream.- Overrides:
createSession
in classStanzaHandler
- Parameters:
xpp
- the pull parser- Throws:
org.xmlpull.v1.XmlPullParserException
- if an exception occurs reading from the pull parserIOException
- if an IO exception occurs reading from the pull parser
-
getStreamHeader
protected org.dom4j.Document getStreamHeader()- Overrides:
getStreamHeader
in classStanzaHandler
-
tlsNegotiated
protected void tlsNegotiated(org.xmlpull.v1.XmlPullParser xpp) throws org.xmlpull.v1.XmlPullParserException, IOException Description copied from class:StanzaHandler
TLS negotiation was successful so open a new stream and offer the new stream features. The new stream features will include available SASL mechanisms and specific features depending on the session type such as auth for Non-SASL authentication and register for in-band registration.- Overrides:
tlsNegotiated
in classStanzaHandler
- Throws:
org.xmlpull.v1.XmlPullParserException
IOException
-
processIQ
Description copied from class:StanzaHandler
Process the received IQ packet. RegisteredPacketInterceptor
will be invoked before and after the packet was routed.Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.
- Overrides:
processIQ
in classStanzaHandler
- Parameters:
packet
- the received packet.- Throws:
UnauthorizedException
- if service is not available to sender.
-
processPresence
Description copied from class:StanzaHandler
Process the received Presence packet. RegisteredPacketInterceptor
will be invoked before and after the packet was routed.Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.
- Overrides:
processPresence
in classStanzaHandler
- Parameters:
packet
- the received packet.- Throws:
UnauthorizedException
- if service is not available to sender.
-
processMessage
Description copied from class:StanzaHandler
Process the received Message packet. RegisteredPacketInterceptor
will be invoked before and after the packet was routed.Subclasses may redefine this method for different reasons such as modifying the sender of the packet to avoid spoofing, rejecting the packet or even process the packet in another thread.
- Overrides:
processMessage
in classStanzaHandler
- Parameters:
packet
- the received packet.- Throws:
UnauthorizedException
- if service is not available to sender.
-