Class LocalizationServiceProxy

java.lang.Object
org.somda.sdc.glue.consumer.localization.LocalizationServiceProxy
All Implemented Interfaces:
LocalizationServiceAccess

public class LocalizationServiceProxy extends Object implements LocalizationServiceAccess
Controller class that is responsible for invoking localization requests.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Calls a synchronous cache prefetch of localized texts by provided version.
    void
    Calls a synchronous cache prefetch of localized texts by provided version and languages.
    com.google.common.util.concurrent.ListenableFuture<org.somda.sdc.biceps.model.message.GetLocalizedTextResponse>
    getLocalizedText(org.somda.sdc.biceps.model.message.GetLocalizedText getLocalizedText)
    Invokes a localization service to get localized texts.
    com.google.common.util.concurrent.ListenableFuture<org.somda.sdc.biceps.model.message.GetSupportedLanguagesResponse>
    getSupportedLanguages(org.somda.sdc.biceps.model.message.GetSupportedLanguages getSupportedLanguages)
    Invokes a localization service to get supported languages.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getLocalizedText

      public com.google.common.util.concurrent.ListenableFuture<org.somda.sdc.biceps.model.message.GetLocalizedTextResponse> getLocalizedText(org.somda.sdc.biceps.model.message.GetLocalizedText getLocalizedText)
      Description copied from interface: LocalizationServiceAccess
      Invokes a localization service to get localized texts.

      If there is no localization service available, this function returns with a cancelled future.

      Specified by:
      getLocalizedText in interface LocalizationServiceAccess
      Parameters:
      getLocalizedText - the request to send to the localization service.
      Returns:
      a future object that contains a list of localized texts.
    • getSupportedLanguages

      public com.google.common.util.concurrent.ListenableFuture<org.somda.sdc.biceps.model.message.GetSupportedLanguagesResponse> getSupportedLanguages(org.somda.sdc.biceps.model.message.GetSupportedLanguages getSupportedLanguages)
      Description copied from interface: LocalizationServiceAccess
      Invokes a localization service to get supported languages.

      If there is no localization service available, this function returns with a cancelled future.

      Specified by:
      getSupportedLanguages in interface LocalizationServiceAccess
      Parameters:
      getSupportedLanguages - the request to get supported languages.
      Returns:
      a future object that contains a list of supported languages.
    • cachePrefetch

      public void cachePrefetch(BigInteger version) throws InvocationException
      Description copied from interface: LocalizationServiceAccess
      Calls a synchronous cache prefetch of localized texts by provided version.
      Specified by:
      cachePrefetch in interface LocalizationServiceAccess
      Parameters:
      version - - a version of localized texts to be included into cache.
      Throws:
      InvocationException - if localization service is not available or something goes wrong during data fetch.
    • cachePrefetch

      public void cachePrefetch(BigInteger version, List<String> lang) throws InvocationException
      Description copied from interface: LocalizationServiceAccess
      Calls a synchronous cache prefetch of localized texts by provided version and languages.
      Specified by:
      cachePrefetch in interface LocalizationServiceAccess
      Parameters:
      version - a version of localized texts to be included into cache.
      lang - optional list of languages to be included into cache. If languages list is not provided or is empty - all languages are fetched.
      Throws:
      InvocationException - if localization service is not available or something goes wrong during data fetch.