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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity
<RuleLibrary> create
(RuleLibrary obj) Creates a new rule library.org.springframework.http.ResponseEntity
<HttpResponse<org.springframework.http.HttpStatus>> Deletes a rule library by its ID.org.springframework.http.ResponseEntity
<RuleLibrary> Retrieves a single rule library by its ID.org.springframework.http.ResponseEntity
<org.springframework.data.domain.Page<RuleLibrary>> Retrieves a paginated list of rule libraries with optional filtering.org.springframework.http.ResponseEntity
<RuleLibrary> update
(RuleLibrary obj) Updates an existing rule library.
-
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 interfaceCreateController<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 interfaceReadController<RuleLibrary>
- Parameters:
rsql
- RSQL query string for filtering and sortingpageable
- 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 interfaceReadController<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 interfaceUpdateController<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 interfaceDeleteController<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
-