Interface MessageDao


public interface MessageDao
The interface Message dao.
  • Method Details

    • instance

      static MessageDao instance(org.jdbi.v3.core.Jdbi jdbi)
      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

      void store(Message message, State state)
      Store.
      Parameters:
      message - the message
      state - the state
    • readByHash

      Optional<Message> readByHash(long hash)
      Read by hash optional.
      Parameters:
      hash - the hash
      Returns:
      the optional
    • stateOf

      Optional<State> stateOf(Message message)
      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

      List<Message> forState(State state)
      For state list.
      Parameters:
      state - the state
      Returns:
      the list
    • forState

      List<Message> forState(State state, int limit)
      For state list, but limit to the number requested.
      Parameters:
      state - the state
      limit - the max number of results you want.
      Returns:
      the list
    • updateState

      void updateState(Message message, State state)
      Update state.
      Parameters:
      message - the message
      state - the state
    • updateAllToState

      void updateAllToState(State state)
      Update state.
      Parameters:
      state - the state
    • delete

      void delete(Message message)
      Delete.
      Parameters:
      message - the message
    • deleteAll

      void deleteAll()
      Delete all.