Class DuplicateCheckHandler


  • public final class DuplicateCheckHandler
    extends Object
    Class which is responsible for checking wheter a request is duplicate or not
    Author:
    https://github.com/mcweba [Marc-Andre Weber]
    • Method Detail

      • checkDuplicateRequest

        public static void checkDuplicateRequest​(io.vertx.redis.client.RedisAPI redisAPI,
                                                 String uri,
                                                 io.vertx.core.buffer.Buffer buffer,
                                                 String ttl,
                                                 io.vertx.core.Handler<Boolean> callback)
        This method checks if an entry for the provided information (uri and buffer) is stored in the redis database. When no entry was found in the database, a new entry will be saved to the database using a key which is created from the given parameters (uri and buffer). The new entry expires after ttl has expired.
        Parameters:
        redisAPI - redisAPI
        uri - the request uri
        buffer - the request payload
        ttl - the timeToLive (in seconds) for the storage entry
        callback - the result callback. Returns true if the request is a duplicate else returns false