Class RuleLibraryController

java.lang.Object
com.beassolution.rule.controller.RuleLibraryController
All Implemented Interfaces:
CreateController<RuleLibrary>, DeleteController<RuleLibrary>, ReadController<RuleLibrary>, UpdateController<RuleLibrary>

@Validated @RestController("rulelibrary") @RequestMapping(name="rulelibrary", path="/rule-library") @CrossOrigin(origins="*", methods={OPTIONS,GET,PUT,DELETE,POST,PATCH}) public class RuleLibraryController extends Object implements CreateController<RuleLibrary>, ReadController<RuleLibrary>, UpdateController<RuleLibrary>, DeleteController<RuleLibrary>
REST controller for rule library operations.

This controller provides CRUD operations for rule libraries in the Beas Rule Engine. It manages the creation, reading, updating, and deletion of rule library entities.

Key operations include:

  • Create new rule libraries
  • Retrieve rule libraries with pagination and filtering
  • Update existing rule libraries
  • Delete rule libraries
Since:
1.0
Version:
1.0
Author:
Beas Solution Team
  • Constructor Details

    • RuleLibraryController

      public RuleLibraryController()
  • Method Details

    • create

      public org.springframework.http.ResponseEntity<RuleLibrary> create(RuleLibrary obj) throws OperationException
      Creates a new rule library.
      Specified by:
      create in interface CreateController<RuleLibrary>
      Parameters:
      obj - The rule library to create
      Returns:
      ResponseEntity containing the created rule library
      Throws:
      OperationException - if creation fails
    • read

      public org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<RuleLibrary>> read(String rsql, org.springframework.data.domain.Pageable pageable) throws OperationException
      Retrieves a paginated list of rule libraries with optional filtering.
      Specified by:
      read in interface ReadController<RuleLibrary>
      Parameters:
      rsql - RSQL query string for filtering and sorting
      pageable - Pagination parameters
      Returns:
      ResponseEntity containing a page of rule libraries
      Throws:
      OperationException - if retrieval fails
    • read

      public org.springframework.http.ResponseEntity<RuleLibrary> read(String id) throws OperationException
      Retrieves a single rule library by its ID.
      Specified by:
      read in interface ReadController<RuleLibrary>
      Parameters:
      id - The unique identifier of the rule library
      Returns:
      ResponseEntity containing the found rule library
      Throws:
      OperationException - if rule library is not found or retrieval fails
    • update

      public org.springframework.http.ResponseEntity<RuleLibrary> update(RuleLibrary obj) throws OperationException
      Updates an existing rule library.
      Specified by:
      update in interface UpdateController<RuleLibrary>
      Parameters:
      obj - The rule library with updated values
      Returns:
      ResponseEntity containing the updated rule library
      Throws:
      OperationException - if update fails or rule library not found
    • delete

      public org.springframework.http.ResponseEntity<HttpResponse<org.springframework.http.HttpStatus>> delete(String obj) throws OperationException
      Deletes a rule library by its ID.
      Specified by:
      delete in interface DeleteController<RuleLibrary>
      Parameters:
      obj - The unique identifier of the rule library to delete
      Returns:
      ResponseEntity containing the HTTP status response
      Throws:
      OperationException - if deletion fails or rule library not found