Class DefaultInventoryLocationService<L extends InventoryLocation>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<L>
com.broadleafcommerce.inventory.service.DefaultInventoryLocationService<L>
Type Parameters:
L -
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<L>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<L>, InventoryLocationService<L>

public class DefaultInventoryLocationService<L extends InventoryLocation> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<L> implements InventoryLocationService<L>
Service to store and retrieve InventoryLocation data.
Author:
Kelly Tisdell (ktisdell)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Double
    Constant for the mean radius of the Earth in Kilometers.
    static final Double
    This is the constant number of KM in a Mile.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultInventoryLocationService(InventoryLocationRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager mapper)
    Creates a new instance of DefaultInventoryLocationService.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Double[]
    calculateBoundedBox(Double latitude, Double longitude, Double distance)
    Returns an Double array with 4 values representing a bounding box: Min Latitude, Max Latitude, Min Longitude, Max Longitude
    protected Double
    We always convert to KM prior to finding the area.
    void
    delete(String contextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Deletes the InventoryLocation with the specified contextId.
    boolean
    existsByContextId(String contextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Indicates if an InventoryLocation exists with the specified contextId in the provided context.
    protected com.broadleafcommerce.data.tracking.core.mapping.DomainMapperManager
    Data Mapper to assist in data conversion.
    protected InventoryLocationRepository<com.broadleafcommerce.data.tracking.core.Trackable>
    Inventory Repository (or DAO).
     
     
    org.springframework.data.domain.Page<L>
    readAllByNameOrNumber(String nameOrNumberQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Read all Inventory Locations, optionally filtered by name or number.
    org.springframework.data.domain.Page<L>
    readAllLocationsByCountryCode(String countryCode, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Pageable query for InventoryLocation references with a particular country code.
    org.springframework.data.domain.Page<L>
    readAllLocationsByCountryCodeAndPostalCode(String countryCode, String postalCode, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Pageable query for InventoryLocation references with particular country code and postal code.
    org.springframework.data.domain.Page<L>
    readAllLocationsByCountryCodeAndStateProvinceRegionCode(String countryCode, String stateProvinceRegionCode, String city, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Pageable query for InventoryLocation references with a particular country code and state / province / region code.
    org.springframework.data.domain.Page<L>
    readAllLocationsByDistanceFromCoordinates(Double latitude, Double longitude, Double distance, DistanceType distanceType, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Query for all InventoryLocation references that are marked as shipping locations and have a latitude and longitude within a given distance of a provided coordinate.
    readByContextIdOptional(String contextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    An alternative to CrudEntityService.readByContextId(String, ContextInfo) that returns an Optional rather than throwing an exception if not found.
    readByLocationNumber(String locationNumber, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Query for InventoryLocation references with a given location number, which is an arbitrary reference number (e.g.
    readByPickupLocationTrue(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Returns all InventoryLocation references that are pickup locations.
    readByShippingLocationTrue(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Returns all InventoryLocation references that are shipping locations.
    org.springframework.data.domain.Page<L>
    readLocationsByLocationNumbers(Set<String> locationNumbers, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Query for InventoryLocation references with a given location number, which is an arbitrary reference number (e.g.
    org.springframework.data.domain.Page<L>
    readPickupLocationsByCountryCodeAndPostalCode(String countryCode, String postalCode, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Pageable query for InventoryLocation references that support pickup with a particular country code and postal code.
    org.springframework.data.domain.Page<L>
    readPickupLocationsByCountryCodeAndStateProvinceRegionCode(String countryCode, String stateProvinceRegionCode, String city, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Pageable query for InventoryLocation references that allow pickup with a particular country code and state / province / region code.
    org.springframework.data.domain.Page<L>
    readPickupLocationsByDistanceFromCoordinates(Double latitude, Double longitude, Double distance, DistanceType distanceType, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Query for all InventoryLocation references that are marked as pickup locations and have a latitude and longitude within a given distance of a provided coordinate.
    org.springframework.data.domain.Page<L>
    readShippingLocationsByCountryCodeAndPostalCode(String countryCode, String postalCode, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Pageable query for InventoryLocation references that support shipping with a particular country code and postal code.
    org.springframework.data.domain.Page<L>
    readShippingLocationsByCountryCodeAndStateProvinceRegionCode(String countryCode, String stateProvinceRegionCode, String city, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Pageable query for InventoryLocation references that allow shipping with a particular country code and state / province / region code.
    org.springframework.data.domain.Page<L>
    readShippingLocationsByDistanceFromCoordinates(Double latitude, Double longitude, Double distance, DistanceType distanceType, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Query for all InventoryLocation references that are marked as shipping locations and have a latitude and longitude within a given distance of a provided coordinate.
    org.springframework.data.domain.Page<L>
    readStoreLocationsByCountryCodeAndPostalCode(String countryCode, String postalCode, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Pageable query for InventoryLocation references that are "Stores" with a particular country code and postal code.
    org.springframework.data.domain.Page<L>
    readStoreLocationsByCountryCodeAndStateProvinceRegionCode(String countryCode, String stateProvinceRegionCode, String city, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Pageable query for InventoryLocation references that are "Stores" with a particular country code and state / province / region code.
    org.springframework.data.domain.Page<L>
    readStoreLocationsByDistanceFromCoordinates(Double latitude, Double longitude, Double distance, DistanceType distanceType, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Query for all InventoryLocation references that are marked as "Store" locations and have a latitude and longitude within a given distance of a provided coordinate.
    void
     

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService

    getRsqlHelper, readAll, readAll, readAll, readAll

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService

    convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService

    create, createAll, createAllAllowingPartialSuccess, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort