Interface ReadController<T>

Type Parameters:
T - The type of entity to read
All Known Implementing Classes:
FunctionLibraryController, RuleHelperController, RuleLibraryController

public interface ReadController<T>
Base interface for read operations in REST controllers.

This interface defines the standard contract for reading entities in the Beas Rule Engine. It provides a consistent API structure for GET operations across all entity types, including pagination and filtering.

The interface includes:

  • Standard GET endpoint mappings
  • Pagination support
  • RSQL query filtering
  • Individual entity retrieval
Since:
1.0
Version:
1.0
Author:
Beas Solution Team
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<T>
    Retrieves a single entity by its ID.
    org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<T>>
    read(String rsql, org.springframework.data.domain.Pageable pageable)
    Retrieves a paginated list of entities with optional filtering.
  • Method Details

    • read

      @GetMapping(path="/read") org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<T>> read(@RequestParam(value="search",required=false) String rsql, org.springframework.data.domain.Pageable pageable) throws OperationException
      Retrieves a paginated list of entities with optional filtering.

      This method handles the retrieval of entities with support for pagination and RSQL query filtering. The RSQL query allows for complex filtering, sorting, and selection operations.

      Parameters:
      rsql - RSQL query string for filtering and sorting
      pageable - Pagination parameters
      Returns:
      ResponseEntity containing a page of entities
      Throws:
      OperationException - if retrieval fails
    • read

      @GetMapping(path="/read/{id}") org.springframework.http.ResponseEntity<T> read(@PathVariable(value="id",required=true) String id) throws OperationException
      Retrieves a single entity by its ID.

      This method handles the retrieval of a specific entity by its unique identifier. The ID is provided as a path variable.

      Parameters:
      id - The unique identifier of the entity
      Returns:
      ResponseEntity containing the found entity
      Throws:
      OperationException - if entity is not found or retrieval fails