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 SummaryConstructorsConstructorDescriptionDataFeedPublicationConfigurationService(List<DataFeedPublicationConfigurationContributor> configurationContributors) 
- 
Method SummaryModifier 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- 
DataFeedPublicationConfigurationServicepublic DataFeedPublicationConfigurationService(@Nullable List<DataFeedPublicationConfigurationContributor> configurationContributors) 
 
- 
- 
Method Details- 
processContributorsprotected 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 get- DataFeedPublicationConfigurationinstances
- Returns:
- a map of DataFeedPublicationConfigurationinstances by ID
 
- 
processConfigurationFromContributorprotected void processConfigurationFromContributor(DataFeedPublicationConfiguration configurationFromContributor, Map<String, DataFeedPublicationConfiguration> targetMap) Validates the givenDataFeedPublicationConfigurationand adds it to thetargetMapif valid.- Parameters:
- configurationFromContributor- the configuration to process
- targetMap- the map to add the configuration to (by id) if validations pass
 
- 
validateContributedConfigurationprotected 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
 
- 
getByIdpublic 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:
 
- 
getByIdWithContextFiltrationpublic 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 fetch
- tenantId- the tenant ID to match against- DataFeedPublicationConfiguration.getTenantIdHint()
- applicationId- the application ID to match against- DataFeedPublicationConfiguration.getApplicationIdHint()
- Returns:
- an Optionalcontaining the configuration matching the given ID if found,Optional.empty()otherwise
- See Also:
 
- 
getAllByFeedProcessTypeWithContextFiltrationpublic 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 type
- tenantId- the tenant ID to match against- DataFeedPublicationConfiguration.getTenantIdHint()
- applicationId- the application ID to match against- DataFeedPublicationConfiguration.getApplicationIdHint()
- Returns:
- an Optionalcontaining the configuration matching the given process type if found,Optional.empty()otherwise
 
- 
getByIdWithContextFiltrationpublic 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 fetch
- tenantId- the tenant ID to match against- DataFeedPublicationConfiguration.getTenantIdHint()
- Returns:
- an Optionalcontaining the configuration matching the given ID if found,Optional.empty()otherwise
 
- 
getPublicationConfigurationsByIdAn immutable map ofDataFeedPublicationConfigurationbyDataFeedPublicationConfiguration.getId().
 
-