Class TurSprinklrProcess

Object
TurSprinklrProcess

@Component public class TurSprinklrProcess extends Object
  • Constructor Details

    • TurSprinklrProcess

      @Inject public TurSprinklrProcess(@Value("${turing.url}") String turingUrl, @Value("${turing.apiKey}") String turingApiKey, @Value("${turing.sprinklr.job.size}") int jobSize, TurSprinklrAttributeMappingRepository turSprinklrAttributeMappingRepository)
  • Method Details

    • start

      public void start(TurSprinklrSource turSprinklrSource)
    • getArticle

      public void getArticle(TurSprinklrSource turSprinklrSource, TurSprinklrSearchResult searchResult, TurSprinklrAccessToken token)
    • getLocale

      public Locale getLocale(TurSprinklrSource turSprinklrSource, TurSprinklrSearchResult searchResult, TurSprinklrAccessToken token)
      Get the Locale from inside turSprinklrSource entity, if it does not work, tries to get the locale from inside locale_class column of turSprinklrSource entity, if also does not work, return Locale.US.
      Parameters:
      turSprinklrSource - the method will first try to get the Locale from turSprinklrSource.getLocale().
      searchResult - is used to create a context where an attempt will be made to retrieve the locale.
      token - N/A
      Returns:
      Locale based on the parameters.
    • getJobItemAttributes

      public Map<String,Object> getJobItemAttributes(TurSprinklrSource turSprinklrSource, TurSprinklrAccessToken token, TurSprinklrSearchResult searchResult)
      Returns a new HashMap of "Attribute(turing Field, Attribute Name from export.json) → Attribute Value".

      This method is used when sending a job to Turing.

      Parameters:
      turSprinklrSource - Is used to find the turSprinklrAttributeMapping entity, it represents export.json file.
      token - N/A
      searchResult - If a CustomClass is defined by export.json file, the value will be extracted from searchResult
      Returns:
      the created HashMap
    • getTurSprinklrContext

      public TurSprinklrContext getTurSprinklrContext(TurSprinklrSearchResult searchResult, TurSprinklrAccessToken token)
      Builds a TurSprinklrContext object from a searchResult and a token object