'Checks to see if an API method can be called when
the given token is passed in.  Updates the timestamp
of the token automatically to prevent the need to
repeatedly call login().  Any method that needs
access control should call this before doing anything
else.'

def __validate_token(self, token):

    self.__invalidate_expired_tokens()
    if (token in self.token_cache):
        user = self.get_user_from_token(token)
        if (user == '<system>'):
            return False
        self.token_cache[token] = (time.time(), user)
        return True
    else:
        self._log('invalid    token', token=token)
        return False
