code: public Long setnx(final Object key, final int expiration, final Object obj) {
          List<RedisClient> clients = this.getAliveClients(key);
          if (isAtLeastOneAvailable(clients)) {
              return this.execute(new BaseRedisCallBack<Long>() {
                  public Long doOperation(RedisClient client) throws Exception {
                      return client.setnx(key.toString(), obj, expiration);
                  }
  
                  public String getOptionType() {
                      return "SETNX";
                  }
              }, clients, key, false);
          }
          return 0L;
      }
docs: Set key to hold string value if key does not exist. In that case, it is equal to SET.
  When key already holds a value, no operation is performed. SETNX is short for "SET if N ot e X ists".
  
  @param key        Key to be operated.
  @param expiration Expiration time
  @param obj        Object to be set.
  
  @return 1 if the key was set, 0 if hte key was not set.
  
  @see <a href="http://redis.io/commands/setnx">Redis: SETNX</a>