@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 |
longOperations
redisOperations, 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, serializeId
count, delete, delete, deleteAll, exists, findAll, findAll, findAll, findAll, findOne, getPrefix, idFromRedisKey, redisKeyFromId, save, save, setPrefix, trackMembership
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decrement, increment, reset
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
public RedisAggregateCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory)
redisConnectionFactory
- public long increment(java.lang.String name)
CounterRepository
increment
in interface CounterRepository
increment
in class RedisCounterRepository
public long increment(java.lang.String name, long amount, org.joda.time.DateTime dateTime)
AggregateCounterRepository
increment
in interface AggregateCounterRepository
public AggregateCount getCounts(java.lang.String name, org.joda.time.Interval interval, org.joda.time.DateTimeField resolution)
AggregateCounterRepository
getCounts
in interface AggregateCounterRepository
name
- 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>