Class ExternalResourceLockProvider

    • Constructor Detail

      • ExternalResourceLockProvider

        public ExternalResourceLockProvider​(org.springframework.web.reactive.function.client.WebClient webClient,
                                            com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                            com.broadleafcommerce.common.extension.TypeFactory typeFactory,
                                            ExternalCartProperties properties)
    • Method Detail

      • obtainLock

        public String obtainLock​(@NonNull
                                 @NonNull String contextId,
                                 @NonNull
                                 @NonNull String conceptKey,
                                 @Nullable
                                 com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ResourceLockProvider
        Obtains a resource lock.
        Specified by:
        obtainLock in interface ResourceLockProvider
        Parameters:
        contextId - the context ID of the entity to lock
        conceptKey - some key indicating what is being locked or by who
        contextInfo - the context of the request
        Returns:
        a token that can be used to release the lock
      • executeRequest

        protected <T> T executeRequest​(Supplier<T> request)
        Description copied from class: AbstractExternalProvider
        Executes a request with default Web Client error handling.
        Overrides:
        executeRequest in class AbstractExternalProvider
        Type Parameters:
        T - the return type of the request operation
        Parameters:
        request - the request to execute
        Returns:
        the value generated by the supplier
      • getStringMapType

        protected org.springframework.core.ParameterizedTypeReference<Map<String,​String>> getStringMapType()
      • getServiceClient

        protected String getServiceClient()