Package org.web3j.protocol.core.filters
Class Filter<T>
- java.lang.Object
-
- org.web3j.protocol.core.filters.Filter<T>
-
- Direct Known Subclasses:
BlockFilter
,BlocksFilter
,LogFilter
,LogsFilter
,PendingTransactionFilter
,PendingTransactionsFilter
public abstract class Filter<T> extends java.lang.Object
Class for creating managed filter requests with callbacks.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cancel()
protected abstract java.util.Optional<Request<?,EthLog>>
getFilterLogs(java.math.BigInteger filterId)
Retrieves historic filters for the filter with the given id.protected abstract void
process(java.util.List<EthLog.LogResult> logResults)
void
run(java.util.concurrent.ScheduledExecutorService scheduledExecutorService, long blockTime)
protected abstract EthFilter
sendRequest()
protected EthUninstallFilter
uninstallFilter(java.math.BigInteger filterId)
-
-
-
Method Detail
-
run
public void run(java.util.concurrent.ScheduledExecutorService scheduledExecutorService, long blockTime)
- Parameters:
scheduledExecutorService
-blockTime
-
-
sendRequest
protected abstract EthFilter sendRequest() throws java.io.IOException
- Throws:
java.io.IOException
-
process
protected abstract void process(java.util.List<EthLog.LogResult> logResults)
-
cancel
public void cancel()
-
uninstallFilter
protected EthUninstallFilter uninstallFilter(java.math.BigInteger filterId) throws java.io.IOException
- Throws:
java.io.IOException
-
getFilterLogs
protected abstract java.util.Optional<Request<?,EthLog>> getFilterLogs(java.math.BigInteger filterId)
Retrieves historic filters for the filter with the given id. Getting historic logs is not supported by all filters. If not the method should return an empty EthLog object- Parameters:
filterId
- Id of the filter for which the historic log should be retrieved- Returns:
- Historic logs, or an empty optional if the filter cannot retrieve historic logs
-
-