public class DefaultCommonApplicationService<P extends Application> extends BaseCrudEntityService<P> implements CommonApplicationService<P>
Modifier and Type | Field and Description |
---|---|
static String |
CACHE_BY_APPLICATION_CONTEXT_ID |
static String |
CACHE_BY_APPLICATION_URL |
Constructor and Description |
---|
DefaultCommonApplicationService(CommonApplicationRepository<Trackable> repository,
CrudEntityHelper helper) |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.web.util.UriComponents |
convertUrlToUri(@NonNull String url)
Converts a url to UriComponents
|
Optional<P> |
getApplicationFromRequestUrl(@NonNull String requestUrl)
Find an Application by a given request url
|
protected Optional<P> |
getApplicationFromUri(org.springframework.web.util.UriComponents uri)
Returns an application that matches the request uri, specifically looking at the host
|
P |
readByContextId(String id,
ContextInfo context)
Read a single instance of an entity in the form of a business domain.
|
Optional<P> |
readByIdentifierValueAndIdentifierType(@NonNull String identifierValue,
@NonNull String identifierType)
Read an Application by its identifier value and type
|
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getRepository, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
public static final String CACHE_BY_APPLICATION_CONTEXT_ID
public static final String CACHE_BY_APPLICATION_URL
public DefaultCommonApplicationService(CommonApplicationRepository<Trackable> repository, CrudEntityHelper helper)
@Cacheable(value="trackingCacheByApplicationContextId", keyGenerator="trackingCacheByApplicationContextId", condition="@cacheStateManager.isEnabled(#root.caches, #root.args)") public P readByContextId(String id, ContextInfo context)
CrudEntityService
readByContextId
in interface CrudEntityService<P extends Application>
readByContextId
in class BaseCrudEntityService<P extends Application>
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.public Optional<P> readByIdentifierValueAndIdentifierType(@NonNull @NonNull String identifierValue, @NonNull @NonNull String identifierType)
CommonApplicationService
readByIdentifierValueAndIdentifierType
in interface CommonApplicationService<P extends Application>
identifierValue
- the value to look foridentifierType
- the identifier type of the application@Cacheable(value="trackingCacheByApplicationUrl", condition="@cacheStateManager.isEnabled(#root.caches, #root.args)") public Optional<P> getApplicationFromRequestUrl(@NonNull @NonNull String requestUrl)
CommonApplicationService
getApplicationFromRequestUrl
in interface CommonApplicationService<P extends Application>
requestUrl
- the url to try to match againstprotected Optional<P> getApplicationFromUri(org.springframework.web.util.UriComponents uri)
uri
- the UriComponents that make up the requestprotected org.springframework.web.util.UriComponents convertUrlToUri(@NonNull @NonNull String url)
url
- the url to convertCopyright © 2021. All rights reserved.