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 Classes
    Modifier and Type
    Class
    Description
    protected static interface 
    A function that does not accept arguments and does not return a result.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(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
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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

      @FrameworkGetMapping("/{id}") @Policy(permissionRoots="SANDBOX") public Sandbox readById(jakarta.servlet.http.HttpServletRequest request, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id)
    • 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

      @FrameworkPostMapping(consumes="application/json") @Policy(permissionRoots="SANDBOX") public Sandbox create(jakarta.servlet.http.HttpServletRequest request, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestBody Sandbox req)
    • 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

      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.

      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

      protected void doWithoutPolicyValidation(SandboxEndpoint.VoidWork work)
      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