Interface TenantStatusStore


public interface TenantStatusStore
  • Method Details

    • getTenantStatus

      Optional<TenantStatusBean> getTenantStatus(TenantContext context)
      Try to retrieve status for a tenant. May be empty if this is the first status check.
      Parameters:
      context - the tenant to fetch
      Returns:
      tenant status or empty
    • setTenantStatus

      void setTenantStatus(TenantContext context, TenantStatusType status, boolean resetTimesInStatus)
      Sets the status of a tenant
      Parameters:
      context - the tenant to save
      status - new status to set
      resetTimesInStatus - true if the number of times we've been in this status should go back to 1
    • saveTenantStatus

      Optional<TenantStatusBean> saveTenantStatus(TenantContext context, Instant lastRuleExecution, TenantStatusType previousStatus, TenantStatusType newStatus, String connectVersion)
      Updates the tenant status with the latest status provided.
      Parameters:
      context - the tenant to save
      lastRuleExecution - last time a rule executed
      previousStatus - old tenant status
      newStatus - current tenant status
      Returns:
      the latest status from the DB
    • claimForUpgrade

      boolean claimForUpgrade(TenantContext context, String upgradeUUID)
      Will try to claim the tenant for upgrade. If the tenant is already being upgraded/claimed, this will return false.
      Parameters:
      context - the tenant to upgrade
      upgradeUUID - unique id for this upgrade
      Returns:
      true if the tenant could be claimed for upgrade. False otherwise (no upgrade should be performed).
    • finishTenantUpgrade

      void finishTenantUpgrade(TenantContext context, String upgradeUUID)
      This will clear the upgrade claimant so future upgrades can go ahead.
      Parameters:
      context - the tenant to upgrade
      upgradeUUID - unique id for this upgrade
    • setBuildNumber

      void setBuildNumber(TenantContext context, long targetBuildNumber)
      Update the build number to the latest upgrade task that ran.
    • clearClaimedUpgrades

      void clearClaimedUpgrades(Environment env)
      This method clears any upgrades that got stuck.