Class DefaultFareSearchHashResolver
java.lang.Object
de.hybris.platform.travelfacades.fare.search.resolvers.impl.DefaultFareSearchHashResolver
- All Implemented Interfaces:
FareSearchHashResolver
Default implementation of the
FareSearchHashResolver-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRemoves all the session seeds associated to the differentprotected StringcreateDigest(byte[] message) Creates the String from the byte message passed as a parameter using an MD5 hashprotected StringgenerateDigest(ItineraryPricingInfoData itineraryPricingInfo, String seed) generateIdentifier(ItineraryPricingInfoData itineraryPricingInfo) Generates the identifier based on the seed stored in session and theItineraryPricingInfoDataprovidedgenerateIdentifier(ItineraryPricingInfoData itineraryPricingInfo, String masterBundleTemplateId) Generates the identifier based on the seed and theItineraryPricingInfoDataprovidedReturns a random string generated usingSecureRandomprotected StringgetSessionSearchSeed(String masterBundleTemplateId) Returns the search seed stored in session.protected de.hybris.platform.servicelayer.session.SessionServiceGets session service.protected TravelBundleTemplateFacadeGets travel bundle template facade.voidsetSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Sets session service.voidsetTravelBundleTemplateFacade(TravelBundleTemplateFacade travelBundleTemplateFacade) Sets travel bundle template facade.booleanvalidItineraryIdentifier(AddBundleToCartRequestData addBundleToCartRequestData, String itineraryIdentifier, String bundleType) Returns true if the identifier generated from theAddBundleToCartRequestDatamatches with the itineraryIdentifier and bundleType providedbooleanvalidItineraryIdentifier(List<ItineraryPricingInfoData> itineraryPricingInfos, String masterBundleTemplateId) Returns true if the identifier included in theItineraryPricingInfoDatamatches the products included in the offer.booleanvalidPackageItineraryIdentifier(ItineraryPricingInfoData itineraryPricingInfo) Returns true if the identifier included in theItineraryPricingInfoDatamatches the products included in the offer
-
Field Details
-
LOG
protected static final org.apache.log4j.Logger LOG
-
-
Constructor Details
-
DefaultFareSearchHashResolver
public DefaultFareSearchHashResolver()
-
-
Method Details
-
generateSeed
Description copied from interface:FareSearchHashResolverReturns a random string generated usingSecureRandom- Specified by:
generateSeedin interfaceFareSearchHashResolver- Returns:
-
generateIdentifier
Description copied from interface:FareSearchHashResolverGenerates the identifier based on the seed stored in session and theItineraryPricingInfoDataprovided- Specified by:
generateIdentifierin interfaceFareSearchHashResolver
-
generateIdentifier
public String generateIdentifier(ItineraryPricingInfoData itineraryPricingInfo, String masterBundleTemplateId) Description copied from interface:FareSearchHashResolverGenerates the identifier based on the seed and theItineraryPricingInfoDataprovided- Specified by:
generateIdentifierin interfaceFareSearchHashResolver
-
generateDigest
-
validItineraryIdentifier
public boolean validItineraryIdentifier(AddBundleToCartRequestData addBundleToCartRequestData, String itineraryIdentifier, String bundleType) Description copied from interface:FareSearchHashResolverReturns true if the identifier generated from theAddBundleToCartRequestDatamatches with the itineraryIdentifier and bundleType provided- Specified by:
validItineraryIdentifierin interfaceFareSearchHashResolver- Returns:
-
validItineraryIdentifier
public boolean validItineraryIdentifier(List<ItineraryPricingInfoData> itineraryPricingInfos, String masterBundleTemplateId) Description copied from interface:FareSearchHashResolverReturns true if the identifier included in theItineraryPricingInfoDatamatches the products included in the offer. Removes all the seeds from the session. This function in meant to be called from a deal page that reloads its content and regenerates the search seeds.- Specified by:
validItineraryIdentifierin interfaceFareSearchHashResolver- Returns:
-
validPackageItineraryIdentifier
Description copied from interface:FareSearchHashResolverReturns true if the identifier included in theItineraryPricingInfoDatamatches the products included in the offer- Specified by:
validPackageItineraryIdentifierin interfaceFareSearchHashResolver- Returns:
-
cleanSessionSeeds
protected void cleanSessionSeeds()Removes all the session seeds associated to the different -
getSessionSearchSeed
Returns the search seed stored in session. If not set, it generates a new one, sets it in session and returns it.- Parameters:
masterBundleTemplateId- the master bundle template id- Returns:
- session search seed
-
createDigest
Creates the String from the byte message passed as a parameter using an MD5 hash- Parameters:
message- the message- Returns:
- string
-
getSessionService
protected de.hybris.platform.servicelayer.session.SessionService getSessionService()Gets session service.- Returns:
- the session service
-
setSessionService
public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Sets session service.- Parameters:
sessionService- the session service
-
getTravelBundleTemplateFacade
Gets travel bundle template facade.- Returns:
- the travel bundle template facade
-
setTravelBundleTemplateFacade
Sets travel bundle template facade.- Parameters:
travelBundleTemplateFacade- the travel bundle template facade
-