Class SandboxEndpoint
java.lang.Object
com.broadleafcommerce.sandbox.web.endpoint.SandboxEndpoint
@FrameworkRestController
@FrameworkMapping("/sandboxes")
@DataRouteByExample(Sandbox.class)
public class SandboxEndpoint
extends Object
API for managing
Sandbox
instances.- Author:
- Jeff Fischer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
A function that does not accept arguments and does not return a result. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, Sandbox req) void
delete
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id) protected void
Since sandboxes are a tenant-level entity, policy validation normally rejects operations on sandboxes from application contexts or by application users.protected <T> T
doWithoutPolicyValidation
(Supplier<T> supplier) Since sandboxes are a tenant-level entity, policy validation normally rejects operations on sandboxes from application contexts or by application users.org.springframework.data.domain.Page<Sandbox>
readAll
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String name, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters) readById
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id) replace
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Sandbox req) update
(jakarta.servlet.http.HttpServletRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Sandbox req)
-
Constructor Details
-
SandboxEndpoint
-
-
Method Details
-
readAll
@FrameworkGetMapping @Policy(permissionRoots="SANDBOX") public org.springframework.data.domain.Page<Sandbox> readAll(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestParam(name="q",required=false) String name, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters) -
readById
-
update
@FrameworkPatchMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="SANDBOX") public Sandbox update(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Sandbox req) -
replace
@FrameworkPutMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="SANDBOX") public Sandbox replace(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Sandbox req) -
create
-
delete
@FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="SANDBOX") public void delete(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id) -
doWithoutPolicyValidation
Since sandboxes are a tenant-level entity, policy validation normally rejects operations on sandboxes from application contexts or by application users.This method is used to skip policy validation such that those operations can be successfully performed.
For security reasons, before calling this method, it is highly recommended to perform the minimum validation that the current application context matches the application of the target sandbox, and to place
@Policy
on the controller method itself.- Type Parameters:
T
- the type of the result- Parameters:
supplier
- some operation returning a result- Returns:
- the result of the operation
-
doWithoutPolicyValidation
Since sandboxes are a tenant-level entity, policy validation normally rejects operations on sandboxes from application contexts or by application users.This method is used to skip policy validation such that those operations can be successfully performed.
For security reasons, before calling this method, it is highly recommended to perform the minimum validation that the current application context matches the application of the target sandbox, and to place
@Policy
on the controller method itself.- Parameters:
work
- some operation to perform
-