Exemplo n.º 1
0
    def __init__(self, request):
        """

        :param request:
        """
        logger.debug("Creating Key")
        self._payload = request.payload
        self._method = request.code
        """
        making a list of the options that do not have a nocachekey option number and are not uri-path, uri-host, uri-port, uri-query
        """

        self._options = []
        for option in request.options:
            if (utils.check_nocachekey(option) is
                    False) and (utils.is_uri_option(option.number) is False):
                self._options.append(option)
        """
        creating a usable key for the cache structure
        """

        option_str = ', '.join(map(str, self._options))
        self._list = [self._payload, self._method, option_str]

        self.hashkey = ', '.join(map(str, self._list))
        logger.debug(self)
Exemplo n.º 2
0
    def __init__(self, request):
        """

        :param request:
        """
        logger.debug("Creating Key")
        self._payload = request.payload
        self._method = request.code

        """
        making a list of the options that do not have a nocachekey option number and are not uri-path, uri-host, uri-port, uri-query
        """

        self._options = []
        for option in request.options:
            if (utils.check_nocachekey(option) is False) and (utils.is_uri_option(option.number) is False):
                self._options.append(option)

        """
        creating a usable key for the cache structure
        """

        option_str = ', '.join(map(str, self._options))
        self._list = [self._payload, self._method, option_str]

        self.hashkey = ', '.join(map(str, self._list))
        logger.debug(self)
Exemplo n.º 3
0
    def __init__(self, request):
        """

        :param request:
        """
        self._payload = request.payload
        self._method = request.code
        """
        making a list of the options that do not have a nocachekey option number
        """

        self._options = []
        for option in request.options:
            if utils.check_nocachekey(option) is False:
                self._options.append(option)
        """
        creating a usable key for the cache structure
        """

        option_str = ', '.join(map(str, self._options))
        self.hashkey = (self._payload, self._method, option_str)
Exemplo n.º 4
0
    def __init__(self, request):
        """

        :param request:
        """
        self._payload = request.payload
        self._method = request.code

        """
        making a list of the options that do not have a nocachekey option number
        """

        self._options = []
        for option in request.options:
            if utils.check_nocachekey(option) is False:
                self._options.append(option)

        """
        creating a usable key for the cache structure
        """

        option_str = ', '.join(map(str, self._options))
        self.hashkey = (self._payload, self._method, option_str)
Exemplo n.º 5
0
    def __init__(self, request):
        """

        :param request:
        """
        print "creating key"
        if (request.payload is not None):
            print "PAYLOAD IN CACHE: ", request.payload
            self._payload = request.payload
        else:
            self._payload = None
        self._method = request.code
        """
        making a list of the options that do not have a nocachekey option number and are not uri-path, uri-host, uri-port, uri-query
        """

        self._options = []
        self.temp_key = ""
        for option in request.options:
            if (utils.check_nocachekey(option) is
                    False) and (utils.is_uri_option(option.number) is False):
                print "ANY option here"
                self._options.append(option)
                if (option._number == 11):
                    self.temp_key = str(option.value)
        """
        creating a usable key for the cache structure
        """

        option_str = ', '.join(map(str, self._options))
        print option_str, "OPTION STRING"
        self._list = [self._payload, self._method, option_str]

        #self.hashkey = ', '.join(map(str, self._list))
        self.hashkey = self.temp_key
        self.debug_print()