Class AccountIdentity

java.lang.Object
dev.frostlake.config.AccountIdentity

public final class AccountIdentity extends Object
Who this engine says it is: one organization, one account, one region — assembled once and read by everything that reports any of it, so the same fact cannot be spelled three different ways.

An account carries FOUR identifiers, not two, and they are genuinely distinct. Measured together on one account:

   CURRENT_ORGANIZATION_NAME()  TWEPWDT      the organization
   CURRENT_ACCOUNT_NAME()       WJ64893      the account's NAME
   CURRENT_ACCOUNT()            PG65914      the account's LOCATOR — a different value
   CURRENT_REGION()             AWS_EU_WEST_1
 

The two URLs are built from different halves of that, and both are LOWER-cased where the identifiers themselves are upper — also measured:

   account_url          https://twepwdt-wj64893.snowflakecomputing.com     org-name
   account_locator_url  https://pg65914.eu-west-1.snowflakecomputing.com   locator.cloud-region
 

The locator URL's region slug drops the cloud prefix and swaps underscores for dashes (AWS_EU_WEST_1 to eu-west-1). That derivation comes from a single measured pair, so it is a reasonable reading rather than a confirmed rule across clouds.

The region is bare. CURRENT_REGION() answers AWS_EU_WEST_1, not PUBLIC.AWS_EU_WEST_1. The <region_group>.<region> spelling is real but belongs to an organization spanning multiple region groups, so it is reachable by configuring snowflake.region with the prefix rather than being the default. Note that SHOW ACCOUNTS has no region_group column at all — asking for one is an invalid identifier there.

  • Constructor Details

    • AccountIdentity

      public AccountIdentity(String organization, String accountName, String accountLocator, String region)
      Assembles an identity from the four identifiers verbatim — nothing is folded or derived here; the URL accessors do their lower-casing on read.
      Parameters:
      organization - the organization name, as CURRENT_ORGANIZATION_NAME() answers it
      accountName - the account's name, as CURRENT_ACCOUNT_NAME() answers it
      accountLocator - the account's locator, as CURRENT_ACCOUNT() answers it
      region - the region, as CURRENT_REGION() answers it
  • Method Details

    • of

      public static AccountIdentity of(EngineConfig config)
      The identity a configuration describes.
      Parameters:
      config - the configuration whose organization, account name, locator and region to read; null means a default EngineConfig
      Returns:
      the identity those four settings assemble
    • getOrganization

      public String getOrganization()
      As CURRENT_ORGANIZATION_NAME() answers it.
      Returns:
      the organization name, verbatim as configured
    • getAccountName

      public String getAccountName()
      As CURRENT_ACCOUNT_NAME() answers it — the account's NAME, not its locator.
      Returns:
      the account name, verbatim as configured
    • getAccountLocator

      public String getAccountLocator()
      As CURRENT_ACCOUNT() answers it — the account's LOCATOR, a different value than its name.
      Returns:
      the account locator, verbatim as configured
    • getRegion

      public String getRegion()
      As CURRENT_REGION() answers it — whatever was configured, prefix and all.
      Returns:
      the region, verbatim as configured
    • getAccountUrl

      public String getAccountUrl()
      https://<org>-<account>.snowflakecomputing.com, lower-cased.
      Returns:
      the account URL built from the organization and account name
    • getAccountLocatorUrl

      public String getAccountLocatorUrl()
      https://<locator>.<cloud-region>.snowflakecomputing.com, lower-cased.
      Returns:
      the locator URL built from the locator and the cloud-region slug