protected void processPresence(Presence packet) throws UnauthorizedException {
        // Ensure that connection was encrypted if TLS was required
        if (connection.getConfiguration().getTlsPolicy() == Connection.TLSPolicy.required &&
                !connection.isEncrypted()) {
            closeNeverEncryptedConnection();
            return;
        }
        router.route(packet);
        session.incrementClientPacketCount();
    }
Process the received Presence packet. Registered
{@link org.jivesoftware.openfire.interceptor.PacketInterceptor} will be invoked before
and after the packet was routed.<p>

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.

@param packet the received packet.
@throws UnauthorizedException if the connection required encryption but was not encrypted.
xmppserver/src/main/java/org/jivesoftware/openfire/net/SocketReader.java