Class RegistryConfig

java.lang.Object
google.registry.config.RegistryConfig

public final class RegistryConfig extends Object
Central clearing-house for all configuration.

This class does not represent the total configuration of the Nomulus service. It's only meant for settings that need to be configured once. Settings which may be subject to change in the future, should instead be retrieved from the database. The Tld class is one such example of this.

Note: Only settings that are actually configurable belong in this file. It's not a catch-all for anything widely used throughout the code base.

  • Field Details

    • CONFIG_SETTINGS

      public static final Supplier<RegistryConfigSettings> CONFIG_SETTINGS
      Memoizes loading of the RegistryConfigSettings POJO.

      Memoizing without cache expiration is used because the app must be re-deployed in order to change the contents of the YAML config files.

  • Method Details

    • getProjectId

      public static String getProjectId()
      Returns the App Engine project ID, which is based off the environment name.
    • getDatabaseRetention

      public static org.joda.time.Duration getDatabaseRetention()
      Returns the length of time before commit logs should be deleted from the database.
      See Also:
    • areServersLocal

      public static boolean areServersLocal()
    • getDefaultServer

      public static URL getDefaultServer()
      Returns the address of the Nomulus app default HTTP server.

      This is used by the nomulus tool to connect to the App Engine remote API.

    • getBackendServer

      public static URL getBackendServer()
      Returns the address of the Nomulus app backend HTTP server.

      This is used by the nomulus tool to connect to the App Engine remote API.

    • getBsaServer

      public static URL getBsaServer()
      Returns the address of the Nomulus app bsa HTTP server.

      This is used by the nomulus tool to connect to the App Engine remote API.

    • getToolsServer

      public static URL getToolsServer()
      Returns the address of the Nomulus app tools HTTP server.

      This is used by the nomulus tool to connect to the App Engine remote API.

    • getPubapiServer

      public static URL getPubapiServer()
      Returns the address of the Nomulus app pubapi HTTP server.

      This is used by the nomulus tool to connect to the App Engine remote API.

    • getSingletonCacheRefreshDuration

      public static Duration getSingletonCacheRefreshDuration()
      Returns the amount of time a singleton should be cached, before expiring.
    • getDomainLabelListCacheDuration

      public static Duration getDomainLabelListCacheDuration()
      Returns the amount of time a domain label list should be cached in memory before expiring.
      See Also:
    • getSingletonCachePersistDuration

      public static Duration getSingletonCachePersistDuration()
      Returns the amount of time a singleton should be cached in persist mode, before expiring.
    • getStaticPremiumListMaxCachedEntries

      public static int getStaticPremiumListMaxCachedEntries()
      Returns the maximum number of premium list entries across all TLDs to keep in in-memory cache.
    • isEppResourceCachingEnabled

      public static boolean isEppResourceCachingEnabled()
    • overrideIsEppResourceCachingEnabledForTesting

      public static void overrideIsEppResourceCachingEnabledForTesting(boolean enabled)
    • getEppResourceCachingDuration

      public static Duration getEppResourceCachingDuration()
      Returns the amount of time an EPP resource or key should be cached in memory before expiring.
    • getEppResourceMaxCachedEntries

      public static int getEppResourceMaxCachedEntries()
      Returns the maximum number of EPP resources and keys to keep in in-memory cache.
    • getClaimsListCacheDuration

      public static Duration getClaimsListCacheDuration()
      Returns the amount of time that a particular claims list should be cached.
    • getGSuiteOutgoingEmailAddress

      public static javax.mail.internet.InternetAddress getGSuiteOutgoingEmailAddress()
      Returns the email address that outgoing emails from the app are sent from.
    • getGSuiteOutgoingEmailDisplayName

      public static String getGSuiteOutgoingEmailDisplayName()
      Returns the display name that outgoing emails from the app are sent from.
    • getDefaultRegistrarWhoisServer

      public static String getDefaultRegistrarWhoisServer()
      Returns default WHOIS server to use when Registrar#getWhoisServer() is null.
      See Also:
      • "google.registry.whois.DomainWhoisResponse"
      • "google.registry.whois.RegistrarWhoisResponse"
    • getHibernateConnectionIsolation

      public static String getHibernateConnectionIsolation()
      Returns the default database transaction isolation.
    • getHibernateAllowNestedTransactions

      public static boolean getHibernateAllowNestedTransactions()
      Returns true if nested calls to tm().transact() are allowed.
    • getHibernateLogSqlQueries

      public static String getHibernateLogSqlQueries()
      Returns true if hibernate.show_sql is enabled.
    • getHibernateHikariConnectionTimeout

      public static String getHibernateHikariConnectionTimeout()
      Returns the connection timeout for HikariCP.
    • getHibernateHikariMinimumIdle

      public static String getHibernateHikariMinimumIdle()
      Returns the minimum idle connections for HikariCP.
    • getHibernateHikariMaximumPoolSize

      public static String getHibernateHikariMaximumPoolSize()
      Returns the maximum pool size for HikariCP.
    • getHibernateHikariIdleTimeout

      public static String getHibernateHikariIdleTimeout()
      Returns the idle timeout for HikariCP.
    • getHibernateJdbcBatchSize

      public static int getHibernateJdbcBatchSize()
      JDBC-specific: driver default batch size is 0, which means that every INSERT statement will be sent to the database individually. Batching allows us to group together multiple inserts into one single INSERT statement which can dramatically increase speed in situations with many inserts.

      Hibernate User Guide recommends between 10 and 50.

    • getHibernateJdbcFetchSize

      public static String getHibernateJdbcFetchSize()
      Returns the JDBC fetch size.

      Postgresql-specific: driver default fetch size is 0, which disables streaming result sets. Here we set a small default geared toward Nomulus server transactions. Large queries can override the defaults using JpaTransactionManager.setQueryFetchSize(javax.persistence.Query, int).

    • getContactAndHostRoidSuffix

      public static String getContactAndHostRoidSuffix()
      Returns the roid suffix to be used for the roids of all contacts and hosts.
    • getContactAutomaticTransferLength

      public static org.joda.time.Duration getContactAutomaticTransferLength()
      Returns the global automatic transfer length for contacts.
    • getSunriseDomainCreateDiscount

      public static double getSunriseDomainCreateDiscount()
      A discount for all sunrise domain creates, between 0.0 (no discount) and 1.0 (free).