All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.app.cash.backfila.embedded.JavaBackfila.kt Maven / Gradle / Ivy

Go to download

Backfila is a service that manages backfill state, calling into other services to do batched work.

There is a newer version: 2024.10.28.205607-fab304f
Show newest version
package app.cash.backfila.embedded

import app.cash.backfila.client.Backfill
import javax.inject.Inject
import okio.ByteString

/**
 * Programmatic access to backfila runs for Java. This represents the customer's use of the Backfila
 * UI in tests.
 * Note that passing in Parameters objects for testing is not supported in Java. You must use the
 * parameterData map instead.
 *
 * Kotlin customers should use [Backfila] directly.
 */
class JavaBackfila @Inject constructor(private val backfila: Backfila) {

  // Dry Run Signatures
  fun  createDryRun(
    backfill: Class,
  ): BackfillRun {
    return backfila.createDryRun(backfill.kotlin, null, mapOf(), null, null)
  }

  @JvmOverloads
  fun  createDryRun(
    backfill: Class,
    parameterData: Map,
    rangeStart: String? = null,
    rangeEnd: String? = null,
  ): BackfillRun {
    return backfila.createDryRun(backfill.kotlin, null, parameterData, rangeStart, rangeEnd)
  }

  // Wet Run Signatures
  fun  createWetRun(
    backfill: Class,
  ): BackfillRun {
    return backfila.createWetRun(backfill.kotlin, null, mapOf(), null, null)
  }

  @JvmOverloads
  fun  createWetRun(
    backfill: Class,
    parameterData: Map,
    rangeStart: String? = null,
    rangeEnd: String? = null,
  ): BackfillRun {
    return backfila.createWetRun(backfill.kotlin, null, parameterData, rangeStart, rangeEnd)
  }

  // Helper methods
  fun  findExistingRun(
    backfillType: Class,
    backfillRunId: Long,
  ): BackfillRun {
    return backfila.findExistingRun(backfillType.kotlin, backfillRunId)
  }

  fun  findLatestRun(
    backfillType: Class,
  ): BackfillRun {
    return backfila.findLatestRun(backfillType.kotlin)
  }

  val configureServiceData = backfila.configureServiceData
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy