'Request the capabilities available on this server.
This command is allowed in any state of connection.
@type useCache: C{bool}
@param useCache: Specify whether to use the capability-cache or to
re-retrieve the capabilities from the server.  Server capabilities
should never change, so for normal use, this flag should never be
false.
@rtype: C{Deferred}
@return: A deferred whose callback will be invoked with a
dictionary mapping capability types to lists of supported
mechanisms, or to None if a support list is not applicable.'

def getCapabilities(self, useCache=1):

    if (useCache and (self._capCache is not None)):
        return defer.succeed(self._capCache)
    cmd = 'CAPABILITY'
    resp = ('CAPABILITY',)
    d = self.sendCommand(Command(cmd, wantResponse=resp))
    d.addCallback(self.__cbCapabilities)
    return d
