public LocalSession getSession()
    {
        return session;
    }
Creates the appropriate {@link org.jivesoftware.openfire.session.Session} subclass based on the specified namespace.

@param namespace the namespace sent in the stream element. eg. jabber:client.
@return the created session or null.
@throws UnauthorizedException if the connection required encryption but was not encrypted.
@throws XmlPullParserException if there was an XML error while creating the session.
@throws IOException if an IO error occurred while creating the session.
xmppserver/src/main/java/org/jivesoftware/openfire/net/SocketReader.java