Class HeapBasedLocalizationStorage
-
- All Implemented Interfaces:
-
org.somda.sdc.glue.provider.localization.LocalizationStorage
public class HeapBasedLocalizationStorage implements LocalizationStorage
Default implementation of LocalizationStorage.
Localized texts are stored in heap (Map) and can be added during runtime.
-
-
Field Summary
Fields Modifier and Type Field Description public final List<String>supportedLanguages
-
Constructor Summary
Constructors Constructor Description HeapBasedLocalizationStorage()
-
Method Summary
Modifier and Type Method Description synchronized List<String>getSupportedLanguages()Gets a list of all supported languages. synchronized List<LocalizedText>getLocalizedText(List<String> references, @Nullable() BigInteger version, List<String> languages)Gets a localized text that is referenced in the MDIB. synchronized voidaddLocalizedText(LocalizedText text)Adds provided localized text to the LocalizationStorage. synchronized voidaddAllLocalizedTexts(Collection<LocalizedText> texts)Adds provided collection of localized texts to the LocalizationStorage. -
-
Method Detail
-
getSupportedLanguages
synchronized List<String> getSupportedLanguages()
Gets a list of all supported languages.
- Returns:
a list of supported language identifiers.
-
getLocalizedText
synchronized List<LocalizedText> getLocalizedText(List<String> references, @Nullable() BigInteger version, List<String> languages)
Gets a localized text that is referenced in the MDIB.
- Parameters:
references- a zero or more reference names of the texts that are requested.version- of the referenced text that is requested.languages- a zero or more language identifiers to get different translations of the requested text.- Returns:
a list of LocalizedText texts that matches search criteria.
-
addLocalizedText
synchronized void addLocalizedText(LocalizedText text)
Adds provided localized text to the LocalizationStorage.
- Parameters:
text- the LocalizedText to be added to the storage.
-
addAllLocalizedTexts
synchronized void addAllLocalizedTexts(Collection<LocalizedText> texts)
Adds provided collection of localized texts to the LocalizationStorage.
- Parameters:
texts- a collection of LocalizedText to be added to the storage.
-
-
-
-