@Qualifier(value="aggregate") public class RedisAggregateCounterRepository extends RedisCounterRepository implements AggregateCounterRepository
AggregateCounterRepository. Subclasses and intercepts calls to
RedisCounterRepository to also track counts in various redis hashes.| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.data.redis.core.HashOperations<java.lang.String,java.lang.String,java.lang.Long> |
hashOperations |
protected org.springframework.data.redis.core.SetOperations<java.lang.String,java.lang.String> |
setOperations |
longOperationsredisOperations, zSetOperations| Constructor and Description |
|---|
RedisAggregateCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(java.lang.String id) |
AggregateCount |
getCounts(java.lang.String name,
org.joda.time.Interval interval,
org.joda.time.DateTimeField resolution)
Query function to allow the counts for a specific interval to be retrieved.
|
long |
increment(java.lang.String name)
Increment the given counter by one, creating it if it did not exist.
|
long |
increment(java.lang.String name,
long amount,
org.joda.time.DateTime dateTime)
Increments the named counter by a specific amount for the given instant.
|
decrement, deserialize, deserializeId, increment, keyFor, reset, serialize, serializeIdcount, delete, delete, deleteAll, exists, findAll, findAll, findAll, findAll, findAllInRange, findOne, getPrefix, idFromRedisKey, redisKeyFromId, save, save, setPrefix, trackMembershipclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdecrement, increment, resetfindAll, findAllcount, delete, delete, deleteAll, exists, findAll, findAll, findOne, save, savefindAllInRangeprotected org.springframework.data.redis.core.HashOperations<java.lang.String,java.lang.String,java.lang.Long> hashOperations
protected org.springframework.data.redis.core.SetOperations<java.lang.String,java.lang.String> setOperations
public RedisAggregateCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory)
redisConnectionFactory - public long increment(java.lang.String name)
CounterRepositoryincrement in interface CounterRepositoryincrement in class RedisCounterRepositorypublic long increment(java.lang.String name,
long amount,
org.joda.time.DateTime dateTime)
AggregateCounterRepositoryincrement in interface AggregateCounterRepositorypublic AggregateCount getCounts(java.lang.String name, org.joda.time.Interval interval, org.joda.time.DateTimeField resolution)
AggregateCounterRepositorygetCounts in interface AggregateCounterRepositoryname - the counter to queryinterval - the time interval to return data for. Includes start, excludes end.resolution - the resolution at which the data should be returned (minutes or hours)public void delete(java.lang.String id)
delete in interface org.springframework.data.repository.CrudRepository<Counter,java.lang.String>delete in class AbstractRedisRepository<Counter,java.lang.String>