Class DefaultYmktConsentService
- java.lang.Object
-
- com.hybris.ymkt.consent.service.impl.DefaultYmktConsentService
-
- All Implemented Interfaces:
YmktConsentService
public class DefaultYmktConsentService extends java.lang.Object implements YmktConsentService
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationServiceconfigurationServiceprotected static java.lang.StringCONSENT_GIVENprotected ConsentFacadeconsentFacadeprotected FlexibleSearchServiceflexibleSearchServiceprotected SessionServicesessionServiceprotected static java.lang.StringUSER_CONSENTSprotected UserServiceuserService
-
Constructor Summary
Constructors Constructor Description DefaultYmktConsentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleangetAnonymousUserConsent(java.lang.String consentID)Read and return consent value from cookie for the current anonymous user's session given a consent template ID.protected java.util.Optional<java.lang.String>getConsentTemplateID(java.lang.String consentID)Look-up consent template ID from provided configuration propertyprotected booleangetRegisteredUserConsent(java.lang.String consentID)Read and return consent value for the current logged-in user given a consent template ID.booleangetUserConsent(java.lang.String consentID)Consent verification for current session user.booleangetUserConsent(java.lang.String customerId, java.lang.String consentId)Consent verification for provided customer.voidsetConfigurationService(ConfigurationService configurationService)voidsetConsentFacade(ConsentFacade consentFacade)voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)voidsetSessionService(SessionService sessionService)voidsetUserService(UserService userService)
-
-
-
Field Detail
-
CONSENT_GIVEN
protected static final java.lang.String CONSENT_GIVEN
- See Also:
- Constant Field Values
-
USER_CONSENTS
protected static final java.lang.String USER_CONSENTS
- See Also:
- Constant Field Values
-
configurationService
protected ConfigurationService configurationService
-
consentFacade
protected ConsentFacade consentFacade
-
flexibleSearchService
protected FlexibleSearchService flexibleSearchService
-
sessionService
protected SessionService sessionService
-
userService
protected UserService userService
-
-
Method Detail
-
getAnonymousUserConsent
protected boolean getAnonymousUserConsent(java.lang.String consentID)
Read and return consent value from cookie for the current anonymous user's session given a consent template ID.- Parameters:
consentID- String configuration property containing consent template ID- Returns:
- true if current anonymous user has given consent, false otherwise
-
getConsentTemplateID
protected java.util.Optional<java.lang.String> getConsentTemplateID(java.lang.String consentID)
Look-up consent template ID from provided configuration property- Parameters:
consentID- String configuration property containing consent template ID- Returns:
- String consent template ID
-
getRegisteredUserConsent
protected boolean getRegisteredUserConsent(java.lang.String consentID)
Read and return consent value for the current logged-in user given a consent template ID.- Parameters:
consentID- String configuration property containing consent template ID- Returns:
- true if current logged in user has given consent, false otherwise
-
getUserConsent
public boolean getUserConsent(java.lang.String consentID)
Description copied from interface:YmktConsentServiceConsent verification for current session user.- Specified by:
getUserConsentin interfaceYmktConsentService- Parameters:
consentID- Property prefix of yMKT consent Id.- Returns:
trueif the user has consent,falseotherwise.
-
getUserConsent
public boolean getUserConsent(java.lang.String customerId, java.lang.String consentId)Description copied from interface:YmktConsentServiceConsent verification for provided customer.- Specified by:
getUserConsentin interfaceYmktConsentService- Parameters:
customerId- Value ofCustomer.customerID.consentId- Value of yMKTConsentTemplate.id.- Returns:
trueif the customer has consent,falseotherwise.
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
setConsentFacade
public void setConsentFacade(ConsentFacade consentFacade)
-
setFlexibleSearchService
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
-
setSessionService
public void setSessionService(SessionService sessionService)
-
setUserService
public void setUserService(UserService userService)
-
-