Interface CustomizedChangeDeployRepository<D>

All Superinterfaces:
com.broadleafcommerce.common.extension.DomainTypeAware
All Known Subinterfaces:
ChangeDeployRepository<D>, JpaChangeDeployRepository<D>
All Known Implementing Classes:
JpaCustomizedChangeDeployRepository

public interface CustomizedChangeDeployRepository<D> extends com.broadleafcommerce.common.extension.DomainTypeAware
Additional persistence operations to perform on ChangeDeploy repository domain.
Author:
Nathan Moore (nathandmoore), Phillip Verheyden (phillipuniverse)
  • Method Details

    • readByIdAndArchivedNot

      @Policy(operationTypes=READ) Optional<D> readByIdAndArchivedNot(String id, boolean archived, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Takes ChangeDeploy.getArchived() into account when retrieving a deployment with the given ID.
      Parameters:
      id - ID of the deployment to retrieve
      archived - ChangeDeploy.getArchived() value to not match
      vendorNarrowing - whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled
      contextInfo - context information about sandboxing and multitenant state
      Returns:
      A ChangeDeploy matching the given ID and not matching the given archived status
    • updateVals

      @Policy(operationTypes=UPDATE) Optional<D> updateVals(String changeDeployId, @Nullable List<String> whereStates, @Nullable List<String> whereStatuses, @Nullable String notificationStateName, Map<String,Object> vals)
      Update the fields for a record matching the id
      Parameters:
      changeDeployId - The id requested to mutate
      whereStates - The ChangeState values for which ChangeDeploy.getState() can match
      whereStatuses - The list of ChangeStatusType values for which ChangeDeploy.getStatus() should match one or more of, can be empty
      notificationStateName - (optional) the name of the notification state that should be used to filter in the notification states array. This is relevant for update operations that want to modify a specific notification state with update values specified in updateVals
      vals - Map of field to value changes to make to the ChangeSummaryGroup instance, cannot be empty
      Returns:
      An Optional containing the updated record if an update was performed, Optional.empty() otherwise
      Throws:
      IllegalArgumentException - if changeDeployId is not provided or vals is empty
    • updateVals

      @Policy(operationTypes=UPDATE) Optional<D> updateVals(String changeDeployId, @Nullable List<String> whereStates, @Nullable List<String> whereStatuses, @Nullable String notificationStateName, Map<String,Object> vals, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)

      Update the fields for a record matching the id

      Calling this method is the same as calling updateVals(String, List, List, String, Map, boolean, boolean, ContextInfo), but with the insertNotificationStateIfMissing parameter set to false.

      Parameters:
      changeDeployId - The id requested to mutate
      whereStates - The ChangeState values for which ChangeDeploy.getState() can match
      whereStatuses - The list of ChangeStatusType values for which ChangeDeploy.getStatus() should match one or more of, can be empty
      notificationStateName - (optional) the name of the notification state that should be used to filter in the notification states array. This is relevant for update operations that want to modify a specific notification state with update values specified in updateVals
      vals - Map of field to value changes to make to the ChangeSummaryGroup instance, cannot be empty
      vendorNarrowing - whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled
      contextInfo - context information about sandboxing and multitenant state
      Returns:
      An Optional containing the updated record if an update was performed, Optional.empty() otherwise
      Throws:
      IllegalArgumentException - if changeDeployId is not provided or vals is empty
    • updateVals

      @Policy(operationTypes=UPDATE) Optional<D> updateVals(String changeDeployId, @Nullable List<String> whereStates, @Nullable List<String> whereStatuses, @Nullable String notificationStateName, Map<String,Object> vals, boolean vendorNarrowing, boolean insertNotificationStateIfMissing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Update the fields for a record matching the id
      Parameters:
      changeDeployId - The id requested to mutate
      whereStates - The ChangeState values for which ChangeDeploy.getState() can match
      whereStatuses - The list of ChangeStatusType values for which ChangeDeploy.getStatus() should match one or more of, can be empty
      notificationStateName - (optional) the name of the notification state that should be used to filter in the notification states array. This is relevant for update operations that want to modify a specific notification state with update values specified in updateVals
      vals - Map of field to value changes to make to the ChangeSummaryGroup instance, cannot be empty
      vendorNarrowing - whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled
      insertNotificationStateIfMissing - if vals target a notification state and notificationStateName is provided, this flag determines whether the flow will newly insert the notification state if it does not already exist in the datastore. In other words, when this flag is false, the flow will only try to update an existing notification state with the provided details in vals. When this flag is true, if the update attempt is unsuccessful because the notification state is missing, the flow will attempt to newly insert that state into the datastore.
      contextInfo - context information about sandboxing and multitenant state
      Returns:
      An Optional containing the updated record if an update was performed, Optional.empty() otherwise
      Throws:
      IllegalArgumentException - if changeDeployId is not provided or vals is empty
      Since:
      Sandbox Service 2.0.6, Sandbox Service 2.1.3, Release Train 2.1.4, Release Train 2.2.0
      See Also:
    • readPageByApplicationAndStateAndArchivedNot

      @Deprecated @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> readPageByApplicationAndStateAndArchivedNot(@Nullable String applicationId, String state, @Nullable Boolean archived, @Nullable cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable)
      Retrieve a page of records filtered by application and state
      Parameters:
      applicationId - The ChangeDeploy.getApplication() valuke to filter results by
      state - The ChangeDeploy.getState() value to filter results by
      archived - ChangeDeploy.getArchived() value to not match
      filters - the RSQL Node used to restrict result
      pageable - The page setup information
      Returns:
      The page of records
    • readPageBySandboxAndStateAndArchivedNot

      @Policy(operationTypes=READ) org.springframework.data.domain.Page<D> readPageBySandboxAndStateAndArchivedNot(String sandbox, String state, @Nullable Boolean archived, @Nullable cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable, boolean vendorNarrowing, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Retrieve a page of records filtered by sandbox and state
      Parameters:
      sandbox - The ChangeDeploy.getSandbox() value to filter results by
      state - The ChangeDeploy.getState() value to filter results by
      archived - ChangeDeploy.getArchived() value to not match
      filters - the RSQL Node used to restrict result
      pageable - The page setup information
      vendorNarrowing - whether or not to filter results based on the current authentication's vendor restrictions if vendor processing is enabled
      contextInfo - context information about sandboxing and multitenant state
      Returns:
      The page of records
    • setAffectedVendors

      @Policy(operationTypes=UPDATE) @Nullable D setAffectedVendors(String deployId, boolean affectsNonVendorData, Set<String> affectedVendorRefs)
      Atomically finds the ChangeDeploy with the given deployId and sets its ChangeDeploy.isAffectsNonVendorData() and ChangeDeploy.getAffectedVendorRefs() to the provided values.

      Internally, this method should rely on data-store locking mechanisms to protect against concurrent mutations.

      Parameters:
      deployId - the ID of the deploy to update
      affectsNonVendorData - the new value to set for ChangeDeploy.isAffectsNonVendorData()
      affectedVendorRefs - the new value to set for ChangeDeploy.getAffectedVendorRefs(). Cannot be null, but can be empty.
      Returns:
      the updated deployment if the update was successful, null otherwise
    • removeFromAffectedVendors

      @Policy(operationTypes=UPDATE) boolean removeFromAffectedVendors(String deployId, String vendorRef)
      Atomically removes the given vendorRef from ChangeDeploy.getAffectedVendorRefs() of the given deployId if present.
      Parameters:
      deployId - the ID of the deploy to update
      vendorRef - the vendor ref to remove from ChangeDeploy.getAffectedVendorRefs()
      Returns:
      true if the removal was successful, false otherwise
    • cleanupBatch

      @Policy(operationTypes=UPDATE) @Nullable String cleanupBatch(@Nullable String startingId, List<ChangeStatusType> detectStatuses, List<ChangeState> detectStates, ChangeStatusType targetStatus, ChangeState targetState, List<ChangeStatusType> summaryDetectStatuses, List<ChangeState> summaryDetectStates, Object source)
      Check a bag of ChangeDeploy entities for completion state. If complete, update status and state.
      Parameters:
      startingId - The ChangeDeploy entity id that represents the start of the collection of entities to check. The size of the collection is determined by CompletionCleanupProperties.getCleanupBatchSize().
      detectStatuses - The list of statuses to match. One of these statuses must match an entity status to be considered as part of the cleanup routine.
      detectStates - The list of states to match. One of these statuses must match an entity state to be considered as part of the cleanup routine.
      targetStatus - The status to set on one or more entities if determined to be complete
      targetState - The state to set on one or more entities if determined to be complete
      summaryDetectStatuses - The list of associated ChangeSummary statuses to NOT match. Associated ChangeSummary instances must not be in any of these statuses for the related ChangeDeploy to be considered complete.
      summaryDetectStates - The list of associated ChangeSummary states to NOT match. Associated ChangeSummary instances must not be in any of these states for the related ChangeDeploy to be considered complete.
      source - The specific cleanup service instance making the call
      Returns:
      The last ChangeDeploy entity id used as part of the executed batch. This value is interesting to provide as the startingId for subsequent calls to this method when performing a paged style execution approach. May be null if no values were found, or if fewer than the configured batch size were found.