Class DataFeedPublicationConfigurationService
java.lang.Object
com.broadleafcommerce.datafeed.service.publisher.configuration.DataFeedPublicationConfigurationService
This is a centralized service component that provides access to
DataFeedPublicationConfiguration instances.-
Constructor Summary
ConstructorsConstructorDescriptionDataFeedPublicationConfigurationService(List<DataFeedPublicationConfigurationContributor> configurationContributors) -
Method Summary
Modifier and TypeMethodDescriptiongetAllByFeedProcessTypeWithContextFiltration(@NonNull String feedProcessType, @NonNull String tenantId, @NonNull String applicationId) Fetches theDataFeedPublicationConfigurationmatching the givenDataFeedPublicationConfiguration.getFeedProcessType()and filters out the result if it does not exactly match the provided context.Fetches theDataFeedPublicationConfigurationmatching the givenDataFeedPublicationConfiguration.getId().getByIdWithContextFiltration(@NonNull String dataFeedPublicationConfigurationId, @NonNull String tenantId) Similar togetById(String), but filters out the result if it does not exactly match the provided context.getByIdWithContextFiltration(String dataFeedPublicationConfigurationId, @NonNull String tenantId, @NonNull String applicationId) Similar togetById(String), but filters out the result if it does not exactly match the provided context.protected Map<String,DataFeedPublicationConfiguration> An immutable map ofDataFeedPublicationConfigurationbyDataFeedPublicationConfiguration.getId().protected voidprocessConfigurationFromContributor(DataFeedPublicationConfiguration configurationFromContributor, Map<String, DataFeedPublicationConfiguration> targetMap) Validates the givenDataFeedPublicationConfigurationand adds it to thetargetMapif valid.protected Map<String,DataFeedPublicationConfiguration> processContributors(List<DataFeedPublicationConfigurationContributor> configurationContributors) Invokes any givenDataFeedPublicationConfigurationContributorcomponents and validates + loads their contributedDataFeedPublicationConfigurationinstances into a map by their IDs.validateContributedConfiguration(DataFeedPublicationConfiguration configuration) Validates the givenDataFeedPublicationConfigurationand returns error(s) if any were encountered.
-
Constructor Details
-
DataFeedPublicationConfigurationService
public DataFeedPublicationConfigurationService(@Nullable List<DataFeedPublicationConfigurationContributor> configurationContributors)
-
-
Method Details
-
processContributors
protected Map<String,DataFeedPublicationConfiguration> processContributors(@Nullable List<DataFeedPublicationConfigurationContributor> configurationContributors) Invokes any givenDataFeedPublicationConfigurationContributorcomponents and validates + loads their contributedDataFeedPublicationConfigurationinstances into a map by their IDs.- Parameters:
configurationContributors- contributors from which to getDataFeedPublicationConfigurationinstances- Returns:
- a map of
DataFeedPublicationConfigurationinstances by ID
-
processConfigurationFromContributor
protected void processConfigurationFromContributor(DataFeedPublicationConfiguration configurationFromContributor, Map<String, DataFeedPublicationConfiguration> targetMap) Validates the givenDataFeedPublicationConfigurationand adds it to thetargetMapif valid.- Parameters:
configurationFromContributor- the configuration to processtargetMap- the map to add the configuration to (by id) if validations pass
-
validateContributedConfiguration
protected List<String> validateContributedConfiguration(DataFeedPublicationConfiguration configuration) Validates the givenDataFeedPublicationConfigurationand returns error(s) if any were encountered.- Parameters:
configuration- the configuration to validate- Returns:
- empty list if no errors were found, else a list containing validation errors
-
getById
public Optional<DataFeedPublicationConfiguration> getById(String dataFeedPublicationConfigurationId) Fetches theDataFeedPublicationConfigurationmatching the givenDataFeedPublicationConfiguration.getId().This method does not perform any context-based filtration on fields such as
DataFeedPublicationConfiguration.getApplicationIdHint()orDataFeedPublicationConfiguration.getTenantIdHint().- Parameters:
dataFeedPublicationConfigurationId- the ID of the configuration to fetch- Returns:
- an
Optionalcontaining the configuration matching the given ID if found,Optional.empty()otherwise - See Also:
-
getByIdWithContextFiltration
public Optional<DataFeedPublicationConfiguration> getByIdWithContextFiltration(String dataFeedPublicationConfigurationId, @NonNull @NonNull String tenantId, @NonNull @NonNull String applicationId) Similar togetById(String), but filters out the result if it does not exactly match the provided context.- Parameters:
dataFeedPublicationConfigurationId- the ID of the configuration to fetchtenantId- the tenant ID to match againstDataFeedPublicationConfiguration.getTenantIdHint()applicationId- the application ID to match againstDataFeedPublicationConfiguration.getApplicationIdHint()- Returns:
- an
Optionalcontaining the configuration matching the given ID if found,Optional.empty()otherwise - See Also:
-
getAllByFeedProcessTypeWithContextFiltration
public List<DataFeedPublicationConfiguration> getAllByFeedProcessTypeWithContextFiltration(@NonNull @NonNull String feedProcessType, @NonNull @NonNull String tenantId, @NonNull @NonNull String applicationId) Fetches theDataFeedPublicationConfigurationmatching the givenDataFeedPublicationConfiguration.getFeedProcessType()and filters out the result if it does not exactly match the provided context.- Parameters:
feedProcessType- the process typetenantId- the tenant ID to match againstDataFeedPublicationConfiguration.getTenantIdHint()applicationId- the application ID to match againstDataFeedPublicationConfiguration.getApplicationIdHint()- Returns:
- an
Optionalcontaining the configuration matching the given process type if found,Optional.empty()otherwise
-
getByIdWithContextFiltration
public Optional<DataFeedPublicationConfiguration> getByIdWithContextFiltration(@NonNull @NonNull String dataFeedPublicationConfigurationId, @NonNull @NonNull String tenantId) Similar togetById(String), but filters out the result if it does not exactly match the provided context.- Parameters:
dataFeedPublicationConfigurationId- the ID of the configuration to fetchtenantId- the tenant ID to match againstDataFeedPublicationConfiguration.getTenantIdHint()- Returns:
- an
Optionalcontaining the configuration matching the given ID if found,Optional.empty()otherwise
-
getPublicationConfigurationsById
An immutable map ofDataFeedPublicationConfigurationbyDataFeedPublicationConfiguration.getId().
-