Class HalCachingLinkResolver
java.lang.Object
org.camunda.bpm.engine.rest.hal.cache.HalCachingLinkResolver
- All Implemented Interfaces:
HalLinkResolver
- Direct Known Subclasses:
HalIdentityLinkResolver,HalIdResourceCacheLinkResolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CachegetCache()protected abstract Class<?>protected Comparator<HalResource<?>>protected abstract StringgetResourceId(HalResource<?> resource) protected voidputIntoCache(List<HalResource<?>> notCachedResources) Put a resource into the cache.protected List<HalResource<?>>resolveCachedLinks(String[] linkedIds, Cache cache, List<String> notCachedLinkedIds) Returns a list with all resources which are cached.List<HalResource<?>>resolveLinks(String[] linkedIds, ProcessEngine processEngine) Resolve resources for linked ids, if configured uses a cache.protected abstract List<HalResource<?>>resolveNotCachedLinks(String[] linkedIds, ProcessEngine processEngine) protected voidsortResolvedResources(List<HalResource<?>> resolvedResources) Sort the resolved resources to ensure consistent order of resolved resources.
-
Constructor Details
-
HalCachingLinkResolver
public HalCachingLinkResolver()
-
-
Method Details
-
resolveLinks
Resolve resources for linked ids, if configured uses a cache.- Specified by:
resolveLinksin interfaceHalLinkResolver
-
sortResolvedResources
Sort the resolved resources to ensure consistent order of resolved resources. -
getCache
- Returns:
- the cache for this resolver
-
resolveCachedLinks
protected List<HalResource<?>> resolveCachedLinks(String[] linkedIds, Cache cache, List<String> notCachedLinkedIds) Returns a list with all resources which are cached.- Parameters:
linkedIds- the ids to resolvecache- the cache to usenotCachedLinkedIds- a list with ids which are not found in the cache- Returns:
- the cached resources
-
putIntoCache
Put a resource into the cache. -
getHalResourceClass
- Returns:
- the class of the entity which is resolved
-
getResourceComparator
- Returns:
- a comparator for this HAL resource if not overridden sorting is skipped
-
resolveNotCachedLinks
protected abstract List<HalResource<?>> resolveNotCachedLinks(String[] linkedIds, ProcessEngine processEngine) - Returns:
- the resolved resources which are currently not cached
-
getResourceId
- Returns:
- the id which identifies a resource in the cache
-