The protocol layer is the central place for handling the fundamental logic and assertions of XMPP stanzas going over a XMPP transport. The protocol layer normally gets fed from the transport layer, but is independent from it (to be easily testable and keeping transports pluggable).

To execute actual command functionality, the protocol layer looks up (using {@link org.apache.vysper.xmpp.protocol.StanzaHandlerLookup}) and hands over control to the appropriate {@link org.apache.vysper.xmpp.protocol.StanzaHandler}. It acts as a state machine for a {@link org.apache.vysper.xmpp.server.SessionContext}.

Essentially, the protocol layer ensures that every XMPP session is in a well-defined state, the fundamental rules of stanza processing are followed, that the appropriate handlers are called and session, transport and connection are working well together. It knows what to do when a session gets closed (unexectedly or expectedly) and handles stream level errors. @see org.apache.vysper.xmpp.protocol.ProtocolWorker @see org.apache.vysper.xmpp.stanza.Stanza @see org.apache.vysper.xmpp.protocol.StanzaHandlerLookup @see org.apache.vysper.xmpp.protocol.StanzaHandler @see org.apache.vysper.xmpp.protocol.StateAwareProtocolWorker