Package sk.iway.iwcm.system.translation
Class TranslationEngine
java.lang.Object
sk.iway.iwcm.system.translation.TranslationEngine
- Direct Known Subclasses:
DeepL
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final Random -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanapplyDelay(int attempt) Compute exponential delay based on attempt number.protected voidauditBilledCharacters(long billedCharacters) protected voidauditRemainingCharacters(long characterLimit, long characterCount) abstract Stringabstract booleanabstract Longabstract String
-
Field Details
-
MAX_RETRIES
protected static final int MAX_RETRIES- See Also:
-
BASE_DELAY_MS
protected static final int BASE_DELAY_MS- See Also:
-
random
-
-
Constructor Details
-
TranslationEngine
public TranslationEngine()
-
-
Method Details
-
engineName
-
numberOfFreeCharacters
-
translate
-
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)
-