Package org.apache.tika.pipes.grpc
Class ExpiringFetcherStore
- java.lang.Object
-
- org.apache.tika.pipes.grpc.ExpiringFetcherStore
-
- All Implemented Interfaces:
AutoCloseable
public class ExpiringFetcherStore extends Object implements AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description static long
EXPIRE_JOB_INITIAL_DELAY
-
Constructor Summary
Constructors Constructor Description ExpiringFetcherStore(int expireAfterSeconds, int checkForExpiredFetchersDelaySeconds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
<T extends AbstractFetcher,C extends AbstractConfig>
voidcreateFetcher(T fetcher, C config)
boolean
deleteFetcher(String fetcherName)
<T extends AbstractFetcher>
TgetFetcherAndLogAccess(String fetcherName)
This method will get the fetcher, but will also log the access the fetcher as having been accessed.Map<String,AbstractConfig>
getFetcherConfigs()
Map<String,AbstractFetcher>
getFetchers()
-
-
-
Field Detail
-
EXPIRE_JOB_INITIAL_DELAY
public static final long EXPIRE_JOB_INITIAL_DELAY
- See Also:
- Constant Field Values
-
-
Method Detail
-
deleteFetcher
public boolean deleteFetcher(String fetcherName)
-
getFetchers
public Map<String,AbstractFetcher> getFetchers()
-
getFetcherConfigs
public Map<String,AbstractConfig> getFetcherConfigs()
-
getFetcherAndLogAccess
public <T extends AbstractFetcher> T getFetcherAndLogAccess(String fetcherName)
This method will get the fetcher, but will also log the access the fetcher as having been accessed. This prevents the scheduled job from removing the stale fetcher.
-
createFetcher
public <T extends AbstractFetcher,C extends AbstractConfig> void createFetcher(T fetcher, C config)
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
-