Class FileExchangeStore

java.lang.Object
com.predic8.membrane.core.exchangestore.AbstractExchangeStore
com.predic8.membrane.core.exchangestore.FileExchangeStore
All Implemented Interfaces:
ExchangeStore

public class FileExchangeStore extends AbstractExchangeStore
The output file is UTF-8 encoded.
  • Field Details

  • Constructor Details

    • FileExchangeStore

      public FileExchangeStore()
  • Method Details

    • snap

      public void snap(AbstractExchange exc, Interceptor.Flow flow)
      Description copied from interface: ExchangeStore
      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).

    • initializeTimer

      public void initializeTimer()
    • deleteOldFolders

      public void deleteOldFolders(Calendar now) throws IOException
      Throws:
      IOException
    • getExchanges

      public AbstractExchange[] getExchanges(RuleKey ruleKey)
    • getNumberOfExchanges

      public int getNumberOfExchanges(RuleKey ruleKey)
    • remove

      public void remove(AbstractExchange exchange)
    • removeAllExchanges

      public void removeAllExchanges(Rule rule)
    • getStatistics

      public StatisticCollector getStatistics(RuleKey ruleKey)
    • getAllExchanges

      public Object[] getAllExchanges()
    • getLatExchanges

      public Object[] getLatExchanges(int count)
    • getAllExchangesAsList

      public List<AbstractExchange> getAllExchangesAsList()
    • removeAllExchanges

      public void removeAllExchanges(AbstractExchange[] exchanges)
    • getDir

      public String getDir()
    • setDir

      public void setDir(String dir)
      Description
      Directory where the exchanges are saved.
      Example
      logs
    • isRaw

      public boolean isRaw()
    • setRaw

      public void setRaw(boolean raw)
      Default
      false
      Description
      If this is true, headers will always be printed (overriding saveBodyOnly) and the body of the exchange won't be formatted nicely.
      Example
      true
    • isSaveBodyOnly

      public boolean isSaveBodyOnly()
    • setSaveBodyOnly

      public void setSaveBodyOnly(boolean saveBodyOnly)
      Default
      false
      Description
      If this is true, no headers will be written to the exchange log files.
      Example
      true
    • getMaxDays

      public int getMaxDays()
    • setMaxDays

      public void setMaxDays(int maxDays)
      Default
      -1
      Description
      Number of days for which exchange logs are preserved. A value smaller than zero deactivates the deletion of old logs.
      Example
      60