gov.loc.repository.bagit.transfer.FetchFailStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bagit Show documentation
Show all versions of bagit Show documentation
The BAGIT LIBRARY is a software library intended to support the creation, manipulation, and validation of bags. Its current version is 0.97. It is version aware with the earliest supported version being 0.93.
package gov.loc.repository.bagit.transfer;
import gov.loc.repository.bagit.FetchTxt;
/**
* Represents a strategy for failing a fetch, based on some
* implementation-defined criteria. Implementors must
* return a {@link FetchFailureAction} value that determines
* the action that the caller should take in response to
* the registered failure.
*
* Implementations of this interface must be
* thread-safe.
*
* Fetch failures are used by the the
* {@link BagFetcher#setFetchFailStrategy(FetchFailStrategy) setFetchFailStrategy}
* method of the BagFetcher
. Some common strategies are
* the {@link StandardFailStrategies#ALWAYS_CONTINUE ALWAYS_CONTINUE},
* {@link StandardFailStrategies#ALWAYS_RETRY ALWAYS_RETRY},
* and {@link StandardFailStrategies#FAIL_FAST FAIL_FAST} strategies.
* A more complex strategy might involve the
* {@link ThresholdFailStrategy}.
*
* @version $id$
* @see FetchFailureAction
* @see StandardFailStrategies
* @see ThresholdFailStrategy
* @see BagFetcher
*/
public interface FetchFailStrategy
{
FetchFailureAction registerFailure(FetchTxt.FilenameSizeUrl fetchLine, Object context);
}