Package com.codeheadsystems.queue.dao
Interface MessageDao
public interface MessageDao
The interface Message dao.
-
Method Summary
Modifier and TypeMethodDescriptioncounts()Returns back the count of all messages in the queue.voidDelete.voidDelete all.For state list.For state list, but limit to the number requested.static MessageDaoinstance(org.jdbi.v3.core.Jdbi jdbi) Instance message dao.readByHash(long hash) Read by hash optional.State of optional.voidStore.voidupdateAllToState(State state) Update state.voidupdateState(Message message, State state) Update state.
-
Method Details
-
instance
Instance message dao. In theory you can call this multiple times, but it is recommended you only call it once.- Parameters:
jdbi- the jdbi- Returns:
- the message dao
-
store
Store.- Parameters:
message- the messagestate- the state
-
readByHash
Read by hash optional.- Parameters:
hash- the hash- Returns:
- the optional
-
stateOf
State of optional.- Parameters:
message- the message- Returns:
- the optional
-
counts
List<StateCount> counts()Returns back the count of all messages in the queue.- Returns:
- the list
-
forState
For state list.- Parameters:
state- the state- Returns:
- the list
-
forState
For state list, but limit to the number requested.- Parameters:
state- the statelimit- the max number of results you want.- Returns:
- the list
-
updateState
Update state.- Parameters:
message- the messagestate- the state
-
updateAllToState
Update state.- Parameters:
state- the state
-
delete
Delete.- Parameters:
message- the message
-
deleteAll
void deleteAll()Delete all.
-