Interface SandboxService<P extends Sandbox>

All Superinterfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
All Known Implementing Classes:
DefaultSandboxService

public interface SandboxService<P extends Sandbox> extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
Sandbox business domain specific version of CrudEntityService.
Author:
Jeff Fischer
  • Method Summary

    Modifier and Type
    Method
    Description
    createWithIdIfDoesNotExist(P sandbox, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    This is a custom create method that will override the autogenerated context ID produced by CreateSetupDomainMapperMember, and instead use the Sandbox.id that is supplied in the given sandbox.
    boolean
    existsByApplication(String applicationId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Determines whether any Sandboxes exist for the application
    org.springframework.data.domain.Page<P>
    readAllByApplication(String applicationId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Read all the sandboxes for the current application.
    org.springframework.data.domain.Page<P>
    readAllByNameAndApplication(String name, String applicationId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageInfo, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Read all the sandboxes for the current application with the given name
    readByContextIdAndApplication(String id, String applicationId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Read the sandbox by ID for the current application
    void
    validateExistsByContextIdAndApplication(String id, String applicationId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Validates that the sandbox with the given ID belongs to the current application

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService

    create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService

    readAll, readAll, readAll, readAll
  • Method Details

    • createWithIdIfDoesNotExist

      @Nullable P createWithIdIfDoesNotExist(P sandbox, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      This is a custom create method that will override the autogenerated context ID produced by CreateSetupDomainMapperMember, and instead use the Sandbox.id that is supplied in the given sandbox.

      This method will perform an atomic upsert, returning the sandbox if it was newly created, null otherwise. This differs from the normal save/create in that whether or not a new entity should be created is based on the contextId rather than the data-store ID.

      This method is solely intended for use in CreateSandboxRequestListener, and should not be used elsewhere.

      Parameters:
      sandbox - the sandbox to create, with its Sandbox.id set
      contextInfo - context information surrounding multitenant state
      Returns:
      the sandbox if it was newly created, null otherwise
    • readAllByNameAndApplication

      @NonNull org.springframework.data.domain.Page<P> readAllByNameAndApplication(@NonNull String name, @Nullable String applicationId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageInfo, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Read all the sandboxes for the current application with the given name
      Parameters:
      name - Name query by which to filter results
      applicationId - Id of the application that owns the sandbox. Null if not application-owned.
      filters - additional filters to apply in the query, can be null
      pageInfo - results paging info
      context - contains the application context
      Returns:
      all the valid (un-archived) sandboxes for the current application context
    • readAllByApplication

      @NonNull org.springframework.data.domain.Page<P> readAllByApplication(@Nullable String applicationId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable pageInfo, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Read all the sandboxes for the current application.
      Parameters:
      applicationId - Id of the application that owns the sandbox. Null if not application-owned.
      filters - additional filters to apply in the query, can be null
      pageInfo - results paging info
      context - contains the application context
      Returns:
      all the valid (un-archived) sandboxes for the current application context
    • readByContextIdAndApplication

      @NonNull P readByContextIdAndApplication(@NonNull String id, @Nullable String applicationId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Read the sandbox by ID for the current application
      Parameters:
      id - ID of the Sandbox.
      applicationId - Id of the application that owns the sandbox. Null if not application-owned.
      context - contains the application context
      Returns:
      all the valid (un-archived) sandboxes for the current application context
      Throws:
      com.broadleafcommerce.data.tracking.core.exception.EntityMissingException - Thrown if no matching Sandbox is found for the current application
    • validateExistsByContextIdAndApplication

      void validateExistsByContextIdAndApplication(@NonNull String id, @Nullable String applicationId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Validates that the sandbox with the given ID belongs to the current application
      Parameters:
      id - ID of the Sandbox.
      applicationId - Id of the application that owns the sandbox. Null if not application-owned.
      context - contains the application context
      Throws:
      com.broadleafcommerce.data.tracking.core.exception.EntityMissingException - Thrown if no sandbox with the given ID exists for the given application ID
    • existsByApplication

      boolean existsByApplication(@Nullable String applicationId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Determines whether any Sandboxes exist for the application
      Parameters:
      applicationId - Id of the application that owns the sandbox. Null if not application-owned.
      context - contains the application context
      Returns:
      Whether any Sandboxes exist for the application