Class TranslationEngine

java.lang.Object
sk.iway.iwcm.system.translation.TranslationEngine
Direct Known Subclasses:
DeepL

public abstract class TranslationEngine extends Object
  • Field Details

  • Constructor Details

    • TranslationEngine

      public TranslationEngine()
  • Method Details

    • engineName

      public abstract String engineName()
    • numberOfFreeCharacters

      public abstract Long numberOfFreeCharacters()
    • translate

      public abstract String translate(String text, String fromLanguage, String toLanguage)
    • isConfigured

      public abstract boolean isConfigured()
    • applyDelay

      protected boolean applyDelay(int attempt)
      Compute exponential delay based on attempt number. Use delay ms to fall asleep thread.
      Parameters:
      attempt - - number of attemp
      Returns:
      TRUE if sleep was successfull and we have another try, else FALSE
    • auditBilledCharacters

      protected void auditBilledCharacters(long billedCharacters)
    • auditRemainingCharacters

      protected void auditRemainingCharacters(long characterLimit, long characterCount)