def _CommandHandler(self,conn,request):
        """The internal method to process the routing of command execution requests"""
        # This is the command handler itself.
        # We must:
        #   Pass on command execution to command handler
        #   (Do we need to keep session details here, or can that be done in the command?)
        jid = str(request.getTo())
        try:
            node = request.getTagAttr('command','node')
        except:
            conn.send(Error(request,ERR_BAD_REQUEST))
            raise NodeProcessed
        if self._handlers.has_key(jid):
            if self._handlers[jid].has_key(node):
                self._handlers[jid][node]['execute'](conn,request)
            else:
                conn.send(Error(request,ERR_ITEM_NOT_FOUND))
                raise NodeProcessed
        elif self._handlers[''].has_key(node):
                self._handlers[''][node]['execute'](conn,request)
        else:
            conn.send(Error(request,ERR_ITEM_NOT_FOUND))
            raise NodeProcessed
The internal method to process the routing of command execution requests
chrome-cordova/gcmServer/xmpp/commands.py