How onap/cps works
Main components
• API/Interface Layer: There are several REST-related modules (for example, “cps-rest”, “cps-ncmp-rest”, and even a “policy-executor-stub”). These modules expose HTTP endpoints (for administration, data operations, and network configuration management) used by both internal and external clients.
• Business Logic and Service Layer: Modules like “cps-application” and “cps-service” implement the core functionality. They encapsulate services such as anchor management, dataspace configuration, module service, notification service, and query services.
• Event Handling and Asynchronous Communication: Modules such as “cps-events” and “cps-ncmp-events” indicate event-driven functionality in CPS. They likely produce and consume configuration change events (for example, using Kafka or similar messaging means), coordinating asynchronous updates.
• Persistence / Repository Layer: The “cps-ri” (repository integration) module looks responsible for integrating with the database layer (as seen from SQL changelogs and repository implementations). It manages data storage for configuration models, yang resources, and transaction data.
• Utility and Support Functions: The “cps-path-parser” module (driven by ANTLR grammars) provides functionality to parse CPS-specific path expressions. Other utility modules (e.g., checkstyle, test-tools) support code quality and testing.
• Integration and Testing: There are dedicated directories for integration tests (e.g., “integration-test”, “k6-tests”, “csit”) as well as Docker Compose configurations and release YAMLs to help containerize and deploy the services.
Relationships and Interactions
• The REST API modules serve as the entry points, receiving HTTP/REST requests.
• They forward requests into the core business logic (from the “cps-application” or “cps-service” modules) where CPS operations are executed.
• The business logic layer, in turn, interacts with the persistence layer (cps-ri) to query, update, and persist configuration data.
• As configuration changes occur, events are generated via the events modules. These events propagate to interested external services or clients.
• Utility modules like cps-path-parser support internal processing by validating, parsing, and mapping data paths.
• Additional integrations, such as caching (e.g., Hazelcast configurations in some modules) or Kafka setups in “cps-ncmp-service”, are also present to manage performance or asynchronous processing.
• The Docker Compose setups and documentation further indicate that the system is deployed as containerized microservices with external dependencies (databases, monitoring solutions like Prometheus/Grafana, etc.).
Highlighted Architectural Patterns and Design Principles
• Layered/Multi-Tier Architecture: Clear separation between API endpoints, business logic, persistence, and event handling.
• Modular/Microservices Design: The division into many Maven modules allows each component (REST API, service, events, persistence) to be developed, tested, and deployed somewhat independently.
• Event-Driven Architecture: With dedicated event modules, data operation events, NMCP-events, and asynchronous messaging patterns are core parts of the design.
• Use of External Configurations and DevOps: The presence of Docker Compose configurations and integration tests supports continuous integration and containerized deployment.
• Client/External Systems (Users, external management, etc.)
• API Layer (cps-rest, cps-ncmp-rest, etc.)
• Business Logic Layer (cps-application, cps-service, policy executor)
• Persistence Layer (cps-ri module and underlying databases)
• Messaging/Event Layer (cps-events, cps-ncmp-events, Kafka, etc.)
• Utility/Support (cps-path-parser, logging aspects, etc.)