Class Const


  • public class Const
    extends Object
    Central constants class for the ATH (Acumen Velocity Translation Hub) application. This class contains all application-wide constants including:
    • Environment variable configurations
    • Database names and collection names
    • Default ObjectIds for testing and system operations
    • Property names and values
    • Date formatters
    • Pipeline and MT provider constants

    All constants are public static final and organized by category for easy navigation. This class is not meant to be instantiated.

    Since:
    1.0
    Version:
    1.0
    Author:
    Acumen Velocity
    • Field Detail

      • ATH_PORT

        public static final int ATH_PORT
        Port number for the ATH application server. Defaults to 8080 if ATH_PORT environment variable is not set or invalid. This value is checked for validity in EnvVarsChecker.
      • STORAGE_TIMEOUT_MINUTES

        public static final long STORAGE_TIMEOUT_MINUTES
        Storage timeout in minutes for temporary data and cached resources. Defaults to 15 minutes if ATH_STORAGE_TIMEOUT_MINUTES environment variable is not defined. This prevents test failures when the environment variable is missing.
      • SOLR_DOC_LOCK_TIMEOUT_MS

        public static final long SOLR_DOC_LOCK_TIMEOUT_MS
        Distributed lock timeout in milliseconds for document segment repositioning operations. Defaults to 30 seconds (30000ms) if ATH_SOLR_DOC_LOCK_TIMEOUT_MS environment variable is not defined. This timeout prevents deadlocks when a worker node crashes or becomes unresponsive while holding a lock. After this duration, the lock is considered expired and can be acquired by another node.
      • ATH_GCS_BUCKET

        public static final String ATH_GCS_BUCKET
        Google Cloud Storage bucket name
      • ATH_GCP_SECRET_FILE

        public static final String ATH_GCP_SECRET_FILE
        Path to Google Cloud Platform service account key file
      • ATH_GCP_PROJECT_LOCATION

        public static final String ATH_GCP_PROJECT_LOCATION
        The GCP region
      • ATH_PDF_CLIENT_ID

        public static final String ATH_PDF_CLIENT_ID
        The Client ID required for authenticating with the Adobe PDF services API.
      • ATH_PDF_CLIENT_SECRET

        public static final String ATH_PDF_CLIENT_SECRET
        The Client Secret for authenticating with the Adobe PDF services API.
      • ATH_SOLR_URL

        public static final String ATH_SOLR_URL
        Apache Solr server URL for search functionality
      • ATH_LOGS_CONFIG

        public static final String ATH_LOGS_CONFIG
        Logging configuration setting
      • ATH_GCT_API_KEY

        public static final String ATH_GCT_API_KEY
        Google Translate API key
      • ATH_OPENAI_API_KEY

        public static final String ATH_OPENAI_API_KEY
        OpenAI API key
      • ATH_GEMINI_API_KEY

        public static final String ATH_GEMINI_API_KEY
        Gemini API key
      • AL_MATCH_TYPE

        public static final net.sf.okapi.common.query.MatchType AL_MATCH_TYPE
      • DEFAULT_MT_PROVIDER

        public static final String DEFAULT_MT_PROVIDER
        Default machine translation provider name
      • DEFAULT_MT_THRESHOLD

        public static final int DEFAULT_MT_THRESHOLD
        Default machine translation confidence threshold
      • TEMP_PREFIX

        public static final String TEMP_PREFIX
        Temporary file prefix
      • ATLAS_TM_INDEX_NAME

        public static final String ATLAS_TM_INDEX_NAME
        Atlas Translation Memory index name for search operations
      • TMX_DATE_FORMAT

        public static final DateFormat TMX_DATE_FORMAT
        ISO 8601 date format for TMX files. Reference: https://www.gala-global.org/tmx-14b#creationdate Configured with timezone from project properties.
      • QUARTZ_DATE_FORMAT

        public static final DateFormat QUARTZ_DATE_FORMAT
      • ATH_PIPELINE_TYPE_IMPORT

        public static final String ATH_PIPELINE_TYPE_IMPORT
        Import pipeline type identifier
      • ATH_PIPELINE_TYPE_EXPORT

        public static final String ATH_PIPELINE_TYPE_EXPORT
        Export pipeline type identifier
      • ATH_SOLR_BATCH_SIZE

        public static final int ATH_SOLR_BATCH_SIZE
      • ATH_PROP_TM_THRESHOLD

        public static final String ATH_PROP_TM_THRESHOLD
        Property name for the TM threshold percentage (byte).
        See Also:
        Constant Field Values
      • ATH_PROP_TM_FILE_NAME

        public static final String ATH_PROP_TM_FILE_NAME
        Property name for the TM name.
        See Also:
        Constant Field Values
      • ATH_PROP_MT_ENGINE_ID

        public static final String ATH_PROP_MT_ENGINE_ID
        Property name for the MT engine ID (string).
        See Also:
        Constant Field Values
      • ATH_PROP_MT_ENGINE_PARAMS

        public static final String ATH_PROP_MT_ENGINE_PARAMS
        Property name for the MT-engine-specific parameters (string).
        See Also:
        Constant Field Values
      • ATH_PROP_MT_PROJECT_LOCATION

        public static final String ATH_PROP_MT_PROJECT_LOCATION
        Property name for the MT project location (string).
        See Also:
        Constant Field Values
      • ATH_PROP_SOLR_SCORE

        public static final String ATH_PROP_SOLR_SCORE
        Property name for the Solr score.
        See Also:
        Constant Field Values
      • ATH_PROP_DOC_ID

        public static final String ATH_PROP_DOC_ID
        Property name for the document ID (UUID) inside a TM entry.
        See Also:
        Constant Field Values
      • ATH_PROP_DOC_FILE_NAME

        public static final String ATH_PROP_DOC_FILE_NAME
        Property name for the document file name.
        See Also:
        Constant Field Values
      • ATH_PROP_DOC_FILE_ENCODING

        public static final String ATH_PROP_DOC_FILE_ENCODING
        Property name for the document file encoding.
        See Also:
        Constant Field Values
      • ATH_PROP_DOC_TRL_FILE_ENCODING

        public static final String ATH_PROP_DOC_TRL_FILE_ENCODING
        Property name for the trl (2nd input) document file encoding.
        See Also:
        Constant Field Values
      • ATH_PROP_DOC_OUT_FILE_ENCODING

        public static final String ATH_PROP_DOC_OUT_FILE_ENCODING
        Property name for the document output file encoding.
        See Also:
        Constant Field Values
      • ATH_PROP_FILTER_ID

        public static final String ATH_PROP_FILTER_ID
        Property name for the filter ID (string).
        See Also:
        Constant Field Values
      • ATH_PROP_FILTER_PARAMS

        public static final String ATH_PROP_FILTER_PARAMS
        Property name for the filter parameters (string).
        See Also:
        Constant Field Values
      • ATH_PROP_SRC_SRX

        public static final String ATH_PROP_SRC_SRX
        Property name for the source segmentation rules (string).
        See Also:
        Constant Field Values
      • ATH_PROP_TRG_SRX

        public static final String ATH_PROP_TRG_SRX
        Property name for the target segmentation rules (string).
        See Also:
        Constant Field Values
      • ATH_PROP_SRC_LANG

        public static final String ATH_PROP_SRC_LANG
        Property name for the source language.
        See Also:
        Constant Field Values
      • ATH_PROP_TRG_LANG

        public static final String ATH_PROP_TRG_LANG
        Property name for the target language.
        See Also:
        Constant Field Values
      • ATH_PROP_ERROR_MESSAGE

        public static final String ATH_PROP_ERROR_MESSAGE
        Property name for the error message.
        See Also:
        Constant Field Values
      • ATH_PROP_ERROR_TYPE

        public static final String ATH_PROP_ERROR_TYPE
        Property name for the error type.
        See Also:
        Constant Field Values
      • ATH_PROP_SOURCE_JSON

        public static final String ATH_PROP_SOURCE_JSON
        Property name for the source JSON.
        See Also:
        Constant Field Values
      • ATH_PROP_TARGET_JSON

        public static final String ATH_PROP_TARGET_JSON
        Property name for the target JSON.
        See Also:
        Constant Field Values
      • ATH_PROP_MERGED

        public static final String ATH_PROP_MERGED
        Indicates if this segment was merged from multiple segments
        See Also:
        Constant Field Values
      • ATH_PROP_MERGED_FROM_SEGMENTS_JSON

        public static final String ATH_PROP_MERGED_FROM_SEGMENTS_JSON
        JSON data about segments this was merged from
        See Also:
        Constant Field Values
      • ATH_PROP_SPLIT

        public static final String ATH_PROP_SPLIT
        Indicates if this segment was split from a larger segment
        See Also:
        Constant Field Values
      • ATH_PROP_SPLIT_FROM_SEGMENTS_JSON

        public static final String ATH_PROP_SPLIT_FROM_SEGMENTS_JSON
        JSON data about the segment this was split from
        See Also:
        Constant Field Values
      • ATH_PROP_LOCKED

        public static final String ATH_PROP_LOCKED
        Indicates if the segment is locked for editing
        See Also:
        Constant Field Values
      • ATH_PROP_MATCHED

        public static final String ATH_PROP_MATCHED
        Indicates if the segment has translation memory matches
        See Also:
        Constant Field Values
      • ATH_PROP_TM_MATCH_INFO_JSON

        public static final String ATH_PROP_TM_MATCH_INFO_JSON
        JSON data about translation memory match information
        See Also:
        Constant Field Values
      • ATH_PROP_POSITION

        public static final String ATH_PROP_POSITION
        Position/order of the segment in the document
        See Also:
        Constant Field Values
      • ATH_PROP_ORIGIN

        public static final String ATH_PROP_ORIGIN
        Origin/source of the segment (human, MT, TM, etc.)
        See Also:
        Constant Field Values
      • ATH_PROP_PROCESSED_BY

        public static final String ATH_PROP_PROCESSED_BY
        Property name for processed by.
        See Also:
        Constant Field Values
      • MT_PROVIDER_GOOGLE_MT

        public static final String MT_PROVIDER_GOOGLE_MT
        Google Machine Translation provider identifier
        See Also:
        Constant Field Values
      • MT_PROVIDER_GOOGLE_MT_V3

        public static final String MT_PROVIDER_GOOGLE_MT_V3
        Google Cloud Translation v3 provider identifier
        See Also:
        Constant Field Values
      • ATH_PROP_CAT_VERSION

        public static final String ATH_PROP_CAT_VERSION
        Property name for the CAT version.
        See Also:
        Constant Field Values
      • ATH_PROP_CAT_FRAMEWORK_NAME

        public static final String ATH_PROP_CAT_FRAMEWORK_NAME
        Property name for the CAT framework name.
        See Also:
        Constant Field Values
      • ATH_PROP_CAT_FRAMEWORK_VERSION

        public static final String ATH_PROP_CAT_FRAMEWORK_VERSION
        Property name for the CAT framework version.
        See Also:
        Constant Field Values
      • ATH_PROP_CAT_SOLR_VERSION

        public static final String ATH_PROP_CAT_SOLR_VERSION
        Property name for the CAT Solr version.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_JAVA_HOME

        public static final String ATH_PROP_SERVER_JAVA_HOME
        Property name for the server Java home.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_JAVA_VENDOR

        public static final String ATH_PROP_SERVER_JAVA_VENDOR
        Property name for the server Java vendor.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_JAVA_VERSION

        public static final String ATH_PROP_SERVER_JAVA_VERSION
        Property name for the server Java version.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_JAVA_RUNTIME_VERSION

        public static final String ATH_PROP_SERVER_JAVA_RUNTIME_VERSION
        Property name for the server Java runtime version.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_OS_ARCHITECTURE

        public static final String ATH_PROP_SERVER_OS_ARCHITECTURE
        Property name for the server OS architecture.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_OS_NAME

        public static final String ATH_PROP_SERVER_OS_NAME
        Property name for the server OS name.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_OS_VERSION

        public static final String ATH_PROP_SERVER_OS_VERSION
        Property name for the server OS version.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_USER_NAME

        public static final String ATH_PROP_SERVER_USER_NAME
        Property name for the server user name.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_OS_USER_NAME

        public static final String ATH_PROP_SERVER_OS_USER_NAME
        Property name for the server OS user name.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_WEB_NAME

        public static final String ATH_PROP_SERVER_WEB_NAME
        Property name for the server web name.
        See Also:
        Constant Field Values
      • ATH_PROP_SERVER_WEB_VERSION

        public static final String ATH_PROP_SERVER_WEB_VERSION
        Property name for the server web version.
        See Also:
        Constant Field Values
      • ATH_PROP_SEGMENT_TM_SCORE

        public static final String ATH_PROP_SEGMENT_TM_SCORE
        Property name for the segment TM score.
        See Also:
        Constant Field Values
      • CAT_NAME

        public static final String CAT_NAME
      • CAT_SYSTEM_USER_NAME

        public static final String CAT_SYSTEM_USER_NAME
      • CAT_SYSTEM_TEST_USER_NAME

        public static final String CAT_SYSTEM_TEST_USER_NAME
      • CAT_VERSION

        public static final String CAT_VERSION
      • CAT_FRAMEWORK_NAME

        public static final String CAT_FRAMEWORK_NAME
      • CAT_FRAMEWORK_VERSION

        public static final String CAT_FRAMEWORK_VERSION
      • CAT_SOLR_VERSION

        public static final String CAT_SOLR_VERSION
      • SERVER_JAVA_HOME

        public static final String SERVER_JAVA_HOME
      • SERVER_JAVA_VENDOR

        public static final String SERVER_JAVA_VENDOR
      • SERVER_JAVA_VERSION

        public static final String SERVER_JAVA_VERSION
      • SERVER_JAVA_RUNTIME_VERSION

        public static final String SERVER_JAVA_RUNTIME_VERSION
      • SERVER_OS_ARCHITECTURE

        public static final String SERVER_OS_ARCHITECTURE
      • SERVER_OS_NAME

        public static final String SERVER_OS_NAME
      • SERVER_OS_VERSION

        public static final String SERVER_OS_VERSION
      • SERVER_OS_USER_NAME

        public static final String SERVER_OS_USER_NAME
      • SERVER_WEB_NAME

        public static final String SERVER_WEB_NAME
      • SERVER_WEB_VERSION

        public static final String SERVER_WEB_VERSION
      • SEGMENT_TM_SCORE

        public static final String SEGMENT_TM_SCORE
      • ATH_CREATED_WITH

        public static final String ATH_CREATED_WITH
        Application identifier string combining name, version, framework name and version. Used in the "createdWith" field to track which version of the application created data. Dots are replaced with underscores to avoid conflicts in some contexts.
      • CORE_DOCUMENT

        public static final String CORE_DOCUMENT
        Office Open XML core document relationship type
        See Also:
        Constant Field Values
    • Constructor Detail

      • Const

        public Const()
    • Method Detail

      • requireApiKey

        public static boolean requireApiKey​(String mtProvider)
        Determines if a machine translation provider requires an API key. Currently Google MT v2 and v3 require API keys for authentication.
        Parameters:
        mtProvider - the MT provider name to check
        Returns:
        true if the provider requires an API key, false otherwise
      • buildDefConfigId

        public static String buildDefConfigId​(net.sf.okapi.common.filters.IFilter filter)
        Builds a default configuration ID for a given filter. Combines the filter name with a suffix from project properties.
        Parameters:
        filter - the Okapi filter to build configuration ID for
        Returns:
        configuration ID string
      • buildDefConfigId

        public static String buildDefConfigId​(String filterName)
        Builds a default configuration ID for a given filter name.
        Parameters:
        filterName - the name of the filter
        Returns:
        configuration ID string
      • buildDefConfigName

        public static String buildDefConfigName​(net.sf.okapi.common.filters.IFilter filter)
        Builds a default configuration name for a given filter.
        Parameters:
        filter - the Okapi filter (parameter not used, loads from properties)
        Returns:
        default configuration name from properties
      • buildDefConfigNote

        public static String buildDefConfigNote​(net.sf.okapi.common.filters.IFilter filter)
        Builds a default configuration note/description for a given filter. Combines the filter's display name with a suffix from project properties.
        Parameters:
        filter - the Okapi filter to build note for
        Returns:
        configuration note string
      • buildDefConfigMimeType

        public static String buildDefConfigMimeType​(net.sf.okapi.common.filters.IFilter filter)
        Gets the MIME type for a filter's default configuration.
        Parameters:
        filter - the Okapi filter
        Returns:
        the filter's MIME type
      • buildDefConfigFileExtensions

        public static String buildDefConfigFileExtensions​(net.sf.okapi.common.filters.IFilter filter)
        Gets the file extensions for a filter's default configuration. Currently returns "*" (all extensions) for all filters.
        Parameters:
        filter - the Okapi filter (parameter not used)
        Returns:
        "*" indicating all file extensions are supported