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 Object
Class for creating managed filter requests with callbacks.
  • Field Details

  • Constructor Details

  • Method Details

    • run

      public void run(ScheduledExecutorService scheduledExecutorService, long blockTime)
    • sendRequest

      protected abstract EthFilter sendRequest() throws IOException
      Throws:
      IOException
    • process

      protected abstract void process(List<EthLog.LogResult> logResults)
    • cancel

      public void cancel()
    • uninstallFilter

      protected EthUninstallFilter uninstallFilter(BigInteger filterId) throws IOException
      Throws:
      IOException
    • getFilterLogs

      protected abstract Optional<Request<?,EthLog>> getFilterLogs(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