Class RedisAction

java.lang.Object
io.inversion.Rule<A>
io.inversion.Action<RedisAction>
io.inversion.redis.RedisAction
All Implemented Interfaces:
Comparable<RedisAction>

public class RedisAction extends io.inversion.Action<RedisAction>
The service builds a key from the request url and parameters. If the key does not exist within Redis, the request is passed along to the GetHandler. The JSON response from the GetHandler will be inserted into Redis with an expiration if the JSON is not null or empty.

The initial Redis check can be bypassed by including the skipCache (verify value below) request parameter.

The current implementation of Jedis.set() does not allow clobbering a key/value and expiration but will in a future build. Because of that, Jedis.setex() is used. Since the SET command options can replace SETNX, SETEX, PSETEX, it is possible that in future versions of Redis these three commands will be deprecated and finally removed.

Jedis.set() parameter explanation... nxxx NX|XX, NX -- Only set the key if it does not already exist. XX -- Only set the key if it already exist. expx EX|PX, expire time units: EX = seconds; PX = milliseconds

A future version of jedis alter's .set() to allow for a SetParams object to be used to set 'ex' without requiring the setting of 'nx'

  • Nested Class Summary

    Nested classes/interfaces inherited from class io.inversion.Rule

    io.inversion.Rule.RuleMatcher
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.slf4j.Logger
     

    Fields inherited from class io.inversion.Rule

    ALL_METHODS, configMap, description, excludeMatchers, excludeOn, includeMatchers, includeOn, name, order, params
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    run(io.inversion.Request req, io.inversion.Response res)
     

    Methods inherited from class io.inversion.Action

    configureOp, doDelete, doGet, doPatch, doPost, doPut, getFullIncludePaths, getIncludePaths, isDecoration, joinPaths, joinPaths0, run0, withDecoration

    Methods inherited from class io.inversion.Rule

    afterWiringComplete, checkLazyConfig, compareTo, doLazyConfig, getAllExcludePaths, getAllIncludeMethods, getAllIncludePaths, getDefaultIncludeMatchers, getDescription, getExcludeMatchers, getIncludeMatchers, getName, getOrder, getParams, match, match, matches, matches, toString, withDescription, withExcludeOn, withExcludeOn, withIncludeOn, withIncludeOn, withName, withOrder, withParam, withParams

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • log

      protected final org.slf4j.Logger log
  • Constructor Details

    • RedisAction

      public RedisAction()
  • Method Details

    • run

      public void run(io.inversion.Request req, io.inversion.Response res) throws io.inversion.ApiException
      Overrides:
      run in class io.inversion.Action<RedisAction>
      Throws:
      io.inversion.ApiException