Class FileExchangeStore
java.lang.Object
com.predic8.membrane.core.exchangestore.AbstractExchangeStore
com.predic8.membrane.core.exchangestore.FileExchangeStore
- All Implemented Interfaces:
ExchangeStore
The output file is UTF-8 encoded.
-
Field Summary
FieldsFields inherited from class com.predic8.membrane.core.exchangestore.AbstractExchangeStore
exchangesStoreListeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteOldFolders(Calendar now) Object[]getDir()getExchanges(RuleKey ruleKey) Object[]getLatExchanges(int count) intintgetNumberOfExchanges(RuleKey ruleKey) getStatistics(RuleKey ruleKey) voidbooleanisRaw()booleanvoidremove(AbstractExchange exchange) voidremoveAllExchanges(AbstractExchange[] exchanges) voidremoveAllExchanges(Rule rule) voidvoidsetMaxDays(int maxDays) voidsetRaw(boolean raw) voidsetSaveBodyOnly(boolean saveBodyOnly) voidsnap(AbstractExchange exc, Interceptor.Flow flow) Adds the current state of the exchange to the store.Methods inherited from class com.predic8.membrane.core.exchangestore.AbstractExchangeStore
addExchangesStoreListener, collect, getClientStatistics, getExchangeById, getFilteredSortedPaged, getLastModified, getMax, init, notifyListenersOnExchangeAdd, notifyListenersOnExchangeRemoval, pathContains, refreshExchangeStoreListeners, removeExchangesStoreListener, requestHeaderContains, responseHeaderContains, waitForModification
-
Field Details
-
MESSAGE_FILE_PATH
- See Also:
-
-
Constructor Details
-
FileExchangeStore
public FileExchangeStore()
-
-
Method Details
-
snap
Description copied from interface:ExchangeStoreAdds 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
- Throws:
IOException
-
getExchanges
-
getNumberOfExchanges
-
remove
-
removeAllExchanges
-
getStatistics
-
getAllExchanges
-
getLatExchanges
-
getAllExchangesAsList
-
removeAllExchanges
-
getDir
-
setDir
- 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
-