Class DefaultConsignmentTrackingService
- java.lang.Object
-
- de.hybris.platform.consignmenttrackingservices.service.impl.DefaultConsignmentTrackingService
-
- All Implemented Interfaces:
ConsignmentTrackingService
public class DefaultConsignmentTrackingService extends java.lang.Object implements ConsignmentTrackingService
A default implementation of ConsignmentTrackingService.
-
-
Constructor Summary
Constructors Constructor Description DefaultConsignmentTrackingService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,CarrierAdaptor>getAllCarrierAdaptors()Get all carrier adaptors.protected BaseSiteServicegetBaseSiteService()protected java.util.Optional<CarrierAdaptor>getCarrierAdaptor(ConsignmentModel consignment)protected java.util.Map<java.lang.String,CarrierAdaptor>getCarrierAdaptors()protected ConfigurationServicegetConfigurationService()protected ConsignmentDaogetConsignmentDao()java.util.List<ConsignmentEventData>getConsignmentEvents(ConsignmentModel consignment)used by controller to handle incremental routes from carrierjava.util.Optional<ConsignmentModel>getConsignmentForCode(java.lang.String orderCode, java.lang.String consignmentCode)Query a ConsignmentModel for code.java.util.List<ConsignmentModel>getConsignmentsForOrder(java.lang.String orderCode)Get all consignments under the orderprotected intgetDefaultDeliveryLeadTime()get default delivery lead time from propertiesprotected java.net.URLgetDefaultTrackingUrl()get default tracking URL from propertiesintgetDeliveryLeadTime(ConsignmentModel consignment)provide the lead time of estimation from shipped to arrivalprotected ModelServicegetModelService()protected SiteBaseUrlResolutionServicegetSiteBaseUrlResolutionService()java.net.URLgetTrackingUrlForConsignment(ConsignmentModel consignment)tracking URL is given for display in frontend, if user wants to track package by jumping to carrier's websitebooleanisTrackingIdValid(ConsignmentModel consignment)check if the tracking ID is valid in a carrier providervoidsetBaseSiteService(BaseSiteService baseSiteService)voidsetCarrierAdaptors(java.util.Map<java.lang.String,CarrierAdaptor> carrierAdaptors)voidsetConfigurationService(ConfigurationService configurationService)voidsetConsignmentDao(ConsignmentDao consignmentDao)voidsetModelService(ModelService modelService)voidsetSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService)voidupdateConsignmentStatusForCode(java.lang.String orderCode, java.lang.String consignmentCode, ConsignmentStatus status)update consignment status and set arrival date if complete
-
-
-
Method Detail
-
getTrackingUrlForConsignment
public java.net.URL getTrackingUrlForConsignment(ConsignmentModel consignment)
Description copied from interface:ConsignmentTrackingServicetracking URL is given for display in frontend, if user wants to track package by jumping to carrier's website- Specified by:
getTrackingUrlForConsignmentin interfaceConsignmentTrackingService- Parameters:
consignment- the specific consignment- Returns:
- tracking URL
-
isTrackingIdValid
public boolean isTrackingIdValid(ConsignmentModel consignment)
Description copied from interface:ConsignmentTrackingServicecheck if the tracking ID is valid in a carrier provider- Specified by:
isTrackingIdValidin interfaceConsignmentTrackingService- Parameters:
consignment- the specific consignment- Returns:
- true if valid, otherwise false
-
getConsignmentEvents
public java.util.List<ConsignmentEventData> getConsignmentEvents(ConsignmentModel consignment)
Description copied from interface:ConsignmentTrackingServiceused by controller to handle incremental routes from carrier- Specified by:
getConsignmentEventsin interfaceConsignmentTrackingService- Parameters:
consignment- the specific consignment- Returns:
- latest consignment events
-
getConsignmentForCode
public java.util.Optional<ConsignmentModel> getConsignmentForCode(java.lang.String orderCode, java.lang.String consignmentCode)
Description copied from interface:ConsignmentTrackingServiceQuery a ConsignmentModel for code.- Specified by:
getConsignmentForCodein interfaceConsignmentTrackingService- Parameters:
orderCode- the code of this consignment's orderconsignmentCode- code of consignment- Returns:
- a instance of ConsignmentModel
-
getConsignmentsForOrder
public java.util.List<ConsignmentModel> getConsignmentsForOrder(java.lang.String orderCode)
Description copied from interface:ConsignmentTrackingServiceGet all consignments under the order- Specified by:
getConsignmentsForOrderin interfaceConsignmentTrackingService- Parameters:
orderCode- the order code- Returns:
- all consignment for the order
-
updateConsignmentStatusForCode
public void updateConsignmentStatusForCode(java.lang.String orderCode, java.lang.String consignmentCode, ConsignmentStatus status)Description copied from interface:ConsignmentTrackingServiceupdate consignment status and set arrival date if complete- Specified by:
updateConsignmentStatusForCodein interfaceConsignmentTrackingService- Parameters:
orderCode- the code of this consignment's orderconsignmentCode- the specific consignmentCodestatus- the new status from carrier
-
getDeliveryLeadTime
public int getDeliveryLeadTime(ConsignmentModel consignment)
Description copied from interface:ConsignmentTrackingServiceprovide the lead time of estimation from shipped to arrival- Specified by:
getDeliveryLeadTimein interfaceConsignmentTrackingService- Parameters:
consignment- the specific consignment- Returns:
- days of the lead time
-
getAllCarrierAdaptors
public java.util.Map<java.lang.String,CarrierAdaptor> getAllCarrierAdaptors()
Description copied from interface:ConsignmentTrackingServiceGet all carrier adaptors.- Specified by:
getAllCarrierAdaptorsin interfaceConsignmentTrackingService- Returns:
- map of adaptors.
-
getCarrierAdaptor
protected java.util.Optional<CarrierAdaptor> getCarrierAdaptor(ConsignmentModel consignment)
-
getDefaultTrackingUrl
protected java.net.URL getDefaultTrackingUrl()
get default tracking URL from properties- Returns:
- default tracking URL
-
getDefaultDeliveryLeadTime
protected int getDefaultDeliveryLeadTime()
get default delivery lead time from properties- Returns:
- default delivery lead time
-
getConfigurationService
protected ConfigurationService getConfigurationService()
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
getCarrierAdaptors
protected java.util.Map<java.lang.String,CarrierAdaptor> getCarrierAdaptors()
-
setCarrierAdaptors
public void setCarrierAdaptors(java.util.Map<java.lang.String,CarrierAdaptor> carrierAdaptors)
-
getConsignmentDao
protected ConsignmentDao getConsignmentDao()
-
setConsignmentDao
public void setConsignmentDao(ConsignmentDao consignmentDao)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getSiteBaseUrlResolutionService
protected SiteBaseUrlResolutionService getSiteBaseUrlResolutionService()
-
setSiteBaseUrlResolutionService
public void setSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService)
-
getBaseSiteService
protected BaseSiteService getBaseSiteService()
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService baseSiteService)
-
-