@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,
int nCounts,
AggregateCountResolution resolution)
Query function which returns the last 'n' points for a particular resolution.
|
AggregateCount |
getCounts(java.lang.String name,
int nCounts,
org.joda.time.DateTime end,
AggregateCountResolution resolution)
Queries by requesting a number of points, ending on the given date (inclusive).
|
AggregateCount |
getCounts(java.lang.String name,
org.joda.time.Interval interval,
AggregateCountResolution 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, slice
delete, exists, findAll, save
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findAll, findAll
delete, exists, findAll, save
findAllInRange
public long increment(java.lang.String name)
CounterRepository
increment
in interface CounterRepository
public long increment(java.lang.String name, long amount)
CounterRepository
increment
in interface CounterRepository
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, int nCounts, AggregateCountResolution resolution)
AggregateCounterRepository
getCounts
in interface AggregateCounterRepository
name
- the counter to querynCounts
- the number of data points to returnresolution
- the resolution at which the data should be returned (minute, hour, day, month)public AggregateCount getCounts(java.lang.String name, org.joda.time.Interval interval, AggregateCountResolution resolution)
AggregateCounterRepository
getCounts
in interface AggregateCounterRepository
name
- the counter to queryinterval
- the time interval to return data for. Includes start and end.resolution
- the resolution at which the data should be returned (minute, hour, day, month)public AggregateCount getCounts(java.lang.String name, int nCounts, org.joda.time.DateTime end, AggregateCountResolution resolution)
AggregateCounterRepository
getCounts
in interface AggregateCounterRepository
name
- the counter to querynCounts
- the number of data points to returnend
- the end of the query interval (inclusive). Cannot be null.resolution
- the resolution at which the data should be returned (minute, hour, day, month)public long decrement(java.lang.String name)
CounterRepository
decrement
in interface CounterRepository
public void reset(java.lang.String name)
CounterRepository
reset
in interface CounterRepository
public <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>