Class RegistryConfig

  • public final class RegistryConfig
    extends java.lang.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 Datastore. The Registry 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 Detail


        public static final java.util.function.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 Detail

      • getProjectId

        public static java.lang.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 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 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.

      • getToolsServer

        public static 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 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 java.time.Duration getSingletonCacheRefreshDuration()
        Returns the amount of time a singleton should be cached, before expiring.
      • getDomainLabelListCacheDuration

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

        public static java.time.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 java.time.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 java.time.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 java.lang.String getGSuiteOutgoingEmailDisplayName()
        Returns the display name that outgoing emails from the app are sent from.
      • getDefaultRegistrarWhoisServer

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

        public static org.joda.time.Duration getBaseOfyRetryDuration()
        Returns the base retry duration that gets doubled after each failure within Ofy.
      • getHibernateConnectionIsolation

        public static java.lang.String getHibernateConnectionIsolation()
        Returns the default database transaction isolation.
      • getHibernateLogSqlQueries

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

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

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

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

        public static java.lang.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 docs, i.e., recommend between 10 and 50.

      • getHibernateJdbcFetchSize

        public static java.lang.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 java.lang.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.