Interface CorrelationIdMappingCache
- All Known Implementing Classes:
SimpleCorrelationIdCache
public interface CorrelationIdMappingCache
A cache to hold user-specified correlation ids to their resource tier identifier counterpart
- Author:
- Phillip Verheyden (phillipuniverse)
-
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.common.dataimport.messaging.CorrelationIdMapping
Obtain a mapping for the given correlation id and import id from the cacheCollection<com.broadleafcommerce.common.dataimport.messaging.CorrelationIdMapping>
get
(String importId, Collection<String> correlationIds) Similar toget(String, Collection)
but queries the cache in bulkCollection<com.broadleafcommerce.common.dataimport.messaging.CorrelationIdMapping>
All of the correlationIds that this cache knows about for the given importvoid
put
(String importId, com.broadleafcommerce.common.dataimport.messaging.CorrelationIdMapping mapping) Add a new mapping from a correlation id in the file to a resource tier identifiervoid
Once an import has finished processing there is no more need to keep the cache around.
-
Method Details
-
get
@Nullable com.broadleafcommerce.common.dataimport.messaging.CorrelationIdMapping get(String importId, String correlationId) Obtain a mapping for the given correlation id and import id from the cache- Parameters:
importId
- import that this appears incorrelationId
- the correlation id that should be validated- Returns:
- the mapping that is in the cache or an empty optional if no value is supplied
-
get
Collection<com.broadleafcommerce.common.dataimport.messaging.CorrelationIdMapping> get(String importId, Collection<String> correlationIds) Similar toget(String, Collection)
but queries the cache in bulk- Parameters:
importId
- the import to validate correlation ids againstcorrelationIds
- the correlattion ids to obtain- Returns:
- the mappings found for the given correlationIds. While it is possible that this could
be less than the given
correlationIds
(or just empty if none were found) it should never exceed the size of the given ids to validate
-
put
void put(String importId, com.broadleafcommerce.common.dataimport.messaging.CorrelationIdMapping mapping) Add a new mapping from a correlation id in the file to a resource tier identifier- Parameters:
importId
- the relevant import for the mappingmapping
- the mapping of the import id to the correlationId
-
removeAll
Once an import has finished processing there is no more need to keep the cache around. This removes all of the entries from the cache- Parameters:
importId
- import to remove mappings for
-
getAll
Collection<com.broadleafcommerce.common.dataimport.messaging.CorrelationIdMapping> getAll(String importId) All of the correlationIds that this cache knows about for the given import- Parameters:
importId
- the import to obtain correlation id mappings for- Returns:
- all of the mappings found for the given import
-