Class DuplicateCheckHandler


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void checkDuplicateRequest​(io.vertx.redis.RedisClient redisClient, java.lang.String uri, io.vertx.core.buffer.Buffer buffer, java.lang.String ttl, io.vertx.core.Handler<java.lang.Boolean> callback)
      This method checks if an entry for the provided information (uri and buffer) is stored in the redis database.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • checkDuplicateRequest

        public static void checkDuplicateRequest​(io.vertx.redis.RedisClient redisClient,
                                                 java.lang.String uri,
                                                 io.vertx.core.buffer.Buffer buffer,
                                                 java.lang.String ttl,
                                                 io.vertx.core.Handler<java.lang.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:
        redisClient - redisClient
        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