@Qualifier(value="aggregate") public class InMemoryAggregateCounterRepository extends AbstractInMemoryRepository<Counter,java.lang.String> implements AggregateCounterRepository
| Constructor and Description |
|---|
InMemoryAggregateCounterRepository() |
| Modifier and Type | Method and Description |
|---|---|
long |
count() |
long |
decrement(java.lang.String name)
Decrement the given counter, creating it if it did not exist.
|
void |
delete(Counter entity) |
void |
delete(java.lang.String id) |
void |
deleteAll() |
java.lang.Iterable<Counter> |
findAll() |
Counter |
findOne(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)
Increment the given counter by the specified amount, 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.
|
protected java.lang.String |
keyFor(Counter entity) |
void |
reset(java.lang.String name)
Reset the given counter to zero.
|
<S extends Counter> |
save(S entity) |
buildMap, findAll, findAll, findAllInRange, slicedelete, exists, findAll, saveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindAll, findAlldelete, exists, findAll, savefindAllInRangepublic long increment(java.lang.String name)
CounterRepositoryincrement in interface CounterRepositorypublic long increment(java.lang.String name,
long amount)
CounterRepositoryincrement in interface CounterRepositorypublic 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 long decrement(java.lang.String name)
CounterRepositorydecrement in interface CounterRepositorypublic void reset(java.lang.String name)
CounterRepositoryreset in interface CounterRepositorypublic <S extends Counter> S save(S entity)
save in interface org.springframework.data.repository.CrudRepository<Counter,java.lang.String>save in class AbstractInMemoryRepository<Counter,java.lang.String>public Counter findOne(java.lang.String id)
findOne in interface org.springframework.data.repository.CrudRepository<Counter,java.lang.String>findOne in class AbstractInMemoryRepository<Counter,java.lang.String>public java.lang.Iterable<Counter> findAll()
findAll in interface org.springframework.data.repository.CrudRepository<Counter,java.lang.String>findAll in class AbstractInMemoryRepository<Counter,java.lang.String>public long count()
count in interface org.springframework.data.repository.CrudRepository<Counter,java.lang.String>count in class AbstractInMemoryRepository<Counter,java.lang.String>public void delete(java.lang.String id)
delete in interface org.springframework.data.repository.CrudRepository<Counter,java.lang.String>delete in class AbstractInMemoryRepository<Counter,java.lang.String>public void delete(Counter entity)
delete in interface org.springframework.data.repository.CrudRepository<Counter,java.lang.String>delete in class AbstractInMemoryRepository<Counter,java.lang.String>public void deleteAll()
deleteAll in interface org.springframework.data.repository.CrudRepository<Counter,java.lang.String>deleteAll in class AbstractInMemoryRepository<Counter,java.lang.String>protected java.lang.String keyFor(Counter entity)
keyFor in class AbstractInMemoryRepository<Counter,java.lang.String>