public final class CustomerGroupServiceImpl extends java.lang.Object implements CustomerGroupService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CUSTOMER_GROUP_KEY_NOT_SET |
| Constructor and Description |
|---|
CustomerGroupServiceImpl(BaseSyncOptions syncOptions) |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletionStage<java.util.Optional<java.lang.String>> |
fetchCachedCustomerGroupId(java.lang.String key)
Given a
key, this method first checks if a cached map of customer group keys -> ids is not empty. |
public static final java.lang.String CUSTOMER_GROUP_KEY_NOT_SET
public CustomerGroupServiceImpl(@Nonnull
BaseSyncOptions syncOptions)
@Nonnull
public java.util.concurrent.CompletionStage<java.util.Optional<java.lang.String>> fetchCachedCustomerGroupId(@Nullable
java.lang.String key)
CustomerGroupServicekey, this method first checks if a cached map of customer group keys -> ids is not empty.
If not, it returns a completed future that contains an Optional that contains what this key maps to in
the cache. If the cache is empty, the method populates the cache with the mapping of all customer groups' keys to
ids in the CTP project, by querying the CTP project customer groups.
After that, the method returns a CompletionStage<Optional<String>>
in which the result of its completion could contain an Optional with the id inside of it or an empty
Optional if no CustomerGroup was found in the CTP project with this
key.
fetchCachedCustomerGroupId in interface CustomerGroupServicekey - the key by which a CustomerGroup id should be fetched from the CTP project.CompletionStage<Optional<String>> in which the result of its
completion could contain an Optional with the id inside of it or an empty Optional if no
CustomerGroup was found in the CTP project with this key or a blank (null/empty string) key was
supplied.