Skip to content

Commit

Permalink
Merge pull request #19 from JavaCoDED78/#18
Browse files Browse the repository at this point in the history
  • Loading branch information
JavaCoDED78 authored Jun 18, 2024
2 parents 2336870 + 8984e1c commit 2125831
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.github.javacoded78.jwthumble.config.redis.RedisSchema;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
* Implementation of TokenStorage based on Redis.
Expand Down Expand Up @@ -43,6 +44,48 @@ public RedisTokenStorageImpl(final JedisPool jedisPool,
this.redisSchema = redisSchema;
}

/**
* Creates an object.
*
* @param host Redis host
* @param port Redis port
*/
public RedisTokenStorageImpl(final String host,
final int port) {
JedisPoolConfig config = new JedisPoolConfig();
config.setJmxEnabled(false);
this.jedisPool = new JedisPool(
config,
host,
port
);
this.redisSchema = new DefaultRedisSchema();
}

/**
* Creates an object.
*
* @param host Redis host
* @param port Redis port
* @param user Redis username
* @param password Redis password
*/
public RedisTokenStorageImpl(final String host,
final int port,
final String user,
final String password) {
JedisPoolConfig config = new JedisPoolConfig();
config.setJmxEnabled(false);
this.jedisPool = new JedisPool(
config,
host,
port,
user,
password
);
this.redisSchema = new DefaultRedisSchema();
}

@Override
public void save(final String token,
final TokenParameters params) {
Expand Down

0 comments on commit 2125831

Please sign in to comment.