# onap/usecase-ui-intent-analysis architecture

> Architecture diagram of the GitHub repository onap/usecase-ui-intent-analysis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/onap/usecase-ui-intent-analysis
- Repository: https://github.com/onap/usecase-ui-intent-analysis

## Overview

##### Main Components
- Intent Analysis Application: At the center of the system is the Java application represented by IntentAnalysisApplication.java. This is the entry point into the system.
- API/Controller Layer: Under the “controller” package, you have several REST endpoints (e.g., IntentController, IntentInstanceController, IntentReportController, IMFRegInfoController, etc.). These components handle incoming HTTP requests.
- Service Layer: The “service” and “service/impl” packages encapsulate the business logic (e.g., IntentService, ConditionService, ContextService, etc.).
- Business Modules: There are specialized intent management functions (for business, assurance, delivery, format intent input) located under packages like cllBusinessIntentMgt, cllassuranceIntentmgt, clldeliveryIntentmgt, and formatintentinputMgt. Each of these is further divided into Actuation, Decision, and Knowledge modules.
- Data Access Layer: The “mapper” packages and MyBatis SQL files (under intentanalysis/src/main/resources/mybatis/sql) indicate that persistence is handled via MyBatis. The “bean” models define the data structures going in and out of the data access layer.
- External Adapter Integrations: Multiple adapter packages exist for external incoming and outgoing communications:
- AAI Adapter: Provides integration with the AAI system.
- DCAE/DMAAP Adapter: Manages interactions with DCAE for notifications, DMAAP for messaging.
- Policy Adapter: Connects with Policy services.
- SO (Service Orchestrator) Adapter: Facilitates communication with SO systems.
- Framework & Configurations: Configuration files such as application.yaml, keystore files, and MyBatis mapping resources are critical to understand how the app is configured and deployed.
- Thread/Async Execution: The “ThreadPoolConfig” and related components under the “Thread” package indicate the usage of concurrent processing, which should be represented.

##### Relationships and Interactions
- Business Logic: From services, indicate the delegation to the appropriate Business Modules (for instance, different intent management functions – Business, Assurance, Delivery, and Format Intent Input) where Actuation, Decision, and Knowledge modules are executed.

##### Architectural Patterns and Design Principles
- Layered Architecture: The separation into controllers, services, and data access layers is a classic layered (or n-tier) architecture.
- Modular Design: The existence of discrete modules for each intent management function (business, assurance, delivery, etc.) demonstrates modular design.
- Adapter Pattern: The adapter packages describe how external integrations are abstracted behind interface implementations.
- Asynchronous Event Handling: The use of thread pools and event listeners emphasizes asynchronous processing for notification handling.
- Dependency Injection & Configuration: Spring’s conventions are likely in place given the use of application.yaml and SpringContextUtil.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Intent Analysis Server"
        Client("External Client"):::external
        App("Intent Analysis Application"):::app
        Controllers("API/Controller Layer"):::controller
        Services("Service Layer"):::service
        subgraph "Business Modules"
            Business("Business Intent"):::business
            Assurance("Assurance Intent"):::assurance
            Delivery("Delivery Intent"):::delivery
            Format("Format Intent Input"):::format
        end
        DataAccess("Data Access Layer (MyBatis)"):::persistence
        subgraph "External Adapters"
            AAI("AAI Adapter"):::adapter
            DCAE("DCAE/DMAAP Adapter"):::adapter
            Policy("Policy Adapter"):::adapter
            SO("SO Adapter"):::adapter
        end
        Async("Thread/Async Execution"):::async
        Config("Framework & Configurations"):::config
        Deployment("Deployment & Release"):::deploy
    end

    Client -->|"sendsHTTPRequest"| Controllers
    Controllers -->|"routesTo"| App
    Controllers -->|"delegatesTo"| Services
    Services -->|"invokes"| Business
    Services -->|"invokes"| Assurance
    Services -->|"invokes"| Delivery
    Services -->|"invokes"| Format
    Services -->|"accesses"| DataAccess
    Services -->|"calls"| AAI
    Services -->|"calls"| DCAE
    Services -->|"calls"| Policy
    Services -->|"calls"| SO
    Services -->|"handlesAsync"| Async
    Config -->|"configures"| App
    Deployment -->|"packages"| App

    %% Click Events
    click App "https://github.com/onap/usecase-ui-intent-analysis/blob/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/IntentAnalysisApplication.java"
    click Controllers "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/controller"
    click Services "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service"
    click Business "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllBusinessIntentMgt"
    click Assurance "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt"
    click Delivery "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt"
    click Format "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt"
    click DataAccess "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/mapper"
    click AAI "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/adapters/aai"
    click DCAE "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/adapters/dcae"
    click DCAE "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/adapters/dmaap"
    click Policy "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/adapters/policy"
    click SO "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/adapters/so"
    click Async "https://github.com/onap/usecase-ui-intent-analysis/tree/master/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/Thread"
    click Config "https://github.com/onap/usecase-ui-intent-analysis/blob/master/intentanalysis/src/main/resources/application.yaml"
    click Deployment "https://github.com/onap/usecase-ui-intent-analysis/tree/master/standalone/src/main/assembly/Dockerfile"

    %% Styles
    classDef external fill:#f9f,stroke:#333,stroke-width:2px;
    classDef app fill:#ccf,stroke:#333,stroke-width:2px;
    classDef controller fill:#bbf,stroke:#333,stroke-width:2px;
    classDef service fill:#bfb,stroke:#333,stroke-width:2px;
    classDef business fill:#f99,stroke:#333,stroke-width:2px;
    classDef assurance fill:#f77,stroke:#333,stroke-width:2px;
    classDef delivery fill:#f55,stroke:#333,stroke-width:2px;
    classDef format fill:#f33,stroke:#333,stroke-width:2px;
    classDef persistence fill:#ddd,stroke:#333,stroke-width:2px;
    classDef adapter fill:#ffa,stroke:#333,stroke-width:2px;
    classDef async fill:#cf9,stroke:#333,stroke-width:2px;
    classDef config fill:#9cf,stroke:#333,stroke-width:2px;
    classDef deploy fill:#9fc,stroke:#333,stroke-width:2px;
```
