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 int
protected static final int
protected static final Random
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
applyDelay
(int attempt) Compute exponential delay based on attempt number.protected void
auditBilledCharacters
(long billedCharacters) protected void
auditRemainingCharacters
(long characterLimit, long characterCount) abstract String
abstract boolean
abstract Long
abstract 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)
-