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 Type
    Method
    Description
    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
    Collection<com.broadleafcommerce.common.dataimport.messaging.CorrelationIdMapping>
    get(String importId, Collection<String> correlationIds)
    Similar to get(String, Collection) but queries the cache in bulk
    Collection<com.broadleafcommerce.common.dataimport.messaging.CorrelationIdMapping>
    getAll(String importId)
    All of the correlationIds that this cache knows about for the given import
    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
    void
    removeAll(String importId)
    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 in
      correlationId - 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 to get(String, Collection) but queries the cache in bulk
      Parameters:
      importId - the import to validate correlation ids against
      correlationIds - 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 mapping
      mapping - the mapping of the import id to the correlationId
    • removeAll

      void removeAll(String importId)
      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