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 Summary
-
Constructor Summary
ConstructorDescriptionDefaultCommonApplicationService
(CommonApplicationRepository<Trackable> repository, CrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.web.util.UriComponents
convertUrlToUri
(@NonNull String url) Converts a url to UriComponentsgetApplicationFromRequestUrl
(@NonNull String requestUrl) Find an Application by a given request urlgetApplicationFromUri
(org.springframework.web.util.UriComponents uri) Returns an application that matches the request uri, specifically looking at the hostreadByContextId
(String id, ContextInfo context) Read a single instance of an entity in the form of a business domain.readByIdentifierValueAndIdentifierType
(@NonNull String identifierValue, @NonNull String identifierType) Read an Application by its identifier value and typeMethods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getRepository, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, 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, delete, readAll, readAll, readAll, readAllByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
-
Field Details
-
CACHE_BY_APPLICATION_CONTEXT_ID
- See Also:
-
CACHE_BY_APPLICATION_URL
- See Also:
-
-
Constructor Details
-
DefaultCommonApplicationService
public DefaultCommonApplicationService(CommonApplicationRepository<Trackable> repository, CrudEntityHelper helper)
-
-
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 interfaceCrudEntityService<P extends Application>
- Overrides:
readByContextId
in classBaseCrudEntityService<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 interfaceCommonApplicationService<P extends Application>
- Parameters:
identifierValue
- the value to look foridentifierType
- 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 interfaceCommonApplicationService<P extends Application>
- Parameters:
requestUrl
- the url to try to match against- Returns:
- an Application associated with the given url
-
getApplicationFromUri
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
Converts a url to UriComponents- Parameters:
url
- the url to convert- Returns:
- UriComponents for the given url
-