Class TurSprinklrProcess
Object
TurSprinklrProcess
-
Constructor Summary
ConstructorsConstructorDescriptionTurSprinklrProcess
(String turingUrl, String turingApiKey, int jobSize, TurSprinklrAttributeMappingRepository turSprinklrAttributeMappingRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoid
getArticle
(TurSprinklrSource turSprinklrSource, TurSprinklrSearchResult searchResult, TurSprinklrAccessToken token) getJobItemAttributes
(TurSprinklrSource turSprinklrSource, TurSprinklrAccessToken token, TurSprinklrSearchResult searchResult) Returns a new HashMap of "Attribute(turing Field, Attribute Name from export.json) → Attribute Value".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.getTurSprinklrContext
(TurSprinklrSearchResult searchResult, TurSprinklrAccessToken token) Builds a TurSprinklrContext object from a searchResult and a token objectvoid
start
(TurSprinklrSource turSprinklrSource)
-
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
-
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 representsexport.json
file.token
- N/AsearchResult
- If a CustomClass is defined byexport.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
-