Class DefaultCommonApplicationService<P extends Application>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.tenant.service.DefaultCommonApplicationService<P>
All Implemented Interfaces:
CrudEntityService<P>, CommonApplicationService<P>

public class DefaultCommonApplicationService<P extends Application> extends BaseCrudEntityService<P> implements CommonApplicationService<P>
  • Field Details

  • Constructor Details

  • Method Details

    • readByContextId

      @Cacheable(value="trackingCacheByApplicationContextId", keyGenerator="trackingCacheByApplicationContextId", condition="@cacheStateManager.isEnabled(#root.caches, #root.args)") public P readByContextId(String id, ContextInfo context)
      Description copied from interface: CrudEntityService
      Read a single instance of an entity in the form of a business domain.
      Specified by:
      readByContextId in interface CrudEntityService<P extends Application>
      Overrides:
      readByContextId in class BaseCrudEntityService<P extends Application>
      Parameters:
      id - The context id for the entity. This is the id by which the business recognizes the item.
      context - Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.
      Returns:
      The narrowed entity instance in the form of a business instance
    • readByIdentifierValueAndIdentifierType

      public Optional<P> readByIdentifierValueAndIdentifierType(@NonNull @NonNull String identifierValue, @NonNull @NonNull String identifierType)
      Description copied from interface: CommonApplicationService
      Read an Application by its identifier value and type
      Specified by:
      readByIdentifierValueAndIdentifierType in interface CommonApplicationService<P extends Application>
      Parameters:
      identifierValue - the value to look for
      identifierType - the identifier type of the application
      Returns:
      the application that matches the identifier value
    • getApplicationFromRequestUrl

      @Cacheable(value="trackingCacheByApplicationUrl", condition="@cacheStateManager.isEnabled(#root.caches, #root.args)") public Optional<P> getApplicationFromRequestUrl(@NonNull @NonNull String requestUrl)
      Description copied from interface: CommonApplicationService
      Find an Application by a given request url
      Specified by:
      getApplicationFromRequestUrl in interface CommonApplicationService<P extends Application>
      Parameters:
      requestUrl - the url to try to match against
      Returns:
      an Application associated with the given url
    • getApplicationFromUri

      protected Optional<P> getApplicationFromUri(org.springframework.web.util.UriComponents uri)
      Returns an application that matches the request uri, specifically looking at the host
      Parameters:
      uri - the UriComponents that make up the request
      Returns:
      optional containing the Application that matches the request
    • convertUrlToUri

      protected org.springframework.web.util.UriComponents convertUrlToUri(@NonNull @NonNull String url)
      Converts a url to UriComponents
      Parameters:
      url - the url to convert
      Returns:
      UriComponents for the given url