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 TypeMethodDescriptioncreateWithIdIfDoesNotExist
(P sandbox, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) This is a custom create method that will override the autogenerated context ID produced byCreateSetupDomainMapperMember
, and instead use theSandbox.id
that is supplied in the givensandbox
.boolean
existsByApplication
(String applicationId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Determines whether anySandboxes
exist for the applicationorg.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 namereadByContextIdAndApplication
(String id, String applicationId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read the sandbox by ID for the current applicationvoid
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 applicationMethods 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 byCreateSetupDomainMapperMember
, and instead use theSandbox.id
that is supplied in the givensandbox
.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 thecontextId
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 itsSandbox.id
setcontextInfo
- 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 resultsapplicationId
- Id of the application that owns the sandbox. Null if not application-owned.filters
- additional filters to apply in the query, can be nullpageInfo
- results paging infocontext
- 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 nullpageInfo
- results paging infocontext
- 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 anySandboxes
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
-