Beispiel #1
0
    def __init__(self, mode, max_dim):
        """

        :param max_dim: max number of elements in the cache
        :param mode: used to differentiate between a cache used in a forward-proxy or in a reverse-proxy
        """

        self.max_dimension = max_dim
        self.mode = mode
        self.cache = CoapLRUCache(max_dim)
Beispiel #2
0
    def __init__(self, mode, max_dim, method_arg):
        """

        :param max_dim: max number of elements in the cache
        :param mode: used to differentiate between a cache used in a forward-proxy or in a reverse-proxy
        """
        print "Dimension of cache : " + str(max_dim)
        print "Method Number selected : " + str(method_arg)
        self.max_dimension = max_dim
        self.mode = mode
        if (method_arg == 0):
            self.cache = CoapLRUCache(max_dim)
        elif (method_arg == 1):
            self.cache = CoapLFUCache(max_dim)
        elif (method_arg == 2):
            self.cache = CoapRRCache(max_dim)
        elif (method_arg == 3):
            self.cache = CoapLIFOCache(max_dim)
        elif (method_arg == 4):
            self.cache = CoapFIFOCache(max_dim)
        elif (method_arg == 5):
            self.cache = CoapMFUCache(max_dim)
        elif (method_arg == 6):
            self.cache = CoapSLRUCache(max_dim)