Interface ExchangeStore

All Known Implementing Classes:
AbstractExchangeStore, ElasticSearchExchangeStore, FileExchangeStore, ForgetfulExchangeStore, LimitedMemoryExchangeStore, MemoryExchangeStore

public interface ExchangeStore
  • Method Details

    • addExchangesStoreListener

      void addExchangesStoreListener(IExchangesStoreListener viewer)
    • removeExchangesStoreListener

      void removeExchangesStoreListener(IExchangesStoreListener viewer)
    • refreshExchangeStoreListeners

      void refreshExchangeStoreListeners()
    • notifyListenersOnExchangeAdd

      void notifyListenersOnExchangeAdd(Rule rule, AbstractExchange exchange)
    • notifyListenersOnExchangeRemoval

      void notifyListenersOnExchangeRemoval(AbstractExchange exchange)
    • snap

      void snap(AbstractExchange exchange, Interceptor.Flow flow)
      Adds the current state of the exchange to the store.

      Implementations should take a snapshot of the current state of the request (or response) headers and register a body observer in which they will be called back as soon as the body has fully been received.

      If flow==REQUEST, the request is added. Elsewise, the response is added (if present).

    • remove

      void remove(AbstractExchange exchange)
    • removeAllExchanges

      void removeAllExchanges(Rule rule)
    • removeAllExchanges

      void removeAllExchanges(AbstractExchange[] exchanges)
    • getExchanges

      AbstractExchange[] getExchanges(RuleKey ruleKey)
    • getNumberOfExchanges

      int getNumberOfExchanges(RuleKey ruleKey)
    • getStatistics

      StatisticCollector getStatistics(RuleKey ruleKey)
    • getAllExchanges

      Object[] getAllExchanges()
    • getAllExchangesAsList

      List<AbstractExchange> getAllExchangesAsList()
    • getExchangeById

      AbstractExchange getExchangeById(long id)
    • init

      void init(Router router) throws Exception
      Throws:
      Exception
    • getClientStatistics

      List<? extends ClientStatistics> getClientStatistics()
    • collect

      void collect(ExchangeCollector col)
    • getLastModified

      long getLastModified()
    • waitForModification

      void waitForModification(long lastKnownModification) throws InterruptedException
      Returns immediately if lastKnownModification is smaller than last known modification. Otherwise it waits until a modification occurs.
      Throws:
      InterruptedException
    • getFilteredSortedPaged

      ExchangeQueryResult getFilteredSortedPaged(QueryParameter params, boolean useXForwardedForAsClientAddr) throws Exception
      Throws:
      Exception