Interface CounterService
- All Known Implementing Classes:
CounterServiceImpl
public interface CounterService
Simple service for getting an incremental value based on a given key
-
Method Summary
Modifier and TypeMethodDescriptionlonggetNext(TenantContext context, String key) Gets the next value.longreset(TenantContext context, String key) Resets the given counter to 0
-
Method Details
-
getNext
Gets the next value. If no counter for exists, creates a new one and returns 0;- Parameters:
key- the unique key for the counter.
-
reset
Resets the given counter to 0- Parameters:
key- the unique key for the counter.
-