style: apply repository-wide formatting
- expand single-line Javadocs to multi-line blocks, rewrap Markdown prose, and reflow POM, YAML, and TypeScript formatting - formatting only: no Java code lines changed, no build-file semantics changed - verified: backend compile and check_documentation.py pass, pnpm check and pnpm lint:check pass, and the dc3 YAML files parse
@@ -2,6 +2,9 @@
|
||||
|
||||
- `svg/` contains editable source artwork. Do not reference these files from Markdown.
|
||||
- `png/` contains rendered assets for README files and other published uses.
|
||||
- Run `node .github/brand/gen-banners.mjs` from the repository root after changing the banner template, localized text, or social preview source.
|
||||
- Run `node .github/brand/gen-banners.mjs` from the repository root after changing the banner template, localized text,
|
||||
or social preview source.
|
||||
|
||||
The generator reads `svg/banner.template.svg`, refreshes the localized SVG sources, and renders their PNG counterparts into `png/`. It also renders `svg/social-preview.svg` to `png/social-preview.png`, keeping SVG files as editable sources and PNG files as the published assets.
|
||||
The generator reads `svg/banner.template.svg`, refreshes the localized SVG sources, and renders their PNG counterparts
|
||||
into `png/`. It also renders `svg/social-preview.svg` to `png/social-preview.png`, keeping SVG files as editable sources
|
||||
and PNG files as the published assets.
|
||||
|
||||
@@ -18,109 +18,109 @@ const pngDir = join(here, 'png')
|
||||
|
||||
// 各语言文案(与仓库根各 README 的 hero 主标语保持同一译法;SENSE–DECIDE–ACT 为品牌术语,各语言保留原文)
|
||||
const LANGS = {
|
||||
zh: {
|
||||
tagline: '多协议 · 云原生 · 开源工业物联网平台',
|
||||
techtags: '28+ 协议驱动 · 边云协同 · SENSE–DECIDE–ACT'
|
||||
},
|
||||
en: {
|
||||
tagline: 'Multi-protocol · Cloud-native · Open-source Industrial IoT Platform',
|
||||
techtags: '28+ PROTOCOL DRIVERS · EDGE-CLOUD · SENSE–DECIDE–ACT'
|
||||
},
|
||||
ja: {
|
||||
tagline: 'マルチプロトコル · クラウドネイティブ · オープンソース産業 IoT プラットフォーム',
|
||||
techtags: '28+ プロトコルドライバー · エッジ・クラウド協働 · SENSE–DECIDE–ACT'
|
||||
},
|
||||
ko: {
|
||||
tagline: '멀티 프로토콜 · 클라우드 네이티브 · 오픈소스 산업용 IoT 플랫폼',
|
||||
techtags: '28+ 프로토콜 드라이버 · 엣지-클라우드 · SENSE–DECIDE–ACT'
|
||||
},
|
||||
es: {
|
||||
tagline: 'Multiprotocolo · Nativa de la nube · Plataforma de IoT Industrial de Código Abierto',
|
||||
techtags: '28+ CONTROLADORES · BORDE-NUBE · SENSE–DECIDE–ACT'
|
||||
},
|
||||
ru: {
|
||||
tagline: 'Мультипротокольная · Облачно-нативная · Открытая платформа промышленного IoT',
|
||||
techtags: '28+ ДРАЙВЕРОВ · EDGE-CLOUD · SENSE–DECIDE–ACT'
|
||||
},
|
||||
vi: {
|
||||
tagline: 'Đa giao thức · Cloud-native · Nền tảng IoT Công nghiệp Mã nguồn Mở',
|
||||
techtags: '28+ DRIVER GIAO THỨC · EDGE-CLOUD · SENSE–DECIDE–ACT'
|
||||
}
|
||||
zh: {
|
||||
tagline: '多协议 · 云原生 · 开源工业物联网平台',
|
||||
techtags: '28+ 协议驱动 · 边云协同 · SENSE–DECIDE–ACT'
|
||||
},
|
||||
en: {
|
||||
tagline: 'Multi-protocol · Cloud-native · Open-source Industrial IoT Platform',
|
||||
techtags: '28+ PROTOCOL DRIVERS · EDGE-CLOUD · SENSE–DECIDE–ACT'
|
||||
},
|
||||
ja: {
|
||||
tagline: 'マルチプロトコル · クラウドネイティブ · オープンソース産業 IoT プラットフォーム',
|
||||
techtags: '28+ プロトコルドライバー · エッジ・クラウド協働 · SENSE–DECIDE–ACT'
|
||||
},
|
||||
ko: {
|
||||
tagline: '멀티 프로토콜 · 클라우드 네이티브 · 오픈소스 산업용 IoT 플랫폼',
|
||||
techtags: '28+ 프로토콜 드라이버 · 엣지-클라우드 · SENSE–DECIDE–ACT'
|
||||
},
|
||||
es: {
|
||||
tagline: 'Multiprotocolo · Nativa de la nube · Plataforma de IoT Industrial de Código Abierto',
|
||||
techtags: '28+ CONTROLADORES · BORDE-NUBE · SENSE–DECIDE–ACT'
|
||||
},
|
||||
ru: {
|
||||
tagline: 'Мультипротокольная · Облачно-нативная · Открытая платформа промышленного IoT',
|
||||
techtags: '28+ ДРАЙВЕРОВ · EDGE-CLOUD · SENSE–DECIDE–ACT'
|
||||
},
|
||||
vi: {
|
||||
tagline: 'Đa giao thức · Cloud-native · Nền tảng IoT Công nghiệp Mã nguồn Mở',
|
||||
techtags: '28+ DRIVER GIAO THỨC · EDGE-CLOUD · SENSE–DECIDE–ACT'
|
||||
}
|
||||
}
|
||||
|
||||
function loadPlaywright() {
|
||||
const candidates = [
|
||||
process.env.BANNER_PLAYWRIGHT_DIR,
|
||||
join(here, '..', '..', '..', 'iot-dc3-online', 'node_modules')
|
||||
].filter(Boolean)
|
||||
for (const root of candidates) {
|
||||
// createRequire 基准要放在包内部(pnpm 符号链接结构下,从 node_modules 目录本身解析会失败)
|
||||
const pkg = join(root, 'playwright', 'package.json')
|
||||
if (!existsSync(pkg)) continue
|
||||
try {
|
||||
return createRequire(pkg)('playwright')
|
||||
} catch {
|
||||
// try next candidate
|
||||
const candidates = [
|
||||
process.env.BANNER_PLAYWRIGHT_DIR,
|
||||
join(here, '..', '..', '..', 'iot-dc3-online', 'node_modules')
|
||||
].filter(Boolean)
|
||||
for (const root of candidates) {
|
||||
// createRequire 基准要放在包内部(pnpm 符号链接结构下,从 node_modules 目录本身解析会失败)
|
||||
const pkg = join(root, 'playwright', 'package.json')
|
||||
if (!existsSync(pkg)) continue
|
||||
try {
|
||||
return createRequire(pkg)('playwright')
|
||||
} catch {
|
||||
// try next candidate
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new Error('playwright 不可用:请在 iot-dc3-online 中安装依赖,或设置 BANNER_PLAYWRIGHT_DIR 指向含 playwright 的 node_modules')
|
||||
throw new Error('playwright 不可用:请在 iot-dc3-online 中安装依赖,或设置 BANNER_PLAYWRIGHT_DIR 指向含 playwright 的 node_modules')
|
||||
}
|
||||
|
||||
const template = await async function () {
|
||||
const {readFile} = await import('node:fs/promises')
|
||||
return readFile(join(svgDir, 'banner.template.svg'), 'utf-8')
|
||||
const {readFile} = await import('node:fs/promises')
|
||||
return readFile(join(svgDir, 'banner.template.svg'), 'utf-8')
|
||||
}()
|
||||
|
||||
for (const [lang, {tagline, techtags}] of Object.entries(LANGS)) {
|
||||
const svg = template.replaceAll('{{TAGLINE}}', tagline).replaceAll('{{TECHTAGS}}', techtags)
|
||||
await (await import('node:fs/promises')).writeFile(join(svgDir, `banner.${lang}.svg`), svg)
|
||||
const svg = template.replaceAll('{{TAGLINE}}', tagline).replaceAll('{{TECHTAGS}}', techtags)
|
||||
await (await import('node:fs/promises')).writeFile(join(svgDir, `banner.${lang}.svg`), svg)
|
||||
}
|
||||
|
||||
const {chromium} = loadPlaywright()
|
||||
const browserExecutable = [
|
||||
process.env.BANNER_BROWSER_PATH,
|
||||
'C:/Program Files/Google/Chrome/Application/chrome.exe',
|
||||
'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',
|
||||
'/usr/bin/google-chrome',
|
||||
'/usr/bin/chromium',
|
||||
'/usr/bin/chromium-browser'
|
||||
process.env.BANNER_BROWSER_PATH,
|
||||
'C:/Program Files/Google/Chrome/Application/chrome.exe',
|
||||
'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',
|
||||
'/usr/bin/google-chrome',
|
||||
'/usr/bin/chromium',
|
||||
'/usr/bin/chromium-browser'
|
||||
].filter(Boolean).find(existsSync)
|
||||
const browser = await chromium.launch(browserExecutable ? {executablePath: browserExecutable} : {})
|
||||
|
||||
async function assertTextWithinSafeArea(page, label) {
|
||||
const overflows = await page.$$eval('text[data-min-x], text[data-max-x]', nodes => nodes.flatMap(node => {
|
||||
const box = node.getBoundingClientRect()
|
||||
const left = box.left
|
||||
const right = box.right
|
||||
const minX = node.dataset.minX === undefined ? Number.NEGATIVE_INFINITY : Number(node.dataset.minX)
|
||||
const maxX = node.dataset.maxX === undefined ? Number.POSITIVE_INFINITY : Number(node.dataset.maxX)
|
||||
return left < minX - 0.5 || right > maxX + 0.5
|
||||
? [{text: node.textContent, left, right, minX, maxX}]
|
||||
: []
|
||||
}))
|
||||
if (overflows.length > 0) {
|
||||
throw new Error(`${label} text exceeds its safe area: ${JSON.stringify(overflows)}`)
|
||||
}
|
||||
const overflows = await page.$$eval('text[data-min-x], text[data-max-x]', nodes => nodes.flatMap(node => {
|
||||
const box = node.getBoundingClientRect()
|
||||
const left = box.left
|
||||
const right = box.right
|
||||
const minX = node.dataset.minX === undefined ? Number.NEGATIVE_INFINITY : Number(node.dataset.minX)
|
||||
const maxX = node.dataset.maxX === undefined ? Number.POSITIVE_INFINITY : Number(node.dataset.maxX)
|
||||
return left < minX - 0.5 || right > maxX + 0.5
|
||||
? [{text: node.textContent, left, right, minX, maxX}]
|
||||
: []
|
||||
}))
|
||||
if (overflows.length > 0) {
|
||||
throw new Error(`${label} text exceeds its safe area: ${JSON.stringify(overflows)}`)
|
||||
}
|
||||
}
|
||||
|
||||
for (const lang of Object.keys(LANGS)) {
|
||||
const page = await browser.newPage({viewport: {width: 1600, height: 420}, deviceScaleFactor: 2})
|
||||
await page.goto('file://' + join(svgDir, `banner.${lang}.svg`))
|
||||
await assertTextWithinSafeArea(page, `banner.${lang}`)
|
||||
await page.screenshot({
|
||||
path: join(pngDir, `banner.${lang}.png`),
|
||||
clip: {x: 0, y: 0, width: 1600, height: 420}
|
||||
})
|
||||
await page.close()
|
||||
console.log(`generated svg/banner.${lang}.svg / png/banner.${lang}.png`)
|
||||
const page = await browser.newPage({viewport: {width: 1600, height: 420}, deviceScaleFactor: 2})
|
||||
await page.goto('file://' + join(svgDir, `banner.${lang}.svg`))
|
||||
await assertTextWithinSafeArea(page, `banner.${lang}`)
|
||||
await page.screenshot({
|
||||
path: join(pngDir, `banner.${lang}.png`),
|
||||
clip: {x: 0, y: 0, width: 1600, height: 420}
|
||||
})
|
||||
await page.close()
|
||||
console.log(`generated svg/banner.${lang}.svg / png/banner.${lang}.png`)
|
||||
}
|
||||
|
||||
const socialPage = await browser.newPage({viewport: {width: 1200, height: 600}})
|
||||
await socialPage.goto('file://' + join(svgDir, 'social-preview.svg'))
|
||||
await assertTextWithinSafeArea(socialPage, 'social preview')
|
||||
await socialPage.screenshot({
|
||||
path: join(pngDir, 'social-preview.png'),
|
||||
clip: {x: 0, y: 0, width: 1200, height: 600}
|
||||
path: join(pngDir, 'social-preview.png'),
|
||||
clip: {x: 0, y: 0, width: 1200, height: 600}
|
||||
})
|
||||
await socialPage.close()
|
||||
console.log('generated svg/social-preview.svg / png/social-preview.png')
|
||||
|
||||
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 20 KiB |
@@ -13,22 +13,23 @@ Canonical engineering instructions for AI coding agents working in IoT DC3.
|
||||
|
||||
Avoid copying volatile versions or generated state into documentation. Verify them at the source:
|
||||
|
||||
| Concern | Source of truth |
|
||||
|---|---|
|
||||
| Java, Spring, Maven plugins and reactor modules | root `pom.xml` and affected module POMs |
|
||||
| Backend build commands | root `Makefile` |
|
||||
| Frontend dependencies and scripts | `dc3-web/package.json` and `dc3-web/pnpm-lock.yaml` |
|
||||
| Frontend build image/tool pins | `dc3-web/Dockerfile` |
|
||||
| Containers and registries | root `Makefile`, `.env.example`, and `dc3/docker-compose*.yml` |
|
||||
| CI behaviour | `.github/workflows/` |
|
||||
| Release notes | `dc3/bin/changelog.py` and generated `dc3/doc/CHANGE.md` |
|
||||
| Concern | Source of truth |
|
||||
|-------------------------------------------------|----------------------------------------------------------------|
|
||||
| Java, Spring, Maven plugins and reactor modules | root `pom.xml` and affected module POMs |
|
||||
| Backend build commands | root `Makefile` |
|
||||
| Frontend dependencies and scripts | `dc3-web/package.json` and `dc3-web/pnpm-lock.yaml` |
|
||||
| Frontend build image/tool pins | `dc3-web/Dockerfile` |
|
||||
| Containers and registries | root `Makefile`, `.env.example`, and `dc3/docker-compose*.yml` |
|
||||
| CI behaviour | `.github/workflows/` |
|
||||
| Release notes | `dc3/bin/changelog.py` and generated `dc3/doc/CHANGE.md` |
|
||||
|
||||
If this file disagrees with executable configuration, treat the executable configuration as current and update this
|
||||
file as part of the same change when appropriate.
|
||||
If this file disagrees with executable configuration, treat the executable configuration as current and update this file
|
||||
as part of the same change when appropriate.
|
||||
|
||||
## Project overview
|
||||
|
||||
IoT DC3 is a multi-protocol, cloud-native, open-source industrial IoT platform evolving toward AI agents. Its main runtime areas are:
|
||||
IoT DC3 is a multi-protocol, cloud-native, open-source industrial IoT platform evolving toward AI agents. Its main
|
||||
runtime areas are:
|
||||
|
||||
- Gateway: HTTP entrypoint through Spring Cloud Gateway.
|
||||
- Auth Center: tenant, token, user, role, resource, and API authorization.
|
||||
@@ -81,14 +82,14 @@ Controller (WebFlux) -> Service (BO) -> Manager (DO) -> Mapper (SQL)
|
||||
|
||||
Common types:
|
||||
|
||||
| Type | Module | Role |
|
||||
|---|---|---|
|
||||
| `BaseService<B,Q>` | `dc3-common-public` | base CRUD service contract |
|
||||
| `BaseController` | `dc3-common-web` | reactive controller helpers and user/tenant context |
|
||||
| `R<T>` | `dc3-common-public` | standard response envelope; use `R.ok(...)` and `R.fail(...)` |
|
||||
| `BaseBO`, `BaseVO`, `BaseDTO` | `dc3-common-model` | shared business, web, and transfer fields |
|
||||
| `BaseBuilder` | `dc3-common-model` | MapStruct conversion base |
|
||||
| `TenantOwned` | `dc3-common-public` | marker for tenant-scoped entities |
|
||||
| Type | Module | Role |
|
||||
|-------------------------------|---------------------|---------------------------------------------------------------|
|
||||
| `BaseService<B,Q>` | `dc3-common-public` | base CRUD service contract |
|
||||
| `BaseController` | `dc3-common-web` | reactive controller helpers and user/tenant context |
|
||||
| `R<T>` | `dc3-common-public` | standard response envelope; use `R.ok(...)` and `R.fail(...)` |
|
||||
| `BaseBO`, `BaseVO`, `BaseDTO` | `dc3-common-model` | shared business, web, and transfer fields |
|
||||
| `BaseBuilder` | `dc3-common-model` | MapStruct conversion base |
|
||||
| `TenantOwned` | `dc3-common-public` | marker for tenant-scoped entities |
|
||||
|
||||
### Shared code placement
|
||||
|
||||
@@ -102,12 +103,12 @@ shared infrastructure.
|
||||
models may reference enums owned by `dc3-common-constant`.
|
||||
- Keep framework- or capability-specific public helpers in the narrowest owning module, such as gRPC conversion in
|
||||
`dc3-common-api`, WebFlux helpers in `dc3-common-web`, and RabbitMQ helpers in `dc3-common-rabbitmq`.
|
||||
- Keep constants and nested enums used by only one module, protocol, configuration object, or implementation beside
|
||||
that owner. Reserve top-level `*Constant` classes and top-level public enums for `dc3-common-constant`; use a
|
||||
- Keep constants and nested enums used by only one module, protocol, configuration object, or implementation beside that
|
||||
owner. Reserve top-level `*Constant` classes and top-level public enums for `dc3-common-constant`; use a
|
||||
concern-specific local name such as `*Limits`/`*Defaults`, a nested enum, or a private field until the concept becomes
|
||||
a stable cross-module contract.
|
||||
- Do not duplicate cross-module wire names, header names, routing identifiers, cache-key fragments, or persistence codes.
|
||||
Define one canonical symbol in `dc3-common-constant` and migrate callers together.
|
||||
- Do not duplicate cross-module wire names, header names, routing identifiers, cache-key fragments, or persistence
|
||||
codes. Define one canonical symbol in `dc3-common-constant` and migrate callers together.
|
||||
- Preserve the dependency floor: `dc3-common-constant` must not depend on other DC3 modules, and `dc3-common-public`
|
||||
must not depend on capability modules.
|
||||
|
||||
@@ -169,13 +170,13 @@ Driver `application.yml` metadata is user-facing:
|
||||
|
||||
CRUD-shaped names reflect result cardinality across Service, Controller, Facade, gRPC server, and proto RPCs:
|
||||
|
||||
| Action | Java | HTTP | gRPC |
|
||||
|---|---|---|---|
|
||||
| create one | `add(BO)` | `/add` | n/a |
|
||||
| delete by ID | `delete(Long)` | `/delete` | n/a |
|
||||
| update one | `update(BO)` | `/update` | n/a |
|
||||
| return one | `getXxx(...)` | `/get_xxx` | `GetXxx` |
|
||||
| return many | `listXxx(...)` | `/list_xxx` | `ListXxx` |
|
||||
| Action | Java | HTTP | gRPC |
|
||||
|--------------|----------------|-------------|-----------|
|
||||
| create one | `add(BO)` | `/add` | n/a |
|
||||
| delete by ID | `delete(Long)` | `/delete` | n/a |
|
||||
| update one | `update(BO)` | `/update` | n/a |
|
||||
| return one | `getXxx(...)` | `/get_xxx` | `GetXxx` |
|
||||
| return many | `listXxx(...)` | `/list_xxx` | `ListXxx` |
|
||||
|
||||
- Base CRUD comes from `BaseService<B,Q>`: `add`, `delete`, `update`, `getById`, and `list(Q)`.
|
||||
- Reserve `select*` for raw Mapper/Manager persistence operations.
|
||||
@@ -195,8 +196,8 @@ CRUD-shaped names reflect result cardinality across Service, Controller, Facade,
|
||||
- `*FlagEnum` is for boolean-like toggles, `*StatusEnum` for state machines, and `*TypeEnum` for classifications.
|
||||
- Enum constants use descriptive `UPPER_SNAKE_CASE`; enum `code` values use lowercase tokens.
|
||||
- Do not introduce magic flag constants such as `private static final Byte DEFAULT = 1`.
|
||||
- Do not expose secrets in VOs. Exclude `apiKey`, `password`, `secret`, `token`, and credential fields from serialization
|
||||
and Lombok `@ToString`.
|
||||
- Do not expose secrets in VOs. Exclude `apiKey`, `password`, `secret`, `token`, and credential fields from
|
||||
serialization and Lombok `@ToString`.
|
||||
|
||||
### Web API and OpenAPI
|
||||
|
||||
@@ -238,7 +239,8 @@ Key rules:
|
||||
- `verbatimModuleSyntax` is enabled. Use `import type` for every type-only import; Vue components, functions, and icons
|
||||
remain normal value imports.
|
||||
- Use `<Entity>Form` for create/update payloads and `<Entity>Record` for read responses.
|
||||
- Represent Java 64-bit IDs as strings. The backend emits identifiers as JSON strings on the HTTP contract, so standard JSON parsing (no JSONBigInt) is sufficient.
|
||||
- Represent Java 64-bit IDs as strings. The backend emits identifiers as JSON strings on the HTTP contract, so standard
|
||||
JSON parsing (no JSONBigInt) is sufficient.
|
||||
- API wrappers mirror backend cardinality: `getXxx` for one value, `listXxx` for collections/maps/pages, and
|
||||
`addXxx`/`updateXxx`/`deleteXxx` for mutations.
|
||||
- Reuse CRUD helpers from `src/api/common.ts` and API bases from `src/config/constant/api.ts`; keep API wrappers thin.
|
||||
@@ -296,8 +298,8 @@ mvn -s .mvn/settings.xml test -pl dc3-common/dc3-common-public \
|
||||
When using `-am` together with `-Dtest`, add `-Dsurefire.failIfNoSpecifiedTests=false` so dependency modules without the
|
||||
selected test do not fail spuriously.
|
||||
|
||||
GitHub Actions should normally use public Maven repositories rather than the local mirror settings unless a workflow
|
||||
is intentionally testing that mirror.
|
||||
GitHub Actions should normally use public Maven repositories rather than the local mirror settings unless a workflow is
|
||||
intentionally testing that mirror.
|
||||
|
||||
## Environment and Compose
|
||||
|
||||
@@ -322,8 +324,8 @@ Compose change, validate every touched stack with its corresponding `make config
|
||||
|
||||
### Test types
|
||||
|
||||
- Unit tests (`*Test.java`, `*Tests.java`) run with Surefire, JUnit 5, Mockito, AssertJ, and Reactor `StepVerifier` where
|
||||
appropriate. Do not start a Spring context for a test that can use direct construction.
|
||||
- Unit tests (`*Test.java`, `*Tests.java`) run with Surefire, JUnit 5, Mockito, AssertJ, and Reactor `StepVerifier`
|
||||
where appropriate. Do not start a Spring context for a test that can use direct construction.
|
||||
- Integration tests (`*IT.java`) run with Failsafe and may use `dc3-common-test` Testcontainers and harnesses.
|
||||
- E2E tests live in `dc3-e2e/` and are gated by the `DC3_E2E` environment variable.
|
||||
|
||||
@@ -379,10 +381,10 @@ or create a GitHub Release directly. The `Docker Images` workflow owns release v
|
||||
GitHub Release creation. Keep its `release` environment protected with required reviewers and tag restrictions.
|
||||
|
||||
If a version lands in `CHANGE.md` without a matching GitHub Release, backfill it with `make release-backfill`
|
||||
(dry-run) or `make release-backfill-apply`. The tool maps date-formatted versions to same-day commits, assembles
|
||||
the standard release body (TITLE.md + changelog block + RELEASE-FOOTER.md quick start that links docs.dc3.site),
|
||||
and creates tags through the API - no image publishing, no `latest` pointer change. After TITLE.md or
|
||||
RELEASE-FOOTER.md evolves, `make release-backfill-refresh` re-renders existing backfilled release bodies.
|
||||
(dry-run) or `make release-backfill-apply`. The tool maps date-formatted versions to same-day commits, assembles the
|
||||
standard release body (TITLE.md + changelog block + RELEASE-FOOTER.md quick start that links docs.dc3.site), and creates
|
||||
tags through the API - no image publishing, no `latest` pointer change. After TITLE.md or RELEASE-FOOTER.md evolves,
|
||||
`make release-backfill-refresh` re-renders existing backfilled release bodies.
|
||||
|
||||
## Commit rules
|
||||
|
||||
|
||||
@@ -119,18 +119,18 @@ Generated changelog-only release commits are skipped by default so rerunning the
|
||||
|
||||
### Backfilling Missing Releases
|
||||
|
||||
Every version recorded in `CHANGE.md` should end up with a GitHub Release. When a release window is skipped (a
|
||||
version is committed to `CHANGE.md` but never tagged), close the gap without re-tagging history:
|
||||
Every version recorded in `CHANGE.md` should end up with a GitHub Release. When a release window is skipped (a version
|
||||
is committed to `CHANGE.md` but never tagged), close the gap without re-tagging history:
|
||||
|
||||
```bash
|
||||
make release-backfill # dry-run: list CHANGE.md versions that have no release
|
||||
make release-backfill-apply # create them (gh CLI, authenticated)
|
||||
```
|
||||
|
||||
The tool maps each date-formatted version to the last commit dated on or before that version day, assembles the
|
||||
release body from `TITLE.md` + the version's changelog block + the `RELEASE-FOOTER.md` quick start (deep usage and
|
||||
deployment content lives on docs.dc3.site), and creates the tag through the GitHub API — which does **not** trigger
|
||||
the `Docker Images` workflow and never moves the `latest` pointer. When `TITLE.md` or `RELEASE-FOOTER.md` evolves,
|
||||
The tool maps each date-formatted version to the last commit dated on or before that version day, assembles the release
|
||||
body from `TITLE.md` + the version's changelog block + the `RELEASE-FOOTER.md` quick start (deep usage and deployment
|
||||
content lives on docs.dc3.site), and creates the tag through the GitHub API — which does **not** trigger the
|
||||
`Docker Images` workflow and never moves the `latest` pointer. When `TITLE.md` or `RELEASE-FOOTER.md` evolves,
|
||||
`make release-backfill-refresh` re-renders the bodies of already-backfilled releases. Run the dry-run periodically to
|
||||
catch drift between `CHANGE.md` and the release list.
|
||||
|
||||
|
||||
@@ -9,8 +9,9 @@ If you are an AI assistant being asked to modify this repository, read [AGENTS.m
|
||||
|
||||
## What Is IoT DC3?
|
||||
|
||||
IoT DC3 is a multi-protocol, cloud-native, open-source industrial IoT platform evolving toward AI agents. It helps teams connect devices, collect telemetry,
|
||||
manage device metadata, query data, dispatch commands, and run AI-assisted operations as a native platform capability.
|
||||
IoT DC3 is a multi-protocol, cloud-native, open-source industrial IoT platform evolving toward AI agents. It helps teams
|
||||
connect devices, collect telemetry, manage device metadata, query data, dispatch commands, and run AI-assisted
|
||||
operations as a native platform capability.
|
||||
|
||||
The project is designed for industrial IoT and operational technology scenarios where many device types, protocols,
|
||||
services, data flows, and intelligent workflows need to be coordinated.
|
||||
@@ -67,13 +68,13 @@ IoT DC3 helps teams build the core capabilities needed for industrial IoT system
|
||||
|
||||
IoT DC3 includes 36 access driver modules:
|
||||
|
||||
| Category | Driver Modules |
|
||||
|--------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Industrial protocols | Modbus TCP, Modbus RTU, OPC UA, OPC DA, Siemens S7, BACnet/IP, EtherNet/IP, Omron FINS, Mitsubishi MELSEC, IEC 60870-5-104, IEC 61850, DNP3, DLMS, DLT645, KNX, M-Bus, SL651 |
|
||||
| IoT protocols | MQTT, CoAP, LwM2M, HTTP, BLE, Zigbee, LoRaWAN |
|
||||
| Data bridging | MySQL, PostgreSQL, Oracle, SQL Server, Redis |
|
||||
| Basic communication, messaging and network management | TCP/UDP, Serial, SNMP, CAN, Kafka |
|
||||
| Simulation and debugging | Virtual, Listening Virtual |
|
||||
| Category | Driver Modules |
|
||||
|-------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Industrial protocols | Modbus TCP, Modbus RTU, OPC UA, OPC DA, Siemens S7, BACnet/IP, EtherNet/IP, Omron FINS, Mitsubishi MELSEC, IEC 60870-5-104, IEC 61850, DNP3, DLMS, DLT645, KNX, M-Bus, SL651 |
|
||||
| IoT protocols | MQTT, CoAP, LwM2M, HTTP, BLE, Zigbee, LoRaWAN |
|
||||
| Data bridging | MySQL, PostgreSQL, Oracle, SQL Server, Redis |
|
||||
| Basic communication, messaging and network management | TCP/UDP, Serial, SNMP, CAN, Kafka |
|
||||
| Simulation and debugging | Virtual, Listening Virtual |
|
||||
|
||||
## Architecture in One Paragraph
|
||||
|
||||
|
||||
@@ -102,13 +102,13 @@ IoT DC3 incluye **36 módulos de controladores de acceso** para automatización
|
||||
datos, comunicaciones básicas y escenarios de simulación/depuración, reduciendo el costo de conectar dispositivos y
|
||||
fuentes de datos comunes:
|
||||
|
||||
| Categoría | Módulos de controladores |
|
||||
|------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Categoría | Módulos de controladores |
|
||||
|------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 🏭 **Protocolos industriales** | Modbus TCP · Modbus RTU · OPC UA · OPC DA · Siemens S7 · BACnet/IP · EtherNet/IP · Omron FINS · Mitsubishi MELSEC · IEC 60870-5-104 · IEC 61850 · DNP3 · DLMS · DLT645 · KNX · M-Bus · SL651 |
|
||||
| 📡 **Protocolos IoT** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **Puenteo de datos** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **Comunicaciones básicas y gestión de red** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **Simulación y depuración** | Virtual · Listening Virtual |
|
||||
| 📡 **Protocolos IoT** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **Puenteo de datos** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **Comunicaciones básicas y gestión de red** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **Simulación y depuración** | Virtual · Listening Virtual |
|
||||
|
||||
El **Driver SDK** permite el desarrollo rápido de controladores de protocolo personalizados y su registro en la
|
||||
plataforma de ejecución.
|
||||
|
||||
@@ -98,13 +98,13 @@ AGE)永続層とオプションの可観測性スタック(ELK + Prometheus
|
||||
IoT DC3 は **36 個の接続ドライバーモジュール**を内蔵し、産業オートメーション、IoT
|
||||
通信、データブリッジ、基本通信、シミュレーションとデバッグのシナリオをカバーします。一般的なデバイスやデータソースの接続コストを下げます。
|
||||
|
||||
| 分類 | ドライバーモジュール |
|
||||
|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 分類 | ドライバーモジュール |
|
||||
|-----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 🏭 **産業プロトコル** | Modbus TCP · Modbus RTU · OPC UA · OPC DA · Siemens S7 · BACnet/IP · EtherNet/IP · Omron FINS · Mitsubishi MELSEC · IEC 60870-5-104 · IEC 61850 · DNP3 · DLMS · DLT645 · KNX · M-Bus · SL651 |
|
||||
| 📡 **IoT プロトコル** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **データブリッジ** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **基本通信とネットワーク管理** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **シミュレーションとデバッグ** | Virtual · Listening Virtual |
|
||||
| 📡 **IoT プロトコル** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **データブリッジ** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **基本通信とネットワーク管理** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **シミュレーションとデバッグ** | Virtual · Listening Virtual |
|
||||
|
||||
**Driver SDK** により、カスタムプロトコルドライバーをすばやく開発し、実行中のプラットフォームへ登録できます。
|
||||
|
||||
|
||||
@@ -96,13 +96,13 @@ API 경로 전체에 걸쳐 적용됩니다. 서비스와 팀 전반에 걸쳐
|
||||
|
||||
IoT DC3는 산업 자동화, IoT 통신, 데이터 브리징, 기본 통신, 시뮬레이션/디버깅 시나리오를 위한 **36개의 접근 드라이버 모듈**을 포함하여 일반적인 디바이스와 데이터 소스의 연결 비용을 줄입니다:
|
||||
|
||||
| 카테고리 | 드라이버 모듈 |
|
||||
|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 카테고리 | 드라이버 모듈 |
|
||||
|-----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 🏭 **산업 프로토콜** | Modbus TCP · Modbus RTU · OPC UA · OPC DA · Siemens S7 · BACnet/IP · EtherNet/IP · Omron FINS · Mitsubishi MELSEC · IEC 60870-5-104 · IEC 61850 · DNP3 · DLMS · DLT645 · KNX · M-Bus · SL651 |
|
||||
| 📡 **IoT 프로토콜** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **데이터 브리징** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **기본 통신 및 네트워크 관리** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **시뮬레이션 및 디버깅** | Virtual · Listening Virtual |
|
||||
| 📡 **IoT 프로토콜** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **데이터 브리징** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **기본 통신 및 네트워크 관리** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **시뮬레이션 및 디버깅** | Virtual · Listening Virtual |
|
||||
|
||||
**Driver SDK**를 통해 커스텀 프로토콜 드라이버를 빠르게 개발하고 실행 중인 플랫폼에 등록할 수 있습니다.
|
||||
|
||||
|
||||
@@ -99,13 +99,13 @@ and API paths. Clear boundaries that scale across services and teams.
|
||||
IoT DC3 includes **36 access driver modules** for industrial automation, IoT communication, data bridging, basic
|
||||
communication, and simulation/debugging scenarios, reducing the cost of connecting common devices and data sources:
|
||||
|
||||
| Category | Driver Modules |
|
||||
|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Category | Driver Modules |
|
||||
|-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 🏭 **Industrial protocols** | Modbus TCP · Modbus RTU · OPC UA · OPC DA · Siemens S7 · BACnet/IP · EtherNet/IP · Omron FINS · Mitsubishi MELSEC · IEC 60870-5-104 · IEC 61850 · DNP3 · DLMS · DLT645 · KNX · M-Bus · SL651 |
|
||||
| 📡 **IoT protocols** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **Data bridging** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **Basic communication, messaging and NMS** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **Simulation and debugging** | Virtual · Listening Virtual |
|
||||
| 📡 **IoT protocols** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **Data bridging** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **Basic communication, messaging and NMS** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **Simulation and debugging** | Virtual · Listening Virtual |
|
||||
|
||||
The **Driver SDK** supports fast development of custom protocol drivers and registration into the runtime platform.
|
||||
|
||||
@@ -133,7 +133,9 @@ Distributed microservice architecture based on **Spring Boot 4 + Spring Cloud 20
|
||||
|
||||
### 📊 Real-Time Data Engine
|
||||
|
||||
- **Data collection** - Drivers collect device telemetry and send it asynchronously through the internal message broker — pluggable per deployment: RabbitMQ (default), Kafka, RocketMQ, Pulsar, ActiveMQ or any MQTT 5 broker ([broker guide](docs/mq-brokers.md))
|
||||
- **Data collection** - Drivers collect device telemetry and send it asynchronously through the internal message
|
||||
broker — pluggable per deployment: RabbitMQ (default), Kafka, RocketMQ, Pulsar, ActiveMQ or any MQTT 5 broker
|
||||
([broker guide](docs/mq-brokers.md))
|
||||
- **Time-series storage** - Efficient queries for real-time and historical data
|
||||
- **Rule engine** - Flexible alarm rules with multi-level alarms and notifications
|
||||
- **Event traceability** - Full command and event history
|
||||
@@ -150,9 +152,8 @@ Distributed microservice architecture based on **Spring Boot 4 + Spring Cloud 20
|
||||
- **Driver SDK** - A complete driver development toolkit. See
|
||||
the [Driver Authoring Guide](https://docs.dc3.site/en/development/driver-authoring)
|
||||
- **Separated frontend and backend** - Vue 3 + TypeScript frontend, RESTful and gRPC APIs
|
||||
- **Containerized deployment** - One-command startup with Podman / Docker Compose, plus compose
|
||||
scaling, Docker Swarm, Kubernetes and Helm deployment configs. See
|
||||
the [Deployment Guide](dc3/doc/DEPLOYMENT.md).
|
||||
- **Containerized deployment** - One-command startup with Podman / Docker Compose, plus compose scaling, Docker Swarm,
|
||||
Kubernetes and Helm deployment configs. See the [Deployment Guide](dc3/doc/DEPLOYMENT.md).
|
||||
- **Complete documentation** - Online docs, quickstart guide, and troubleshooting guide
|
||||
|
||||
## ⚡ Quick Start
|
||||
|
||||
@@ -101,13 +101,13 @@ IoT DC3 включает **36 модулей драйверов доступа**
|
||||
данных, базовых коммуникаций и сценариев моделирования/отладки, снижая стоимость подключения распространённых устройств
|
||||
и источников данных:
|
||||
|
||||
| Категория | Модули драйверов |
|
||||
|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Категория | Модули драйверов |
|
||||
|------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 🏭 **Промышленные протоколы** | Modbus TCP · Modbus RTU · OPC UA · OPC DA · Siemens S7 · BACnet/IP · EtherNet/IP · Omron FINS · Mitsubishi MELSEC · IEC 60870-5-104 · IEC 61850 · DNP3 · DLMS · DLT645 · KNX · M-Bus · SL651 |
|
||||
| 📡 **IoT-протоколы** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **Мостовая передача данных** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **Базовые коммуникации и управление** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **Моделирование и отладка** | Virtual · Listening Virtual |
|
||||
| 📡 **IoT-протоколы** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **Мостовая передача данных** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **Базовые коммуникации и управление** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **Моделирование и отладка** | Virtual · Listening Virtual |
|
||||
|
||||
**Driver SDK** поддерживает быструю разработку пользовательских протокольных драйверов и их регистрацию в среде
|
||||
выполнения платформы.
|
||||
|
||||
@@ -98,13 +98,13 @@ mở rộng theo dịch vụ và đội nhóm.
|
||||
IoT DC3 tích hợp **36 module driver kết nối**, bao phủ tự động hóa công nghiệp, truyền thông IoT, cầu nối dữ liệu,
|
||||
truyền thông cơ bản, mô phỏng và gỡ lỗi, giúp giảm chi phí kết nối thiết bị và nguồn dữ liệu phổ biến:
|
||||
|
||||
| Nhóm | Module driver |
|
||||
|---------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Nhóm | Module driver |
|
||||
|---------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 🏭 **Giao thức công nghiệp** | Modbus TCP · Modbus RTU · OPC UA · OPC DA · Siemens S7 · BACnet/IP · EtherNet/IP · Omron FINS · Mitsubishi MELSEC · IEC 60870-5-104 · IEC 61850 · DNP3 · DLMS · DLT645 · KNX · M-Bus · SL651 |
|
||||
| 📡 **Giao thức IoT** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **Cầu nối dữ liệu** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **Truyền thông cơ bản và quản trị mạng** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **Mô phỏng và gỡ lỗi** | Virtual · Listening Virtual |
|
||||
| 📡 **Giao thức IoT** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **Cầu nối dữ liệu** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **Truyền thông cơ bản và quản trị mạng** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **Mô phỏng và gỡ lỗi** | Virtual · Listening Virtual |
|
||||
|
||||
**Driver SDK** hỗ trợ phát triển nhanh driver giao thức tùy chỉnh và đăng ký vào nền tảng runtime.
|
||||
|
||||
|
||||
@@ -95,13 +95,13 @@ API 全链路。边界清晰,易于规模化扩展与多团队协作。
|
||||
|
||||
内置 **36 个接入驱动模块**,覆盖工业自动化、物联网通信、数据桥接、基础通信与仿真调试场景,降低常见设备与数据源的接入成本:
|
||||
|
||||
| 分类 | 驱动模块 |
|
||||
|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 分类 | 驱动模块 |
|
||||
|-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 🏭 **工业协议** | Modbus TCP · Modbus RTU · OPC UA · OPC DA · Siemens S7 · BACnet/IP · EtherNet/IP · Omron FINS · Mitsubishi MELSEC · IEC 60870-5-104 · IEC 61850 · DNP3 · DLMS · DLT645 · KNX · M-Bus · SL651 |
|
||||
| 📡 **物联网协议** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **数据桥接** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **基础通信、消息与管理** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **仿真与调试** | Virtual · Listening Virtual |
|
||||
| 📡 **物联网协议** | MQTT · CoAP · LwM2M · HTTP · BLE · Zigbee · LoRaWAN |
|
||||
| 🗄️ **数据桥接** | MySQL · PostgreSQL · Oracle · SQL Server · Redis |
|
||||
| 🔧 **基础通信、消息与管理** | TCP/UDP · Serial · SNMP · CAN · Kafka |
|
||||
| 🧪 **仿真与调试** | Virtual · Listening Virtual |
|
||||
|
||||
提供完整的 **Driver SDK**,支持快速开发自定义协议驱动,热插拔注册到运行平台。
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ business logic belongs in `dc3-common-*` implementations.
|
||||
|
||||
## Modules
|
||||
|
||||
| Module | Contract surface | Primary consumers |
|
||||
|---|---|---|
|
||||
| `dc3-api-auth` | tenant, user, token, permission, resource registry, MCP runtime | gateway and center services |
|
||||
| `dc3-api-data` | point values, command history, event history | manager, drivers, and data clients |
|
||||
| `dc3-api-driver` | driver registration and driver-scoped device/point metadata | protocol drivers |
|
||||
| `dc3-api-manager` | manager-scoped driver, device, profile, point, command, and event metadata | data and other centers |
|
||||
| Module | Contract surface | Primary consumers |
|
||||
|-------------------|----------------------------------------------------------------------------|------------------------------------|
|
||||
| `dc3-api-auth` | tenant, user, token, permission, resource registry, MCP runtime | gateway and center services |
|
||||
| `dc3-api-data` | point values, command history, event history | manager, drivers, and data clients |
|
||||
| `dc3-api-driver` | driver registration and driver-scoped device/point metadata | protocol drivers |
|
||||
| `dc3-api-manager` | manager-scoped driver, device, profile, point, command, and event metadata | data and other centers |
|
||||
|
||||
Proto sources live under each module's `src/main/protobuf/` directory. Generated Java sources are build artifacts and
|
||||
must not be edited directly.
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
|
||||
## Services
|
||||
|
||||
| Service | RPCs | Purpose |
|
||||
|---|---|---|
|
||||
| `TenantApi` | `GetByCode` | resolve tenant metadata |
|
||||
| `UserApi` | `GetById`, `GetByPrincipalId` | resolve user identity |
|
||||
| `TokenApi` | `CheckValid` | validate login/token material |
|
||||
| `LocalCredentialApi` | `GetByLoginName` | resolve local credentials |
|
||||
| `PermissionApi` | `ListPermissionCodes` | resolve effective permission codes |
|
||||
| `ResourceRegistryApi` | `Sync` | synchronize annotated API/menu resources |
|
||||
| `McpRuntimeApi` | `Introspect`, `ListTools`, `ResolveTool`, `AuthorizeToolCall`, `Audit` | authorize and audit MCP tools |
|
||||
| Service | RPCs | Purpose |
|
||||
|-----------------------|------------------------------------------------------------------------|------------------------------------------|
|
||||
| `TenantApi` | `GetByCode` | resolve tenant metadata |
|
||||
| `UserApi` | `GetById`, `GetByPrincipalId` | resolve user identity |
|
||||
| `TokenApi` | `CheckValid` | validate login/token material |
|
||||
| `LocalCredentialApi` | `GetByLoginName` | resolve local credentials |
|
||||
| `PermissionApi` | `ListPermissionCodes` | resolve effective permission codes |
|
||||
| `ResourceRegistryApi` | `Sync` | synchronize annotated API/menu resources |
|
||||
| `McpRuntimeApi` | `Introspect`, `ListTools`, `ResolveTool`, `AuthorizeToolCall`, `Audit` | authorize and audit MCP tools |
|
||||
|
||||
Every response uses a contract-specific wrapper containing `GrpcR`. Callers must inspect the result envelope before
|
||||
reading response data.
|
||||
@@ -37,5 +37,5 @@ mvn -s .mvn/settings.xml -q -pl dc3-api/dc3-api-auth -am compile
|
||||
This module has no handwritten runtime code or module-specific tests. A successful compile verifies proto syntax and
|
||||
generated Java sources; server/facade behaviour is tested in the implementing modules.
|
||||
|
||||
When changing the contract, preserve field numbers, update implementations and clients together, and verify that
|
||||
tenant and authorization context remain explicit.
|
||||
When changing the contract, preserve field numbers, update implementations and clients together, and verify that tenant
|
||||
and authorization context remain explicit.
|
||||
|
||||
@@ -5,18 +5,18 @@ types use `io.github.pnoker.api.center.data`; proto sources live under `src/main
|
||||
|
||||
## Services
|
||||
|
||||
| Service | RPCs | Purpose |
|
||||
|---|---|---|
|
||||
| `PointValueApi` | `GetLastValue`, `ListHistoryValues`, `ListSeriesVolumes` | query point values and value-volume series |
|
||||
| `PointValueApi` | `ReadCommand`, `WriteCommand` | submit point read/write commands |
|
||||
| `CommandHistoryApi` | `CallCommand`, `GetByRecordId`, `ListByPage` | dispatch and query command history |
|
||||
| `EventHistoryApi` | `ReportEvent`, `GetByRecordId`, `ListByPage` | report and query event history |
|
||||
| `StatusHealthApi` | `DeviceStatusesByIds`, `DeviceStatusesByProfileId` | query device status snapshots |
|
||||
| `StatusHealthApi` | `DriverStatusesByIds`, `DriverDeviceStatusSummary` | query driver status snapshots and device summaries |
|
||||
| `StatusHealthApi` | `SystemHealth` | query the platform health snapshot |
|
||||
| Service | RPCs | Purpose |
|
||||
|---------------------|----------------------------------------------------------|----------------------------------------------------|
|
||||
| `PointValueApi` | `GetLastValue`, `ListHistoryValues`, `ListSeriesVolumes` | query point values and value-volume series |
|
||||
| `PointValueApi` | `ReadCommand`, `WriteCommand` | submit point read/write commands |
|
||||
| `CommandHistoryApi` | `CallCommand`, `GetByRecordId`, `ListByPage` | dispatch and query command history |
|
||||
| `EventHistoryApi` | `ReportEvent`, `GetByRecordId`, `ListByPage` | report and query event history |
|
||||
| `StatusHealthApi` | `DeviceStatusesByIds`, `DeviceStatusesByProfileId` | query device status snapshots |
|
||||
| `StatusHealthApi` | `DriverStatusesByIds`, `DriverDeviceStatusSummary` | query driver status snapshots and device summaries |
|
||||
| `StatusHealthApi` | `SystemHealth` | query the platform health snapshot |
|
||||
|
||||
Single-result RPCs use `GetXxx`; collection/page results use `ListXxx` or an explicitly named status aggregation. Do
|
||||
not reintroduce legacy `SelectXxx` names.
|
||||
Single-result RPCs use `GetXxx`; collection/page results use `ListXxx` or an explicitly named status aggregation. Do not
|
||||
reintroduce legacy `SelectXxx` names.
|
||||
|
||||
## Consumers and implementation
|
||||
|
||||
|
||||
@@ -5,15 +5,15 @@ driver-scoped device and point configuration. Generated Java types use `io.githu
|
||||
|
||||
## Services
|
||||
|
||||
| Service | RPC | Response | Purpose |
|
||||
|---|---|---|---|
|
||||
| `DriverApi` | `DriverRegister` | `GrpcRDriverRegisterDTO` | register metadata and receive assigned configuration |
|
||||
| `DriverApi` | `GetById` | `GrpcRDriverRegisterDTO` | reload registered driver metadata |
|
||||
| `DriverApi` | `RenewLease` | stream of `GrpcRDriverLeaseDTO` | renew one runtime lease and stream its owned-device snapshot |
|
||||
| `DeviceApi` | `ListByPage` | `GrpcRPageDeviceDTO` | page through driver-owned devices |
|
||||
| `DeviceApi` | `GetById` | `GrpcRDeviceDTO` | get one device with attached attribute configuration |
|
||||
| `PointApi` | `ListByPage` | `GrpcRPagePointDTO` | page through driver-visible points |
|
||||
| `PointApi` | `GetById` | `GrpcRPointDTO` | get one point with attached configuration |
|
||||
| Service | RPC | Response | Purpose |
|
||||
|-------------|------------------|---------------------------------|--------------------------------------------------------------|
|
||||
| `DriverApi` | `DriverRegister` | `GrpcRDriverRegisterDTO` | register metadata and receive assigned configuration |
|
||||
| `DriverApi` | `GetById` | `GrpcRDriverRegisterDTO` | reload registered driver metadata |
|
||||
| `DriverApi` | `RenewLease` | stream of `GrpcRDriverLeaseDTO` | renew one runtime lease and stream its owned-device snapshot |
|
||||
| `DeviceApi` | `ListByPage` | `GrpcRPageDeviceDTO` | page through driver-owned devices |
|
||||
| `DeviceApi` | `GetById` | `GrpcRDeviceDTO` | get one device with attached attribute configuration |
|
||||
| `PointApi` | `ListByPage` | `GrpcRPagePointDTO` | page through driver-visible points |
|
||||
| `PointApi` | `GetById` | `GrpcRPointDTO` | get one point with attached configuration |
|
||||
|
||||
Proto sources live under `src/main/protobuf/api/common/driver/`. The `.proto` files are authoritative for fields and
|
||||
wrapper shapes.
|
||||
|
||||
@@ -5,14 +5,14 @@ services. Generated Java types use `io.github.pnoker.api.center.manager`.
|
||||
|
||||
## Services
|
||||
|
||||
| Service | Single-result RPCs | Collection/page RPCs |
|
||||
|---|---|---|
|
||||
| `DriverApi` | `GetByDriverId`, `GetByDeviceId` | `ListByPage`, `ListByDriverIds` |
|
||||
| `DeviceApi` | `GetByDeviceId`, `GetActiveOwner` | `ListByPage`, `ListByProfileId`, `ListByDriverId`, `ListByDeviceIds` |
|
||||
| `PointApi` | `GetById` | `ListByPage`, `ListByIds` |
|
||||
| `ProfileApi` | `GetByProfileId` | `ListByPage`, `ListByProfileIds`, `ListByDeviceId` |
|
||||
| `CommandApi` | `GetById` | `ListByPage`, `ListByIds` |
|
||||
| `EventApi` | `GetById` | `ListByPage`, `ListByIds` |
|
||||
| Service | Single-result RPCs | Collection/page RPCs |
|
||||
|--------------|-----------------------------------|----------------------------------------------------------------------|
|
||||
| `DriverApi` | `GetByDriverId`, `GetByDeviceId` | `ListByPage`, `ListByDriverIds` |
|
||||
| `DeviceApi` | `GetByDeviceId`, `GetActiveOwner` | `ListByPage`, `ListByProfileId`, `ListByDriverId`, `ListByDeviceIds` |
|
||||
| `PointApi` | `GetById` | `ListByPage`, `ListByIds` |
|
||||
| `ProfileApi` | `GetByProfileId` | `ListByPage`, `ListByProfileIds`, `ListByDeviceId` |
|
||||
| `CommandApi` | `GetById` | `ListByPage`, `ListByIds` |
|
||||
| `EventApi` | `GetById` | `ListByPage`, `ListByIds` |
|
||||
|
||||
Proto sources live under `src/main/protobuf/api/common/manager/`. Shared query and page messages are defined in
|
||||
`manager_query.proto` and `manager_query_page.proto`.
|
||||
|
||||
@@ -5,13 +5,13 @@ modules; center modules assemble dependencies, configuration, and process bounda
|
||||
|
||||
## Applications
|
||||
|
||||
| Module | HTTP | gRPC | Base path | Purpose |
|
||||
|---|---:|---:|---|---|
|
||||
| `dc3-center-single` | 8100 | 9100 | `/single` | auth, manager, and data in one JVM |
|
||||
| `dc3-center-auth` | 8300 | 9300 | `/auth` | identity, authorization, OAuth2, and MCP authorization |
|
||||
| `dc3-center-manager` | 8400 | 9400 | `/manager` | device and metadata management |
|
||||
| `dc3-center-data` | 8500 | 9500 | `/data` | values, commands, events, and status |
|
||||
| `dc3-center-agentic` | 8600 | n/a | `/agentic` | AI-assisted operations |
|
||||
| Module | HTTP | gRPC | Base path | Purpose |
|
||||
|----------------------|-----:|-----:|------------|--------------------------------------------------------|
|
||||
| `dc3-center-single` | 8100 | 9100 | `/single` | auth, manager, and data in one JVM |
|
||||
| `dc3-center-auth` | 8300 | 9300 | `/auth` | identity, authorization, OAuth2, and MCP authorization |
|
||||
| `dc3-center-manager` | 8400 | 9400 | `/manager` | device and metadata management |
|
||||
| `dc3-center-data` | 8500 | 9500 | `/data` | values, commands, events, and status |
|
||||
| `dc3-center-agentic` | 8600 | n/a | `/agentic` | AI-assisted operations |
|
||||
|
||||
Ports are defaults; environment variables in each `application.yml` are authoritative. The distributed applications use
|
||||
static, environment-overridable gRPC addresses. They do not depend on Nacos service discovery.
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
## Overview
|
||||
|
||||
`dc3-center-data` is the Data Center of the IoT DC3 platform. It consumes device point values from drivers over
|
||||
RabbitMQ (AMQP), stores them through the pluggable time-series port (`dc3-tsdb`, TimescaleDB by default), and exposes
|
||||
data query and command APIs.
|
||||
`dc3-center-data` is the Data Center of the IoT DC3 platform. It consumes device point values from drivers over RabbitMQ
|
||||
(AMQP), stores them through the pluggable time-series port (`dc3-tsdb`, TimescaleDB by default), and exposes data query
|
||||
and command APIs.
|
||||
|
||||
## Module Information
|
||||
|
||||
@@ -36,13 +36,13 @@ Accessible through the gateway at `/api/v3/data/**` (authentication required).
|
||||
|
||||
## Messaging Topics
|
||||
|
||||
| Exchange | Direction | Purpose |
|
||||
|-----------------------|-----------|-----------------------------------------|
|
||||
| `dc3.e.value` | Inbound | Receive point values from drivers |
|
||||
| `dc3.e.point_command` | Outbound | Dispatch point read/write commands |
|
||||
| `dc3.e.command` | Outbound | Dispatch custom device commands |
|
||||
| `dc3.e.state` | Inbound | Receive driver/device state events |
|
||||
| `dc3.e.event` | Inbound | Receive reported domain events |
|
||||
| Exchange | Direction | Purpose |
|
||||
|-----------------------|-----------|------------------------------------|
|
||||
| `dc3.e.value` | Inbound | Receive point values from drivers |
|
||||
| `dc3.e.point_command` | Outbound | Dispatch point read/write commands |
|
||||
| `dc3.e.command` | Outbound | Dispatch custom device commands |
|
||||
| `dc3.e.state` | Inbound | Receive driver/device state events |
|
||||
| `dc3.e.event` | Inbound | Receive reported domain events |
|
||||
|
||||
## Dependencies
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ management, and command interfaces.
|
||||
|
||||
## Service Ports
|
||||
|
||||
| Protocol | Port | Configuration variable |
|
||||
|-----------|--------|------------------------|
|
||||
| Protocol | Port | Configuration variable |
|
||||
|-----------|--------|-------------------------|
|
||||
| HTTP REST | `8400` | `DC3_MANAGER_PORT` |
|
||||
| gRPC | `9400` | `DC3_MANAGER_GRPC_PORT` |
|
||||
|
||||
@@ -53,12 +53,12 @@ The complete prefix set (labels, dictionaries, attribute configs, dashboards, ba
|
||||
|
||||
## gRPC Services (consumed by drivers and data service)
|
||||
|
||||
| Service | Used by |
|
||||
|----------------------------|-------------------------------------------------|
|
||||
| `DriverApi.DriverRegister` | Drivers registering on startup |
|
||||
| `DeviceApi.GetById` | Drivers fetching device configuration |
|
||||
| `PointApi.GetById` | Drivers fetching point configuration |
|
||||
| `DriverApi.GetByDeviceId` | Distributed facades resolving command routing |
|
||||
| Service | Used by |
|
||||
|----------------------------|-----------------------------------------------|
|
||||
| `DriverApi.DriverRegister` | Drivers registering on startup |
|
||||
| `DeviceApi.GetById` | Drivers fetching device configuration |
|
||||
| `PointApi.GetById` | Drivers fetching point configuration |
|
||||
| `DriverApi.GetByDeviceId` | Distributed facades resolving command routing |
|
||||
|
||||
## Dependencies
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ management services into a single deployable module for simplified single-node o
|
||||
|
||||
| Protocol | Port | Configuration variable |
|
||||
|-----------|--------|------------------------|
|
||||
| HTTP REST | `8100` | `DC3_SINGLE_PORT` |
|
||||
| gRPC | `9100` | `DC3_SINGLE_GRPC_PORT` |
|
||||
| HTTP REST | `8100` | `DC3_SINGLE_PORT` |
|
||||
| gRPC | `9100` | `DC3_SINGLE_GRPC_PORT` |
|
||||
|
||||
## Key Responsibilities
|
||||
|
||||
|
||||
@@ -5,39 +5,39 @@ center and driver applications.
|
||||
|
||||
## Domain modules
|
||||
|
||||
| Module | Responsibility |
|
||||
|---|---|
|
||||
| `dc3-common-auth` | authentication, authorization, identity, OAuth2, and auth gRPC servers |
|
||||
| `dc3-common-manager` | driver/device/profile/point metadata and manager APIs |
|
||||
| `dc3-common-data` | values, commands, events, status, and data APIs |
|
||||
| `dc3-common-agentic` | AI models, sessions, tools, and assisted operations |
|
||||
| `dc3-common-driver` | driver SDK, registration, scheduling, metadata, command, and value runtime |
|
||||
| `dc3-common-gateway` | gateway routes, authentication filter, and ingress support |
|
||||
| Module | Responsibility |
|
||||
|----------------------|----------------------------------------------------------------------------|
|
||||
| `dc3-common-auth` | authentication, authorization, identity, OAuth2, and auth gRPC servers |
|
||||
| `dc3-common-manager` | driver/device/profile/point metadata and manager APIs |
|
||||
| `dc3-common-data` | values, commands, events, status, and data APIs |
|
||||
| `dc3-common-agentic` | AI models, sessions, tools, and assisted operations |
|
||||
| `dc3-common-driver` | driver SDK, registration, scheduling, metadata, command, and value runtime |
|
||||
| `dc3-common-gateway` | gateway routes, authentication filter, and ingress support |
|
||||
|
||||
## Contracts and models
|
||||
|
||||
| Module | Responsibility |
|
||||
|---|---|
|
||||
| `dc3-common-model` | shared BO/VO/DTO bases, builders, extension models, validation groups, and transport models |
|
||||
| `dc3-common-public` | response envelope, `BaseService`, shared entities/utilities, and tenant markers |
|
||||
| `dc3-common-api` | shared gRPC conversion helpers |
|
||||
| `dc3-common-facade` | cross-service facade contracts and implementations |
|
||||
| `dc3-common-constant` | stable platform-wide constants and shared domain/wire/persistence enums |
|
||||
| `dc3-common-exception` | shared exception hierarchy |
|
||||
| Module | Responsibility |
|
||||
|------------------------|---------------------------------------------------------------------------------------------|
|
||||
| `dc3-common-model` | shared BO/VO/DTO bases, builders, extension models, validation groups, and transport models |
|
||||
| `dc3-common-public` | response envelope, `BaseService`, shared entities/utilities, and tenant markers |
|
||||
| `dc3-common-api` | shared gRPC conversion helpers |
|
||||
| `dc3-common-facade` | cross-service facade contracts and implementations |
|
||||
| `dc3-common-constant` | stable platform-wide constants and shared domain/wire/persistence enums |
|
||||
| `dc3-common-exception` | shared exception hierarchy |
|
||||
|
||||
## Infrastructure modules
|
||||
|
||||
| Module | Responsibility |
|
||||
|---|---|
|
||||
| `dc3-common-dal` | shared label/group persistence |
|
||||
| `dc3-common-mqtt` | MQTT client configuration |
|
||||
| `dc3-common-quartz` | scheduling infrastructure |
|
||||
| `dc3-common-thread` | managed executors |
|
||||
| `dc3-common-web` | WebFlux, springdoc, security, and controller support |
|
||||
| `dc3-common-log` | logging defaults |
|
||||
| `dc3-common-sql` | SQL utilities |
|
||||
| Module | Responsibility |
|
||||
|---------------------------------|-------------------------------------------------------|
|
||||
| `dc3-common-dal` | shared label/group persistence |
|
||||
| `dc3-common-mqtt` | MQTT client configuration |
|
||||
| `dc3-common-quartz` | scheduling infrastructure |
|
||||
| `dc3-common-thread` | managed executors |
|
||||
| `dc3-common-web` | WebFlux, springdoc, security, and controller support |
|
||||
| `dc3-common-log` | logging defaults |
|
||||
| `dc3-common-sql` | SQL utilities |
|
||||
| `dc3-common-resource-registrar` | API/resource annotation discovery and synchronization |
|
||||
| `dc3-common-test` | shared tests, harnesses, and Testcontainers |
|
||||
| `dc3-common-test` | shared tests, harnesses, and Testcontainers |
|
||||
|
||||
Datasource, messaging, and time-series storage were split into dedicated top-level families; business modules depend on
|
||||
them directly:
|
||||
|
||||
@@ -74,7 +74,7 @@ public class ChatClientConfig {
|
||||
* Create and configure the application-managed agentic chat memory repository.
|
||||
*
|
||||
* @param messageService message service
|
||||
* @param properties properties
|
||||
* @param properties properties
|
||||
* @return agentic chat memory repository result
|
||||
*/
|
||||
@Bean
|
||||
@@ -88,7 +88,7 @@ public class ChatClientConfig {
|
||||
* Create and configure the application-managed agentic chat memory.
|
||||
*
|
||||
* @param chatMemoryRepository chat memory repository
|
||||
* @param properties properties
|
||||
* @param properties properties
|
||||
* @return agentic chat memory result
|
||||
*/
|
||||
@Bean
|
||||
@@ -129,15 +129,15 @@ public class ChatClientConfig {
|
||||
/**
|
||||
* Create and configure the application-managed agentic tool callback provider.
|
||||
*
|
||||
* @param tenantTool tenant tool
|
||||
* @param userTool user tool
|
||||
* @param deviceTool device tool
|
||||
* @param driverTool driver tool
|
||||
* @param profileTool profile tool
|
||||
* @param pointTool point tool
|
||||
* @param tenantTool tenant tool
|
||||
* @param userTool user tool
|
||||
* @param deviceTool device tool
|
||||
* @param driverTool driver tool
|
||||
* @param profileTool profile tool
|
||||
* @param pointTool point tool
|
||||
* @param pointValueTool point value tool
|
||||
* @param systemTool system tool
|
||||
* @param objectMapper object mapper
|
||||
* @param systemTool system tool
|
||||
* @param objectMapper object mapper
|
||||
* @return agentic tool callback provider result
|
||||
*/
|
||||
@Bean
|
||||
@@ -157,7 +157,7 @@ public class ChatClientConfig {
|
||||
/**
|
||||
* Create and configure the application-managed agentic chat client builder.
|
||||
*
|
||||
* @param chatModel chat model
|
||||
* @param chatModel chat model
|
||||
* @param memoryAdvisor memory advisor
|
||||
* @return agentic chat client builder result
|
||||
*/
|
||||
|
||||
@@ -65,7 +65,7 @@ public interface ModelProviderBuilder {
|
||||
* After process.
|
||||
*
|
||||
* @param entityRequest entity request
|
||||
* @param entityBO business object
|
||||
* @param entityBO business object
|
||||
*/
|
||||
@Mapping(target = "providerType", ignore = true)
|
||||
@Mapping(target = "tenantId", ignore = true)
|
||||
|
||||
@@ -74,7 +74,9 @@ public class AgenticMessageContent implements Serializable {
|
||||
return content;
|
||||
}
|
||||
|
||||
/** Tool-call trace entry (type, title, detail) for the run timeline. */
|
||||
/**
|
||||
* Tool-call trace entry (type, title, detail) for the run timeline.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@@ -103,10 +105,10 @@ public class AgenticMessageContent implements Serializable {
|
||||
/**
|
||||
* Of.
|
||||
*
|
||||
* @param type type
|
||||
* @param title title
|
||||
* @param detail detail
|
||||
* @param name name
|
||||
* @param type type
|
||||
* @param title title
|
||||
* @param detail detail
|
||||
* @param name name
|
||||
* @param created created
|
||||
* @return of result
|
||||
*/
|
||||
@@ -117,14 +119,14 @@ public class AgenticMessageContent implements Serializable {
|
||||
/**
|
||||
* Of.
|
||||
*
|
||||
* @param type type
|
||||
* @param title title
|
||||
* @param detail detail
|
||||
* @param name name
|
||||
* @param type type
|
||||
* @param title title
|
||||
* @param detail detail
|
||||
* @param name name
|
||||
* @param created created
|
||||
* @param phase phase
|
||||
* @param status status
|
||||
* @param code code
|
||||
* @param phase phase
|
||||
* @param status status
|
||||
* @param code code
|
||||
* @return of result
|
||||
*/
|
||||
public static Trace of(String type, String title, String detail, String name, Long created, String phase,
|
||||
@@ -143,7 +145,9 @@ public class AgenticMessageContent implements Serializable {
|
||||
|
||||
}
|
||||
|
||||
/** One context block (type + content) fed to the model. */
|
||||
/**
|
||||
* One context block (type + content) fed to the model.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@@ -160,7 +164,7 @@ public class AgenticMessageContent implements Serializable {
|
||||
/**
|
||||
* Of.
|
||||
*
|
||||
* @param type type
|
||||
* @param type type
|
||||
* @param content content
|
||||
* @return of result
|
||||
*/
|
||||
@@ -173,7 +177,9 @@ public class AgenticMessageContent implements Serializable {
|
||||
|
||||
}
|
||||
|
||||
/** Token accounting: input/output/text/context counts of one message. */
|
||||
/**
|
||||
* Token accounting: input/output/text/context counts of one message.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@@ -198,12 +204,12 @@ public class AgenticMessageContent implements Serializable {
|
||||
/**
|
||||
* Of.
|
||||
*
|
||||
* @param input input
|
||||
* @param output output
|
||||
* @param text text
|
||||
* @param input input
|
||||
* @param output output
|
||||
* @param text text
|
||||
* @param context context
|
||||
* @param system system
|
||||
* @param memory memory
|
||||
* @param system system
|
||||
* @param memory memory
|
||||
* @return of result
|
||||
*/
|
||||
public static Tokens of(Integer input, Integer output, Integer text, Integer context, Integer system,
|
||||
|
||||
@@ -45,8 +45,8 @@ public record AgenticRunEvent(String type, String name, String title, String det
|
||||
* Tool start.
|
||||
*
|
||||
* @param toolName tool name
|
||||
* @param domain domain
|
||||
* @param title title
|
||||
* @param domain domain
|
||||
* @param title title
|
||||
* @return tool start result
|
||||
*/
|
||||
public static AgenticRunEvent toolStart(String toolName, String domain, String title) {
|
||||
@@ -58,9 +58,9 @@ public record AgenticRunEvent(String type, String name, String title, String det
|
||||
* Tool result.
|
||||
*
|
||||
* @param toolName tool name
|
||||
* @param success success
|
||||
* @param code code
|
||||
* @param message message
|
||||
* @param success success
|
||||
* @param code code
|
||||
* @param message message
|
||||
* @return tool result result
|
||||
*/
|
||||
public static AgenticRunEvent toolResult(String toolName, boolean success, String code, String message) {
|
||||
@@ -79,7 +79,7 @@ public record AgenticRunEvent(String type, String name, String title, String det
|
||||
* Tool error.
|
||||
*
|
||||
* @param toolName tool name
|
||||
* @param message message
|
||||
* @param message message
|
||||
* @return tool error result
|
||||
*/
|
||||
public static AgenticRunEvent toolError(String toolName, String message) {
|
||||
|
||||
@@ -39,9 +39,9 @@ public record AgenticToolResult<T>(boolean success, String code, String message,
|
||||
/**
|
||||
* Ok.
|
||||
*
|
||||
* @param <T> generic type parameter
|
||||
* @param <T> generic type parameter
|
||||
* @param message message
|
||||
* @param data data
|
||||
* @param data data
|
||||
* @return ok result
|
||||
*/
|
||||
public static <T> AgenticToolResult<T> ok(String message, T data) {
|
||||
@@ -51,9 +51,9 @@ public record AgenticToolResult<T>(boolean success, String code, String message,
|
||||
/**
|
||||
* Ok.
|
||||
*
|
||||
* @param <T> generic type parameter
|
||||
* @param message message
|
||||
* @param data data
|
||||
* @param <T> generic type parameter
|
||||
* @param message message
|
||||
* @param data data
|
||||
* @param visualizations visualizations
|
||||
* @return ok result
|
||||
*/
|
||||
@@ -65,9 +65,9 @@ public record AgenticToolResult<T>(boolean success, String code, String message,
|
||||
/**
|
||||
* Empty.
|
||||
*
|
||||
* @param <T> generic type parameter
|
||||
* @param <T> generic type parameter
|
||||
* @param message message
|
||||
* @param data data
|
||||
* @param data data
|
||||
* @return empty result
|
||||
*/
|
||||
public static <T> AgenticToolResult<T> empty(String message, T data) {
|
||||
@@ -77,7 +77,7 @@ public record AgenticToolResult<T>(boolean success, String code, String message,
|
||||
/**
|
||||
* Invalid.
|
||||
*
|
||||
* @param <T> generic type parameter
|
||||
* @param <T> generic type parameter
|
||||
* @param message message
|
||||
* @return invalid result
|
||||
*/
|
||||
@@ -89,7 +89,7 @@ public record AgenticToolResult<T>(boolean success, String code, String message,
|
||||
/**
|
||||
* Not found.
|
||||
*
|
||||
* @param <T> generic type parameter
|
||||
* @param <T> generic type parameter
|
||||
* @param message message
|
||||
* @return not found result
|
||||
*/
|
||||
@@ -100,7 +100,7 @@ public record AgenticToolResult<T>(boolean success, String code, String message,
|
||||
/**
|
||||
* Unavailable.
|
||||
*
|
||||
* @param <T> generic type parameter
|
||||
* @param <T> generic type parameter
|
||||
* @param message message
|
||||
* @return unavailable result
|
||||
*/
|
||||
@@ -111,7 +111,7 @@ public record AgenticToolResult<T>(boolean success, String code, String message,
|
||||
/**
|
||||
* Error.
|
||||
*
|
||||
* @param <T> generic type parameter
|
||||
* @param <T> generic type parameter
|
||||
* @param message message
|
||||
* @return error result
|
||||
*/
|
||||
|
||||
@@ -62,7 +62,9 @@ public class AgenticVisualizationSpec implements Serializable {
|
||||
|
||||
private List<Annotation> annotations;
|
||||
|
||||
/** Visual-channel bindings: which field maps to x/y/color/size. */
|
||||
/**
|
||||
* Visual-channel bindings: which field maps to x/y/color/size.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@@ -99,7 +101,9 @@ public class AgenticVisualizationSpec implements Serializable {
|
||||
|
||||
}
|
||||
|
||||
/** One chart annotation (type, value, label). */
|
||||
/**
|
||||
* One chart annotation (type, value, label).
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
|
||||
@@ -48,7 +48,7 @@ public class AgenticVisualizationVO {
|
||||
* Of.
|
||||
*
|
||||
* @param visualization visualization
|
||||
* @param created created
|
||||
* @param created created
|
||||
* @return of result
|
||||
*/
|
||||
public static AgenticVisualizationVO of(AgenticVisualizationSpec visualization, long created) {
|
||||
|
||||
@@ -60,7 +60,9 @@ public class ChatCompletionChunkVO {
|
||||
@Schema(description = "List of streaming choices included in this chunk; typically contains exactly one element for non-branching completions.")
|
||||
private List<ChunkChoice> choices;
|
||||
|
||||
/** One streaming choice: index + incremental delta. */
|
||||
/**
|
||||
* One streaming choice: index + incremental delta.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@@ -83,7 +85,9 @@ public class ChatCompletionChunkVO {
|
||||
|
||||
}
|
||||
|
||||
/** Incremental content/role fragment of one chunk. */
|
||||
/**
|
||||
* Incremental content/role fragment of one chunk.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
|
||||
@@ -64,7 +64,9 @@ public class ChatCompletionResponseVO {
|
||||
@Schema(description = "Token usage statistics for the request and response.")
|
||||
private Usage usage;
|
||||
|
||||
/** One completion choice: index + assistant message. */
|
||||
/**
|
||||
* One completion choice: index + assistant message.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@@ -86,7 +88,9 @@ public class ChatCompletionResponseVO {
|
||||
|
||||
}
|
||||
|
||||
/** Generated assistant message (role + content). */
|
||||
/**
|
||||
* Generated assistant message (role + content).
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@@ -109,7 +113,9 @@ public class ChatCompletionResponseVO {
|
||||
|
||||
}
|
||||
|
||||
/** Token usage of the completion (prompt/completion/total). */
|
||||
/**
|
||||
* Token usage of the completion (prompt/completion/total).
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
|
||||
@@ -97,9 +97,9 @@ public class AgenticChatResponseCodec {
|
||||
/**
|
||||
* Format final chunk.
|
||||
*
|
||||
* @param id id
|
||||
* @param created created
|
||||
* @param model model
|
||||
* @param id id
|
||||
* @param created created
|
||||
* @param model model
|
||||
* @param finishReason finish reason
|
||||
* @return format final chunk result
|
||||
*/
|
||||
|
||||
@@ -44,7 +44,7 @@ public class AgenticMessageRecorder {
|
||||
/**
|
||||
* Persist user message.
|
||||
*
|
||||
* @param prepared prepared
|
||||
* @param prepared prepared
|
||||
* @param userHeader user header
|
||||
*/
|
||||
public void persistUserMessage(AgenticPreparedChatBO prepared, RequestHeader.PrincipalHeader userHeader) {
|
||||
@@ -55,8 +55,8 @@ public class AgenticMessageRecorder {
|
||||
/**
|
||||
* Persist assistant message.
|
||||
*
|
||||
* @param prepared prepared
|
||||
* @param content content
|
||||
* @param prepared prepared
|
||||
* @param content content
|
||||
* @param userHeader user header
|
||||
*/
|
||||
public void persistAssistantMessage(AgenticPreparedChatBO prepared, String content,
|
||||
|
||||
@@ -50,7 +50,7 @@ public class CommandTool {
|
||||
/**
|
||||
* Return command by identifier.
|
||||
*
|
||||
* @param commandId command identifier
|
||||
* @param commandId command identifier
|
||||
* @param toolContext tool context
|
||||
* @return lookup command by identifier result
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ public class CommandTool {
|
||||
/**
|
||||
* Return commands by identifiers.
|
||||
*
|
||||
* @param commandIds command identifiers
|
||||
* @param commandIds command identifiers
|
||||
* @param toolContext tool context
|
||||
* @return lookup commands by identifiers result
|
||||
*/
|
||||
@@ -97,9 +97,9 @@ public class CommandTool {
|
||||
* Return the matching commands.
|
||||
*
|
||||
* @param commandName command name
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return search commands result
|
||||
*/
|
||||
@@ -131,9 +131,9 @@ public class CommandTool {
|
||||
/**
|
||||
* Return the matching commands by device identifier.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param deviceId device identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return list commands by device identifier result
|
||||
*/
|
||||
@@ -163,9 +163,9 @@ public class CommandTool {
|
||||
/**
|
||||
* Return the matching commands by profile identifier.
|
||||
*
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return list commands by profile identifier result
|
||||
*/
|
||||
|
||||
@@ -66,7 +66,7 @@ public class DeviceTool {
|
||||
/**
|
||||
* Return device by identifier.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param deviceId device identifier
|
||||
* @param toolContext tool context
|
||||
* @return lookup device by identifier result
|
||||
*/
|
||||
@@ -87,7 +87,7 @@ public class DeviceTool {
|
||||
/**
|
||||
* Return devices by identifiers.
|
||||
*
|
||||
* @param deviceIds device identifiers
|
||||
* @param deviceIds device identifiers
|
||||
* @param toolContext tool context
|
||||
* @return lookup devices by identifiers result
|
||||
*/
|
||||
@@ -112,11 +112,11 @@ public class DeviceTool {
|
||||
/**
|
||||
* Return the matching devices.
|
||||
*
|
||||
* @param deviceName device name
|
||||
* @param deviceCode device code
|
||||
* @param driverId driver identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param deviceName device name
|
||||
* @param deviceCode device code
|
||||
* @param driverId driver identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return search devices result
|
||||
*/
|
||||
@@ -151,7 +151,7 @@ public class DeviceTool {
|
||||
/**
|
||||
* Return the matching devices by driver identifier.
|
||||
*
|
||||
* @param driverId driver identifier
|
||||
* @param driverId driver identifier
|
||||
* @param toolContext tool context
|
||||
* @return list devices by driver identifier result
|
||||
*/
|
||||
@@ -173,7 +173,7 @@ public class DeviceTool {
|
||||
/**
|
||||
* Return the matching devices by profile identifier.
|
||||
*
|
||||
* @param profileId profile identifier
|
||||
* @param profileId profile identifier
|
||||
* @param toolContext tool context
|
||||
* @return list devices by profile identifier result
|
||||
*/
|
||||
@@ -195,8 +195,8 @@ public class DeviceTool {
|
||||
/**
|
||||
* Return device latest point values.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param limit limit
|
||||
* @param deviceId device identifier
|
||||
* @param limit limit
|
||||
* @param toolContext tool context
|
||||
* @return get device latest point values result
|
||||
*/
|
||||
@@ -243,7 +243,7 @@ public class DeviceTool {
|
||||
/**
|
||||
* Return device statuses by identifiers.
|
||||
*
|
||||
* @param deviceIds device identifiers
|
||||
* @param deviceIds device identifiers
|
||||
* @param toolContext tool context
|
||||
* @return get device statuses by identifiers result
|
||||
*/
|
||||
@@ -272,7 +272,7 @@ public class DeviceTool {
|
||||
/**
|
||||
* Return device statuses by profile identifier.
|
||||
*
|
||||
* @param profileId profile identifier
|
||||
* @param profileId profile identifier
|
||||
* @param toolContext tool context
|
||||
* @return get device statuses by profile identifier result
|
||||
*/
|
||||
|
||||
@@ -57,7 +57,7 @@ public class DriverTool {
|
||||
/**
|
||||
* Return driver by identifier.
|
||||
*
|
||||
* @param driverId driver identifier
|
||||
* @param driverId driver identifier
|
||||
* @param toolContext tool context
|
||||
* @return lookup driver by identifier result
|
||||
*/
|
||||
@@ -78,7 +78,7 @@ public class DriverTool {
|
||||
/**
|
||||
* Return drivers by identifiers.
|
||||
*
|
||||
* @param driverIds driver identifiers
|
||||
* @param driverIds driver identifiers
|
||||
* @param toolContext tool context
|
||||
* @return lookup drivers by identifiers result
|
||||
*/
|
||||
@@ -103,7 +103,7 @@ public class DriverTool {
|
||||
/**
|
||||
* Return driver by device identifier.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param deviceId device identifier
|
||||
* @param toolContext tool context
|
||||
* @return lookup driver by device identifier result
|
||||
*/
|
||||
@@ -125,9 +125,9 @@ public class DriverTool {
|
||||
/**
|
||||
* Return the matching drivers.
|
||||
*
|
||||
* @param driverName driver name
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param driverName driver name
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return search drivers result
|
||||
*/
|
||||
@@ -157,7 +157,7 @@ public class DriverTool {
|
||||
/**
|
||||
* Return driver statuses by identifiers.
|
||||
*
|
||||
* @param driverIds driver identifiers
|
||||
* @param driverIds driver identifiers
|
||||
* @param toolContext tool context
|
||||
* @return get driver statuses by identifiers result
|
||||
*/
|
||||
@@ -186,7 +186,7 @@ public class DriverTool {
|
||||
/**
|
||||
* Return driver device status summary.
|
||||
*
|
||||
* @param driverId driver identifier
|
||||
* @param driverId driver identifier
|
||||
* @param toolContext tool context
|
||||
* @return get driver device status summary result
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ public class EventTool {
|
||||
/**
|
||||
* Return event by identifier.
|
||||
*
|
||||
* @param eventId event identifier
|
||||
* @param eventId event identifier
|
||||
* @param toolContext tool context
|
||||
* @return lookup event by identifier result
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ public class EventTool {
|
||||
/**
|
||||
* Return events by identifiers.
|
||||
*
|
||||
* @param eventIds event identifiers
|
||||
* @param eventIds event identifiers
|
||||
* @param toolContext tool context
|
||||
* @return lookup events by identifiers result
|
||||
*/
|
||||
@@ -96,10 +96,10 @@ public class EventTool {
|
||||
/**
|
||||
* Return the matching events.
|
||||
*
|
||||
* @param eventName event name
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param eventName event name
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return search events result
|
||||
*/
|
||||
@@ -131,9 +131,9 @@ public class EventTool {
|
||||
/**
|
||||
* Return the matching events by device identifier.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param deviceId device identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return list events by device identifier result
|
||||
*/
|
||||
@@ -163,9 +163,9 @@ public class EventTool {
|
||||
/**
|
||||
* Return the matching events by profile identifier.
|
||||
*
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return list events by profile identifier result
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ public class PointTool {
|
||||
/**
|
||||
* Return point by identifier.
|
||||
*
|
||||
* @param pointId point identifier
|
||||
* @param pointId point identifier
|
||||
* @param toolContext tool context
|
||||
* @return lookup point by identifier result
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ public class PointTool {
|
||||
/**
|
||||
* Return points by identifiers.
|
||||
*
|
||||
* @param pointIds point identifiers
|
||||
* @param pointIds point identifiers
|
||||
* @param toolContext tool context
|
||||
* @return lookup points by identifiers result
|
||||
*/
|
||||
@@ -96,10 +96,10 @@ public class PointTool {
|
||||
/**
|
||||
* Return the matching points.
|
||||
*
|
||||
* @param pointName point name
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param pointName point name
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return search points result
|
||||
*/
|
||||
@@ -131,9 +131,9 @@ public class PointTool {
|
||||
/**
|
||||
* Return the matching points by device identifier.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param deviceId device identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return list points by device identifier result
|
||||
*/
|
||||
@@ -163,9 +163,9 @@ public class PointTool {
|
||||
/**
|
||||
* Return the matching points by profile identifier.
|
||||
*
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param profileId profile identifier
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return list points by profile identifier result
|
||||
*/
|
||||
|
||||
@@ -62,8 +62,8 @@ public class PointValueTool {
|
||||
/**
|
||||
* Return latest point value.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param pointId point identifier
|
||||
* @param deviceId device identifier
|
||||
* @param pointId point identifier
|
||||
* @param toolContext tool context
|
||||
* @return get latest point value result
|
||||
*/
|
||||
@@ -93,9 +93,9 @@ public class PointValueTool {
|
||||
/**
|
||||
* Return point value history.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param pointId point identifier
|
||||
* @param count count
|
||||
* @param deviceId device identifier
|
||||
* @param pointId point identifier
|
||||
* @param count count
|
||||
* @param toolContext tool context
|
||||
* @return get point value history result
|
||||
*/
|
||||
@@ -134,8 +134,8 @@ public class PointValueTool {
|
||||
/**
|
||||
* Read point value.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param pointId point identifier
|
||||
* @param deviceId device identifier
|
||||
* @param pointId point identifier
|
||||
* @param toolContext tool context
|
||||
* @return read point value result
|
||||
*/
|
||||
@@ -165,9 +165,9 @@ public class PointValueTool {
|
||||
/**
|
||||
* Write point value.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param pointId point identifier
|
||||
* @param value value
|
||||
* @param deviceId device identifier
|
||||
* @param pointId point identifier
|
||||
* @param value value
|
||||
* @param toolContext tool context
|
||||
* @return write point value result
|
||||
*/
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ProfileTool {
|
||||
/**
|
||||
* Return profile by identifier.
|
||||
*
|
||||
* @param profileId profile identifier
|
||||
* @param profileId profile identifier
|
||||
* @param toolContext tool context
|
||||
* @return lookup profile by identifier result
|
||||
*/
|
||||
@@ -80,7 +80,7 @@ public class ProfileTool {
|
||||
/**
|
||||
* Return profiles by identifiers.
|
||||
*
|
||||
* @param profileIds profile identifiers
|
||||
* @param profileIds profile identifiers
|
||||
* @param toolContext tool context
|
||||
* @return lookup profiles by identifiers result
|
||||
*/
|
||||
@@ -112,8 +112,8 @@ public class ProfileTool {
|
||||
* @param profileName profile name
|
||||
* @param profileCode profile code
|
||||
* @param profileType profile type
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param page page
|
||||
* @param size size
|
||||
* @param toolContext tool context
|
||||
* @return search profiles result
|
||||
*/
|
||||
@@ -151,7 +151,7 @@ public class ProfileTool {
|
||||
/**
|
||||
* Return the matching profiles by device identifier.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param deviceId device identifier
|
||||
* @param toolContext tool context
|
||||
* @return list profiles by device identifier result
|
||||
*/
|
||||
|
||||
@@ -48,7 +48,9 @@ public class TenantTool {
|
||||
return AgenticToolResult.ok("Current tenant context loaded", new CurrentTenantContext(tenantId));
|
||||
}
|
||||
|
||||
/** The tenant injected from the authenticated ToolContext (never agent-supplied). */
|
||||
/**
|
||||
* The tenant injected from the authenticated ToolContext (never agent-supplied).
|
||||
*/
|
||||
public record CurrentTenantContext(Long tenantId) {
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,9 @@ public class UserTool {
|
||||
new CurrentUserProfile(userId, header.getUserName(), header.getNickName()));
|
||||
}
|
||||
|
||||
/** The acting user resolved from the ToolContext identity. */
|
||||
/**
|
||||
* The acting user resolved from the ToolContext identity.
|
||||
*/
|
||||
public record CurrentUserProfile(Long userId, String username, String nickname) {
|
||||
}
|
||||
|
||||
|
||||
@@ -112,8 +112,8 @@ public class AgenticToolContextUtil {
|
||||
* Record tool invocation.
|
||||
*
|
||||
* @param toolContext tool context
|
||||
* @param toolName tool name
|
||||
* @param domain domain
|
||||
* @param toolName tool name
|
||||
* @param domain domain
|
||||
* @param description description
|
||||
*/
|
||||
public static void recordToolInvocation(ToolContext toolContext, String toolName, String domain,
|
||||
@@ -125,10 +125,10 @@ public class AgenticToolContextUtil {
|
||||
* Record tool result.
|
||||
*
|
||||
* @param toolContext tool context
|
||||
* @param toolName tool name
|
||||
* @param success success
|
||||
* @param code code
|
||||
* @param message message
|
||||
* @param toolName tool name
|
||||
* @param success success
|
||||
* @param code code
|
||||
* @param message message
|
||||
*/
|
||||
public static void recordToolResult(ToolContext toolContext, String toolName, boolean success, String code,
|
||||
String message) {
|
||||
@@ -139,8 +139,8 @@ public class AgenticToolContextUtil {
|
||||
* Record tool error.
|
||||
*
|
||||
* @param toolContext tool context
|
||||
* @param toolName tool name
|
||||
* @param message message
|
||||
* @param toolName tool name
|
||||
* @param message message
|
||||
*/
|
||||
public static void recordToolError(ToolContext toolContext, String toolName, String message) {
|
||||
recordRunEvent(toolContext, AgenticRunEvent.toolError(toolName, message));
|
||||
@@ -149,7 +149,7 @@ public class AgenticToolContextUtil {
|
||||
/**
|
||||
* Record visualizations.
|
||||
*
|
||||
* @param toolContext tool context
|
||||
* @param toolContext tool context
|
||||
* @param visualizations visualizations
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -168,7 +168,7 @@ public class AgenticToolContextUtil {
|
||||
* Record run event.
|
||||
*
|
||||
* @param toolContext tool context
|
||||
* @param event event
|
||||
* @param event event
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void recordRunEvent(ToolContext toolContext, AgenticRunEvent event) {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class AgenticToolUtil {
|
||||
* Page.
|
||||
*
|
||||
* @param current current
|
||||
* @param size size
|
||||
* @param size size
|
||||
* @return page result
|
||||
*/
|
||||
public static Pages page(int current, int size) {
|
||||
@@ -73,8 +73,8 @@ public class AgenticToolUtil {
|
||||
* Clamp.
|
||||
*
|
||||
* @param value value
|
||||
* @param min min
|
||||
* @param max max
|
||||
* @param min min
|
||||
* @param max max
|
||||
* @return clamp result
|
||||
*/
|
||||
public static int clamp(int value, int min, int max) {
|
||||
|
||||
@@ -74,12 +74,12 @@ public class AgenticVisualizationUtil {
|
||||
/**
|
||||
* Line.
|
||||
*
|
||||
* @param id id
|
||||
* @param title title
|
||||
* @param id id
|
||||
* @param title title
|
||||
* @param description description
|
||||
* @param dataset dataset
|
||||
* @param encode encode
|
||||
* @param meta meta
|
||||
* @param dataset dataset
|
||||
* @param encode encode
|
||||
* @param meta meta
|
||||
* @param annotations annotations
|
||||
* @return line result
|
||||
*/
|
||||
@@ -107,11 +107,11 @@ public class AgenticVisualizationUtil {
|
||||
/**
|
||||
* Stat.
|
||||
*
|
||||
* @param id id
|
||||
* @param title title
|
||||
* @param id id
|
||||
* @param title title
|
||||
* @param description description
|
||||
* @param row row
|
||||
* @param meta meta
|
||||
* @param row row
|
||||
* @param meta meta
|
||||
* @return stat result
|
||||
*/
|
||||
public static AgenticVisualizationSpec stat(String id, String title, String description,
|
||||
@@ -145,8 +145,8 @@ public class AgenticVisualizationUtil {
|
||||
/**
|
||||
* Point history meta.
|
||||
*
|
||||
* @param deviceId device identifier
|
||||
* @param pointId point identifier
|
||||
* @param deviceId device identifier
|
||||
* @param pointId point identifier
|
||||
* @param valueSource value source
|
||||
* @return point history meta result
|
||||
*/
|
||||
|
||||
@@ -17,21 +17,21 @@ functionality. It is wired directly into `dc3-center-auth`.
|
||||
|--------------|----------------------------------------------------------------------------|
|
||||
| Controllers | REST controllers for user, tenant, token, dictionary endpoints |
|
||||
| Services | `TokenService`, `UserService`, `TenantService`, `DictionaryForAuthService` |
|
||||
| gRPC Servers | Spring `@Service` beans extending generated `*ImplBase` server classes |
|
||||
| gRPC Servers | Spring `@Service` beans extending generated `*ImplBase` server classes |
|
||||
| DAL | MyBatis-Plus mappers and DAL managers for auth tables |
|
||||
| Init | `AuthInitRunner` for startup checks |
|
||||
|
||||
## gRPC Services Exposed
|
||||
|
||||
| Service | Purpose |
|
||||
|---|---|
|
||||
| `TokenApi` | Validate login and token material for gateway authentication |
|
||||
| `TenantApi` | Resolve tenant metadata by code |
|
||||
| `UserApi` | Resolve users by ID or principal ID |
|
||||
| `LocalCredentialApi` | Resolve local credentials by login name |
|
||||
| `PermissionApi` | List effective permission codes |
|
||||
| `ResourceRegistryApi` | Synchronize discovered API and menu resources |
|
||||
| `McpRuntimeApi` | Introspect, authorize, resolve, and audit MCP tool calls |
|
||||
| Service | Purpose |
|
||||
|-----------------------|--------------------------------------------------------------|
|
||||
| `TokenApi` | Validate login and token material for gateway authentication |
|
||||
| `TenantApi` | Resolve tenant metadata by code |
|
||||
| `UserApi` | Resolve users by ID or principal ID |
|
||||
| `LocalCredentialApi` | Resolve local credentials by login name |
|
||||
| `PermissionApi` | List effective permission codes |
|
||||
| `ResourceRegistryApi` | Synchronize discovered API and menu resources |
|
||||
| `McpRuntimeApi` | Introspect, authorize, resolve, and audit MCP tool calls |
|
||||
|
||||
Distributed callers use the corresponding facade interfaces; they should not construct gRPC channels in business code.
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ public class TokenController implements BaseController {
|
||||
*/
|
||||
// Public endpoint: invoked before login, so no @PreAuthorize. Path is also
|
||||
// permitted in WebFluxSecurityConfig (POST /token/salt).
|
||||
|
||||
/**
|
||||
* Handle the generate salt request.
|
||||
*
|
||||
@@ -102,6 +103,7 @@ public class TokenController implements BaseController {
|
||||
*/
|
||||
// Public endpoint: invoked during login (before a token exists), so no
|
||||
// @PreAuthorize. Path is also permitted in WebFluxSecurityConfig (POST /token/generate).
|
||||
|
||||
/**
|
||||
* Handle the generate token request.
|
||||
*
|
||||
@@ -145,6 +147,7 @@ public class TokenController implements BaseController {
|
||||
*/
|
||||
// Public endpoint: invoked during login when no token can be issued yet, so no
|
||||
// @PreAuthorize. Path is also permitted in WebFluxSecurityConfig (POST /token/change_password).
|
||||
|
||||
/**
|
||||
* Handle the change password request.
|
||||
*
|
||||
|
||||
@@ -33,13 +33,13 @@ public interface IdentityAuditLogManager extends IService<IdentityAuditLogDO> {
|
||||
/**
|
||||
* Return the matching identity audit.
|
||||
*
|
||||
* @param tenantId tenant identifier
|
||||
* @param principalId principal identifier
|
||||
* @param action action to execute
|
||||
* @param tenantId tenant identifier
|
||||
* @param principalId principal identifier
|
||||
* @param action action to execute
|
||||
* @param resourceType resource type
|
||||
* @param resourceId resource identifier
|
||||
* @param status status
|
||||
* @param limit limit
|
||||
* @param resourceId resource identifier
|
||||
* @param status status
|
||||
* @param limit limit
|
||||
* @return list identifierentity audit result
|
||||
*/
|
||||
List<IdentityAuditLogDO> listIdentityAudit(Long tenantId, Long principalId, String action,
|
||||
|
||||
@@ -54,7 +54,7 @@ public interface McpAuditBuilder {
|
||||
* After process.
|
||||
*
|
||||
* @param entityRecord entity record
|
||||
* @param entityVO view object
|
||||
* @param entityVO view object
|
||||
*/
|
||||
@AfterMapping
|
||||
default void afterProcess(McpAuditCommand entityRecord, @MappingTarget McpAuditVO entityVO) {
|
||||
|
||||
@@ -54,7 +54,7 @@ public interface McpConnectionBuilder {
|
||||
* After process.
|
||||
*
|
||||
* @param entityRecord entity record
|
||||
* @param entityVO view object
|
||||
* @param entityVO view object
|
||||
*/
|
||||
@AfterMapping
|
||||
default void afterProcess(McpConnectionRecord entityRecord, @MappingTarget McpConnectionVO entityVO) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public interface McpToolBuilder {
|
||||
* After process.
|
||||
*
|
||||
* @param entityRecord entity record
|
||||
* @param entityVO view object
|
||||
* @param entityVO view object
|
||||
*/
|
||||
@AfterMapping
|
||||
default void afterProcess(McpToolRecord entityRecord, @MappingTarget McpToolVO entityVO) {
|
||||
|
||||
@@ -55,7 +55,7 @@ public interface OAuthClientBuilder {
|
||||
* After process.
|
||||
*
|
||||
* @param entityRecord entity record
|
||||
* @param entityVO view object
|
||||
* @param entityVO view object
|
||||
*/
|
||||
@AfterMapping
|
||||
default void afterProcess(OAuthRegisteredClientRecord entityRecord, @MappingTarget OAuthClientVO entityVO) {
|
||||
|
||||
@@ -60,7 +60,7 @@ public interface GrpcLocalCredentialBuilder {
|
||||
/**
|
||||
* After process.
|
||||
*
|
||||
* @param entityBO business object
|
||||
* @param entityBO business object
|
||||
* @param entityGrpc entity grpc
|
||||
*/
|
||||
@AfterMapping
|
||||
|
||||
@@ -61,7 +61,7 @@ public interface GrpcTenantBuilder {
|
||||
/**
|
||||
* After process.
|
||||
*
|
||||
* @param entityBO business object
|
||||
* @param entityBO business object
|
||||
* @param entityGrpc entity grpc
|
||||
*/
|
||||
@AfterMapping
|
||||
|
||||
@@ -67,7 +67,7 @@ public interface GrpcUserBuilder {
|
||||
/**
|
||||
* After process.
|
||||
*
|
||||
* @param entityBO business object
|
||||
* @param entityBO business object
|
||||
* @param entityGrpc entity grpc
|
||||
*/
|
||||
@AfterMapping
|
||||
|
||||
@@ -34,13 +34,13 @@ public interface IdentityAuditLogMapper extends BaseMapper<IdentityAuditLogDO> {
|
||||
/**
|
||||
* Return the matching identity audit.
|
||||
*
|
||||
* @param tenantId tenant identifier
|
||||
* @param principalId principal identifier
|
||||
* @param action action to execute
|
||||
* @param tenantId tenant identifier
|
||||
* @param principalId principal identifier
|
||||
* @param action action to execute
|
||||
* @param resourceType resource type
|
||||
* @param resourceId resource identifier
|
||||
* @param status status
|
||||
* @param limit limit
|
||||
* @param resourceId resource identifier
|
||||
* @param status status
|
||||
* @param limit limit
|
||||
* @return list identifierentity audit result
|
||||
*/
|
||||
List<IdentityAuditLogDO> listIdentityAudit(@Param("tenantId") Long tenantId,
|
||||
|
||||
@@ -49,7 +49,7 @@ public interface LocalCredentialService extends BaseService<LocalCredentialBO, L
|
||||
/**
|
||||
* Verify password.
|
||||
*
|
||||
* @param credential credential
|
||||
* @param credential credential
|
||||
* @param rawPassword raw password
|
||||
* @return {@code true} when the raw password matches the stored credential
|
||||
*/
|
||||
@@ -58,7 +58,7 @@ public interface LocalCredentialService extends BaseService<LocalCredentialBO, L
|
||||
/**
|
||||
* Reset password.
|
||||
*
|
||||
* @param id id
|
||||
* @param id id
|
||||
* @param rawPassword raw password
|
||||
*/
|
||||
void resetPassword(Long id, String rawPassword);
|
||||
|
||||
@@ -60,9 +60,9 @@ public interface PrincipalService {
|
||||
/**
|
||||
* Update enable flag.
|
||||
*
|
||||
* @param id id
|
||||
* @param target target
|
||||
* @param operatorId operator identifier
|
||||
* @param id id
|
||||
* @param target target
|
||||
* @param operatorId operator identifier
|
||||
* @param operatorName operator name
|
||||
*/
|
||||
void setEnableFlag(Long id, EnableFlagEnum target, Long operatorId, String operatorName);
|
||||
|
||||
@@ -47,7 +47,7 @@ public interface RolePrincipalBindService extends BaseService<RolePrincipalBindB
|
||||
/**
|
||||
* Return the matching role by tenant identifier and principal identifier.
|
||||
*
|
||||
* @param tenantId tenant identifier
|
||||
* @param tenantId tenant identifier
|
||||
* @param principalId principal identifier
|
||||
* @return list role by tenant identifier and principal identifier result
|
||||
*/
|
||||
|
||||
@@ -51,7 +51,7 @@ public interface TenantMembershipService {
|
||||
/**
|
||||
* Find the membership that binds a principal to a tenant.
|
||||
*
|
||||
* @param tenantId tenant identifier
|
||||
* @param tenantId tenant identifier
|
||||
* @param principalId principal identifier
|
||||
* @return the matching membership, or {@code null} when it does not exist
|
||||
*/
|
||||
@@ -84,7 +84,7 @@ public interface TenantMembershipService {
|
||||
/**
|
||||
* Determine whether a principal belongs to a tenant.
|
||||
*
|
||||
* @param tenantId tenant identifier
|
||||
* @param tenantId tenant identifier
|
||||
* @param principalId principal identifier
|
||||
* @return {@code true} when the membership exists; otherwise {@code false}
|
||||
*/
|
||||
@@ -98,7 +98,7 @@ public interface TenantMembershipService {
|
||||
/**
|
||||
* Require a principal to belong to a tenant.
|
||||
*
|
||||
* @param tenantId tenant identifier
|
||||
* @param tenantId tenant identifier
|
||||
* @param principalId principal identifier
|
||||
* @throws NotFoundException when the membership does not exist
|
||||
*/
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
<!-- MariaDB twin of the mysql fork above: identical shape, but
|
||||
MariaDB never adopted the AS-new row alias: VALUES(col) instead. -->
|
||||
<select id="advisoryLock" databaseId="mariadb" resultType="java.lang.String">
|
||||
<select id="advisoryLock" databaseId="mariadb" resultType="java.lang.String">
|
||||
SELECT CAST(GET_LOCK(#{key}, 10) AS CHAR)
|
||||
</select>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
<!-- MariaDB twin of the mysql fork above: identical shape, but
|
||||
MariaDB never adopted the AS-new row alias: VALUES(col) instead. -->
|
||||
<select id="advisoryUnlock" databaseId="mariadb" resultType="java.lang.String">
|
||||
<select id="advisoryUnlock" databaseId="mariadb" resultType="java.lang.String">
|
||||
SELECT CAST(RELEASE_LOCK(#{key}) AS CHAR)
|
||||
</select>
|
||||
|
||||
|
||||
@@ -29,17 +29,17 @@ classes and top-level public enums are reserved for this module; local holders u
|
||||
|
||||
`RabbitConstant` defines all exchange names, queue name prefixes, and routing key prefixes:
|
||||
|
||||
| Constant | Base value |
|
||||
|----------------------------------|--------------------------------|
|
||||
| `TOPIC_EXCHANGE_POINT_COMMAND` | `dc3.e.point_command` |
|
||||
| `TOPIC_EXCHANGE_COMMAND` | `dc3.e.command` |
|
||||
| `TOPIC_EXCHANGE_METADATA` | `dc3.e.metadata` |
|
||||
| `TOPIC_EXCHANGE_VALUE` | `dc3.e.value` |
|
||||
| `TOPIC_EXCHANGE_EVENT` | `dc3.e.event` |
|
||||
| `ROUTING_POINT_COMMAND_PREFIX` | `dc3.r.point_command.` |
|
||||
| `ROUTING_COMMAND_PREFIX` | `dc3.r.command.` |
|
||||
| `ROUTING_DRIVER_METADATA_PREFIX` | `dc3.r.metadata.driver.` |
|
||||
| `ROUTING_POINT_VALUE_PREFIX` | `dc3.r.value.point.` |
|
||||
| Constant | Base value |
|
||||
|----------------------------------|--------------------------|
|
||||
| `TOPIC_EXCHANGE_POINT_COMMAND` | `dc3.e.point_command` |
|
||||
| `TOPIC_EXCHANGE_COMMAND` | `dc3.e.command` |
|
||||
| `TOPIC_EXCHANGE_METADATA` | `dc3.e.metadata` |
|
||||
| `TOPIC_EXCHANGE_VALUE` | `dc3.e.value` |
|
||||
| `TOPIC_EXCHANGE_EVENT` | `dc3.e.event` |
|
||||
| `ROUTING_POINT_COMMAND_PREFIX` | `dc3.r.point_command.` |
|
||||
| `ROUTING_COMMAND_PREFIX` | `dc3.r.command.` |
|
||||
| `ROUTING_DRIVER_METADATA_PREFIX` | `dc3.r.metadata.driver.` |
|
||||
| `ROUTING_POINT_VALUE_PREFIX` | `dc3.r.value.point.` |
|
||||
|
||||
The runtime may prepend the `dc3.rabbit.tag` system-property value to exchange, queue, and selected routing constants.
|
||||
Point read/write operations use the point-command constants; `TOPIC_EXCHANGE_COMMAND` is reserved for custom commands.
|
||||
@@ -58,8 +58,8 @@ consumer, and deployed queue migration.
|
||||
|
||||
### Enumerations
|
||||
|
||||
Located in `io.github.pnoker.common.enums`. The list below is a selection of the most commonly referenced enums; see
|
||||
the package for the complete set (alarm, MCP, OAuth, notify, and other domain enums live there too):
|
||||
Located in `io.github.pnoker.common.enums`. The list below is a selection of the most commonly referenced enums; see the
|
||||
package for the complete set (alarm, MCP, OAuth, notify, and other domain enums live there too):
|
||||
|
||||
- `EnableFlagEnum` — Boolean-like enable/disable state
|
||||
- `EntityStatusEnum` — Online, offline, maintenance, and fault states
|
||||
|
||||
@@ -25,7 +25,9 @@ package io.github.pnoker.common.constant.common;
|
||||
*/
|
||||
public class BaseConstant {
|
||||
|
||||
/** Exception message thrown by utility-class private constructors. */
|
||||
/**
|
||||
* Exception message thrown by utility-class private constructors.
|
||||
*/
|
||||
public static final String UTILITY_CLASS = "Utility class";
|
||||
|
||||
private BaseConstant() {
|
||||
|
||||
@@ -42,10 +42,14 @@ public class DefaultConstant {
|
||||
*/
|
||||
public static final long DEFAULT_ID = 0L;
|
||||
|
||||
/** Numeric zero convenience constant. */
|
||||
/**
|
||||
* Numeric zero convenience constant.
|
||||
*/
|
||||
public static final Integer ZERO = 0;
|
||||
|
||||
/** Numeric one convenience constant. */
|
||||
/**
|
||||
* Numeric one convenience constant.
|
||||
*/
|
||||
public static final Integer ONE = 1;
|
||||
|
||||
/**
|
||||
|
||||
@@ -99,13 +99,19 @@ public class EnvironmentConstant {
|
||||
*/
|
||||
public static final String JDBC_AUTO_PROFILE = "dc3.jdbc.auto-profile";
|
||||
|
||||
/** Configuration key selecting the relational dialect. */
|
||||
/**
|
||||
* Configuration key selecting the relational dialect.
|
||||
*/
|
||||
public static final String DB_TYPE = "dc3.db.type";
|
||||
|
||||
/** MySQL profile auto-activation configuration key. */
|
||||
/**
|
||||
* MySQL profile auto-activation configuration key.
|
||||
*/
|
||||
public static final String MYSQL_AUTO_PROFILE = "dc3.mysql.auto-profile";
|
||||
|
||||
/** PostgreSQL profile auto-activation configuration key. */
|
||||
/**
|
||||
* PostgreSQL profile auto-activation configuration key.
|
||||
*/
|
||||
public static final String POSTGRES_AUTO_PROFILE = "dc3.postgres.auto-profile";
|
||||
|
||||
/**
|
||||
@@ -113,13 +119,19 @@ public class EnvironmentConstant {
|
||||
*/
|
||||
public static final String JDBC_PROFILE = "jdbc";
|
||||
|
||||
/** Spring profile name for PostgreSQL-enabled applications. */
|
||||
/**
|
||||
* Spring profile name for PostgreSQL-enabled applications.
|
||||
*/
|
||||
public static final String POSTGRES_PROFILE = "postgres";
|
||||
|
||||
/** Spring profile name for MySQL-enabled applications. */
|
||||
/**
|
||||
* Spring profile name for MySQL-enabled applications.
|
||||
*/
|
||||
public static final String MYSQL_PROFILE = "mysql";
|
||||
|
||||
/** Spring profile name for MariaDB-enabled applications. */
|
||||
/**
|
||||
* Spring profile name for MariaDB-enabled applications.
|
||||
*/
|
||||
public static final String MARIADB_PROFILE = "mariadb";
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,9 @@ package io.github.pnoker.common.constant.common;
|
||||
*/
|
||||
public class QueryWrapperConstant {
|
||||
|
||||
/** limit one constant. */
|
||||
/**
|
||||
* limit one constant.
|
||||
*/
|
||||
public static final String LIMIT_ONE = "LIMIT 1";
|
||||
|
||||
private QueryWrapperConstant() {
|
||||
|
||||
@@ -83,16 +83,24 @@ public class RequestConstant {
|
||||
*/
|
||||
public static final String X_AUTH_SIGN = "X-Auth-Sign";
|
||||
|
||||
/** x internal caller constant. */
|
||||
/**
|
||||
* x internal caller constant.
|
||||
*/
|
||||
public static final String X_INTERNAL_CALLER = "X-Internal-Caller";
|
||||
|
||||
/** x internal timestamp constant. */
|
||||
/**
|
||||
* x internal timestamp constant.
|
||||
*/
|
||||
public static final String X_INTERNAL_TIMESTAMP = "X-Internal-Timestamp";
|
||||
|
||||
/** x internal nonce constant. */
|
||||
/**
|
||||
* x internal nonce constant.
|
||||
*/
|
||||
public static final String X_INTERNAL_NONCE = "X-Internal-Nonce";
|
||||
|
||||
/** x internal sign constant. */
|
||||
/**
|
||||
* x internal sign constant.
|
||||
*/
|
||||
public static final String X_INTERNAL_SIGN = "X-Internal-Sign";
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,31 +28,49 @@ package io.github.pnoker.common.constant.common;
|
||||
*/
|
||||
public class SymbolConstant {
|
||||
|
||||
/** dot constant. */
|
||||
/**
|
||||
* dot constant.
|
||||
*/
|
||||
public static final String DOT = ".";
|
||||
|
||||
/** underscore constant. */
|
||||
/**
|
||||
* underscore constant.
|
||||
*/
|
||||
public static final String UNDERSCORE = "_";
|
||||
|
||||
/** hyphen constant. */
|
||||
/**
|
||||
* hyphen constant.
|
||||
*/
|
||||
public static final String HYPHEN = "-";
|
||||
|
||||
/** asterisk constant. */
|
||||
/**
|
||||
* asterisk constant.
|
||||
*/
|
||||
public static final String ASTERISK = "*";
|
||||
|
||||
/** hashtag constant. */
|
||||
/**
|
||||
* hashtag constant.
|
||||
*/
|
||||
public static final String HASHTAG = "#";
|
||||
|
||||
/** colon constant. */
|
||||
/**
|
||||
* colon constant.
|
||||
*/
|
||||
public static final String COLON = ":";
|
||||
|
||||
/** double colon constant. */
|
||||
/**
|
||||
* double colon constant.
|
||||
*/
|
||||
public static final String DOUBLE_COLON = "::";
|
||||
|
||||
/** slash constant. */
|
||||
/**
|
||||
* slash constant.
|
||||
*/
|
||||
public static final String SLASH = "/";
|
||||
|
||||
/** double slash constant. */
|
||||
/**
|
||||
* double slash constant.
|
||||
*/
|
||||
public static final String DOUBLE_SLASH = "//";
|
||||
|
||||
private SymbolConstant() {
|
||||
|
||||
@@ -42,13 +42,19 @@ public class TimeConstant {
|
||||
*/
|
||||
public static final String DAY_DATE_FORMAT1 = "yyyy.MM.dd";
|
||||
|
||||
/** day date format2 constant. */
|
||||
/**
|
||||
* day date format2 constant.
|
||||
*/
|
||||
public static final String DAY_DATE_FORMAT2 = "yyyy-MM-dd";
|
||||
|
||||
/** default date format constant. */
|
||||
/**
|
||||
* default date format constant.
|
||||
*/
|
||||
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
/** complete date format constant. */
|
||||
/**
|
||||
* complete date format constant.
|
||||
*/
|
||||
public static final String COMPLETE_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
|
||||
|
||||
private TimeConstant() {
|
||||
|
||||
@@ -52,7 +52,9 @@ public class EventConstant {
|
||||
*/
|
||||
public static final String REGISTER = "driver_register";
|
||||
|
||||
/** Driver event type code for registration acknowledgments. */
|
||||
/**
|
||||
* Driver event type code for registration acknowledgments.
|
||||
*/
|
||||
public static final String REGISTER_BACK = "driver_register_back";
|
||||
|
||||
private Driver() {
|
||||
|
||||
@@ -42,13 +42,19 @@ public class MetadataConstant {
|
||||
*/
|
||||
public static class Profile {
|
||||
|
||||
/** add constant. */
|
||||
/**
|
||||
* add constant.
|
||||
*/
|
||||
public static final String ADD = PrefixConstant.ADD + SuffixConstant.PROFILE;
|
||||
|
||||
/** delete constant. */
|
||||
/**
|
||||
* delete constant.
|
||||
*/
|
||||
public static final String DELETE = PrefixConstant.DELETE + SuffixConstant.PROFILE;
|
||||
|
||||
/** update constant. */
|
||||
/**
|
||||
* update constant.
|
||||
*/
|
||||
public static final String UPDATE = PrefixConstant.UPDATE + SuffixConstant.PROFILE;
|
||||
|
||||
private Profile() {
|
||||
@@ -65,13 +71,19 @@ public class MetadataConstant {
|
||||
*/
|
||||
public static class Point {
|
||||
|
||||
/** add constant. */
|
||||
/**
|
||||
* add constant.
|
||||
*/
|
||||
public static final String ADD = PrefixConstant.ADD + SuffixConstant.POINT;
|
||||
|
||||
/** delete constant. */
|
||||
/**
|
||||
* delete constant.
|
||||
*/
|
||||
public static final String DELETE = PrefixConstant.DELETE + SuffixConstant.POINT;
|
||||
|
||||
/** update constant. */
|
||||
/**
|
||||
* update constant.
|
||||
*/
|
||||
public static final String UPDATE = PrefixConstant.UPDATE + SuffixConstant.POINT;
|
||||
|
||||
private Point() {
|
||||
@@ -88,13 +100,19 @@ public class MetadataConstant {
|
||||
*/
|
||||
public static class Device {
|
||||
|
||||
/** add constant. */
|
||||
/**
|
||||
* add constant.
|
||||
*/
|
||||
public static final String ADD = PrefixConstant.ADD + SuffixConstant.DEVICE;
|
||||
|
||||
/** delete constant. */
|
||||
/**
|
||||
* delete constant.
|
||||
*/
|
||||
public static final String DELETE = PrefixConstant.DELETE + SuffixConstant.DEVICE;
|
||||
|
||||
/** update constant. */
|
||||
/**
|
||||
* update constant.
|
||||
*/
|
||||
public static final String UPDATE = PrefixConstant.UPDATE + SuffixConstant.DEVICE;
|
||||
|
||||
private Device() {
|
||||
@@ -111,13 +129,19 @@ public class MetadataConstant {
|
||||
*/
|
||||
public static class DriverConfig {
|
||||
|
||||
/** add constant. */
|
||||
/**
|
||||
* add constant.
|
||||
*/
|
||||
public static final String ADD = PrefixConstant.ADD + SuffixConstant.DRIVER_ATTRIBUTE_CONFIG;
|
||||
|
||||
/** delete constant. */
|
||||
/**
|
||||
* delete constant.
|
||||
*/
|
||||
public static final String DELETE = PrefixConstant.DELETE + SuffixConstant.DRIVER_ATTRIBUTE_CONFIG;
|
||||
|
||||
/** update constant. */
|
||||
/**
|
||||
* update constant.
|
||||
*/
|
||||
public static final String UPDATE = PrefixConstant.UPDATE + SuffixConstant.DRIVER_ATTRIBUTE_CONFIG;
|
||||
|
||||
private DriverConfig() {
|
||||
@@ -134,13 +158,19 @@ public class MetadataConstant {
|
||||
*/
|
||||
public static class PointConfig {
|
||||
|
||||
/** add constant. */
|
||||
/**
|
||||
* add constant.
|
||||
*/
|
||||
public static final String ADD = PrefixConstant.ADD + SuffixConstant.POINT_ATTRIBUTE_CONFIG;
|
||||
|
||||
/** delete constant. */
|
||||
/**
|
||||
* delete constant.
|
||||
*/
|
||||
public static final String DELETE = PrefixConstant.DELETE + SuffixConstant.POINT_ATTRIBUTE_CONFIG;
|
||||
|
||||
/** update constant. */
|
||||
/**
|
||||
* update constant.
|
||||
*/
|
||||
public static final String UPDATE = PrefixConstant.UPDATE + SuffixConstant.POINT_ATTRIBUTE_CONFIG;
|
||||
|
||||
private PointConfig() {
|
||||
|
||||
@@ -36,166 +36,288 @@ import io.github.pnoker.common.constant.common.SymbolConstant;
|
||||
public class RabbitConstant {
|
||||
|
||||
// Arguments
|
||||
/** message ttl constant. */
|
||||
/**
|
||||
* message ttl constant.
|
||||
*/
|
||||
public static final String MESSAGE_TTL = "x-message-ttl";
|
||||
|
||||
/** auto delete constant. */
|
||||
/**
|
||||
* auto delete constant.
|
||||
*/
|
||||
public static final String AUTO_DELETE = "x-auto-delete";
|
||||
|
||||
// Routing
|
||||
/** Routing key for register up prefix. */
|
||||
/**
|
||||
* Routing key for register up prefix.
|
||||
*/
|
||||
public static final String ROUTING_REGISTER_UP_PREFIX = "dc3.r.register.up.";
|
||||
|
||||
/** Routing key for register down prefix. */
|
||||
/**
|
||||
* Routing key for register down prefix.
|
||||
*/
|
||||
public static final String ROUTING_REGISTER_DOWN_PREFIX = "dc3.r.register.down.";
|
||||
|
||||
/** Routing key prefix for driver state events. */
|
||||
/**
|
||||
* Routing key prefix for driver state events.
|
||||
*/
|
||||
public static final String ROUTING_DRIVER_STATE_PREFIX = "dc3.r.state.driver.";
|
||||
|
||||
/** Routing key prefix for device state events. */
|
||||
/**
|
||||
* Routing key prefix for device state events.
|
||||
*/
|
||||
public static final String ROUTING_DEVICE_STATE_PREFIX = "dc3.r.state.device.";
|
||||
|
||||
/** Routing key for driver alarm prefix. */
|
||||
/**
|
||||
* Routing key for driver alarm prefix.
|
||||
*/
|
||||
public static final String ROUTING_DRIVER_ALARM_PREFIX = "dc3.r.alarm.driver.";
|
||||
|
||||
/** Routing key for device alarm prefix. */
|
||||
/**
|
||||
* Routing key for device alarm prefix.
|
||||
*/
|
||||
public static final String ROUTING_DEVICE_ALARM_PREFIX = "dc3.r.alarm.device.";
|
||||
|
||||
/** Routing key prefix for driver metadata events. */
|
||||
/**
|
||||
* Routing key prefix for driver metadata events.
|
||||
*/
|
||||
public static final String ROUTING_DRIVER_METADATA_PREFIX = "dc3.r.metadata.driver.";
|
||||
|
||||
|
||||
/** Routing key prefix for point commands. */
|
||||
/**
|
||||
* Routing key prefix for point commands.
|
||||
*/
|
||||
public static final String ROUTING_POINT_COMMAND_PREFIX = "dc3.r.point_command.";
|
||||
|
||||
/** Routing key prefix for point values. */
|
||||
/**
|
||||
* Routing key prefix for point values.
|
||||
*/
|
||||
public static final String ROUTING_POINT_VALUE_PREFIX = "dc3.r.value.point.";
|
||||
|
||||
/** Routing key for mqtt prefix. */
|
||||
/**
|
||||
* Routing key for mqtt prefix.
|
||||
*/
|
||||
public static final String ROUTING_MQTT_PREFIX = "dc3.r.mqtt.";
|
||||
/** Routing key for notify task prefix. */
|
||||
/**
|
||||
* Routing key for notify task prefix.
|
||||
*/
|
||||
public static final String ROUTING_NOTIFY_TASK_PREFIX = "dc3.r.notify.task.";
|
||||
// Routing keys
|
||||
/** Routing key for driver timeout delay. */
|
||||
/**
|
||||
* Routing key for driver timeout delay.
|
||||
*/
|
||||
public static final String ROUTING_DRIVER_TIMEOUT_DELAY = "state.timeout.driver.45s";
|
||||
/** Routing key for driver timeout check. */
|
||||
/**
|
||||
* Routing key for driver timeout check.
|
||||
*/
|
||||
public static final String ROUTING_DRIVER_TIMEOUT_CHECK = "state.timeout.driver.check";
|
||||
// Routing keys
|
||||
/** Routing key for device scan tick. */
|
||||
/**
|
||||
* Routing key for device scan tick.
|
||||
*/
|
||||
public static final String ROUTING_DEVICE_SCAN_TICK = "state.timeout.device.scan.tick";
|
||||
/** Routing key for device scan. */
|
||||
/**
|
||||
* Routing key for device scan.
|
||||
*/
|
||||
public static final String ROUTING_DEVICE_SCAN = "state.timeout.device.scan";
|
||||
/** Routing key for point command result. */
|
||||
/**
|
||||
* Routing key for point command result.
|
||||
*/
|
||||
public static final String ROUTING_POINT_COMMAND_RESULT = "dc3.r.point_command_result";
|
||||
|
||||
/** Routing key prefix for point command results. */
|
||||
/**
|
||||
* Routing key prefix for point command results.
|
||||
*/
|
||||
public static final String ROUTING_POINT_COMMAND_RESULT_PREFIX = ROUTING_POINT_COMMAND_RESULT + SymbolConstant.DOT;
|
||||
|
||||
// --- Tag-aware fields initialized from system property ---
|
||||
// Register
|
||||
/** Exchange carrying driver registration requests. */
|
||||
/**
|
||||
* Exchange carrying driver registration requests.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_REGISTER;
|
||||
/** Queue for driver registration requests. */
|
||||
/**
|
||||
* Queue for driver registration requests.
|
||||
*/
|
||||
public static final String QUEUE_REGISTER_UP;
|
||||
/** Queue prefix for registration acknowledgments. */
|
||||
/**
|
||||
* Queue prefix for registration acknowledgments.
|
||||
*/
|
||||
public static final String QUEUE_REGISTER_DOWN_PREFIX;
|
||||
// State
|
||||
/** Exchange carrying driver/device state events. */
|
||||
/**
|
||||
* Exchange carrying driver/device state events.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_STATE;
|
||||
/** Queue for driver state events. */
|
||||
/**
|
||||
* Queue for driver state events.
|
||||
*/
|
||||
public static final String QUEUE_DRIVER_STATE;
|
||||
/** Queue for device state events. */
|
||||
/**
|
||||
* Queue for device state events.
|
||||
*/
|
||||
public static final String QUEUE_DEVICE_STATE;
|
||||
// Alarm
|
||||
/** Exchange carrying alarm events. */
|
||||
/**
|
||||
* Exchange carrying alarm events.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_ALARM;
|
||||
/** Queue for driver alarm events. */
|
||||
/**
|
||||
* Queue for driver alarm events.
|
||||
*/
|
||||
public static final String QUEUE_DRIVER_ALARM;
|
||||
/** Queue for device alarm events. */
|
||||
/**
|
||||
* Queue for device alarm events.
|
||||
*/
|
||||
public static final String QUEUE_DEVICE_ALARM;
|
||||
/** Queue for notification tasks. */
|
||||
/**
|
||||
* Queue for notification tasks.
|
||||
*/
|
||||
public static final String QUEUE_NOTIFY_TASK;
|
||||
// Metadata
|
||||
/** Exchange carrying metadata-change events. */
|
||||
/**
|
||||
* Exchange carrying metadata-change events.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_METADATA;
|
||||
/** Queue prefix for per-driver metadata subscriptions. */
|
||||
/**
|
||||
* Queue prefix for per-driver metadata subscriptions.
|
||||
*/
|
||||
public static final String QUEUE_DRIVER_METADATA_PREFIX;
|
||||
// Point Command
|
||||
/** Exchange carrying point read/write commands. */
|
||||
/**
|
||||
* Exchange carrying point read/write commands.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_POINT_COMMAND;
|
||||
/** Queue prefix for per-node point commands. */
|
||||
/**
|
||||
* Queue prefix for per-node point commands.
|
||||
*/
|
||||
public static final String QUEUE_POINT_COMMAND_PREFIX;
|
||||
// Value
|
||||
/** Exchange carrying point values from drivers. */
|
||||
/**
|
||||
* Exchange carrying point values from drivers.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_VALUE;
|
||||
/** Queue for point values consumed by the data center. */
|
||||
/**
|
||||
* Queue for point values consumed by the data center.
|
||||
*/
|
||||
public static final String QUEUE_POINT_VALUE;
|
||||
// Mqtt
|
||||
/** Exchange carrying MQTT-ingested messages. */
|
||||
/**
|
||||
* Exchange carrying MQTT-ingested messages.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_MQTT;
|
||||
/** Queue for MQTT-ingested messages. */
|
||||
/**
|
||||
* Queue for MQTT-ingested messages.
|
||||
*/
|
||||
public static final String QUEUE_MQTT;
|
||||
// State Timeout - Delay Exchange (receives messages to be delayed)
|
||||
/** Exchange carrying delayed timeout checks. */
|
||||
/**
|
||||
* Exchange carrying delayed timeout checks.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_STATE_TIMEOUT_DELAY;
|
||||
// State Timeout - Check Exchange (receives expired messages from DLX)
|
||||
/** Exchange carrying timeout check messages. */
|
||||
/**
|
||||
* Exchange carrying timeout check messages.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_STATE_TIMEOUT_CHECK;
|
||||
// Driver timeout delay queue (45s TTL, dead-letter to check exchange)
|
||||
/** Queue holding delayed driver timeout checks. */
|
||||
/**
|
||||
* Queue holding delayed driver timeout checks.
|
||||
*/
|
||||
public static final String QUEUE_DRIVER_TIMEOUT_DELAY;
|
||||
// Driver timeout check queue (consumed by Data Center)
|
||||
/** Queue for driver timeout checks. */
|
||||
/**
|
||||
* Queue for driver timeout checks.
|
||||
*/
|
||||
public static final String QUEUE_DRIVER_TIMEOUT_CHECK;
|
||||
// Device scan tick delay queue (10s TTL, dead-letter to scan queue)
|
||||
/** Queue driving the periodic device scan tick. */
|
||||
/**
|
||||
* Queue driving the periodic device scan tick.
|
||||
*/
|
||||
public static final String QUEUE_DEVICE_SCAN_TICK;
|
||||
// Device scan execution queue (consumed by Data Center)
|
||||
/** Queue for device scan results. */
|
||||
/**
|
||||
* Queue for device scan results.
|
||||
*/
|
||||
public static final String QUEUE_DEVICE_SCAN;
|
||||
// Point Command Dead Letter
|
||||
/** Dead-letter exchange for failed point commands. */
|
||||
/**
|
||||
* Dead-letter exchange for failed point commands.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_POINT_COMMAND_DEAD;
|
||||
/** Dead-letter queue for failed point commands. */
|
||||
/**
|
||||
* Dead-letter queue for failed point commands.
|
||||
*/
|
||||
public static final String QUEUE_POINT_COMMAND_DEAD;
|
||||
// Point Command Result
|
||||
/** Exchange carrying point command results. */
|
||||
/**
|
||||
* Exchange carrying point command results.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_POINT_COMMAND_RESULT;
|
||||
/** Queue for point command results. */
|
||||
/**
|
||||
* Queue for point command results.
|
||||
*/
|
||||
public static final String QUEUE_POINT_COMMAND_RESULT;
|
||||
// Custom Command
|
||||
/** Exchange carrying custom device commands. */
|
||||
/**
|
||||
* Exchange carrying custom device commands.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_COMMAND;
|
||||
/** Queue prefix for per-node custom commands. */
|
||||
/**
|
||||
* Queue prefix for per-node custom commands.
|
||||
*/
|
||||
public static final String QUEUE_COMMAND_PREFIX;
|
||||
/** Routing key prefix for custom commands. */
|
||||
/**
|
||||
* Routing key prefix for custom commands.
|
||||
*/
|
||||
public static final String ROUTING_COMMAND_PREFIX;
|
||||
// Custom Command Result
|
||||
/** Exchange carrying custom command results. */
|
||||
/**
|
||||
* Exchange carrying custom command results.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_COMMAND_RESULT;
|
||||
/** Queue for custom command results. */
|
||||
/**
|
||||
* Queue for custom command results.
|
||||
*/
|
||||
public static final String QUEUE_COMMAND_RESULT;
|
||||
/** Routing key for custom command results. */
|
||||
/**
|
||||
* Routing key for custom command results.
|
||||
*/
|
||||
public static final String ROUTING_COMMAND_RESULT;
|
||||
|
||||
/** Routing key prefix for custom command results. */
|
||||
/**
|
||||
* Routing key prefix for custom command results.
|
||||
*/
|
||||
public static final String ROUTING_COMMAND_RESULT_PREFIX;
|
||||
// Custom Command Dead Letter
|
||||
/** Dead-letter exchange for failed custom commands. */
|
||||
/**
|
||||
* Dead-letter exchange for failed custom commands.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_COMMAND_DEAD;
|
||||
/** Dead-letter queue for failed custom commands. */
|
||||
/**
|
||||
* Dead-letter queue for failed custom commands.
|
||||
*/
|
||||
public static final String QUEUE_COMMAND_DEAD;
|
||||
// Event Report
|
||||
/** Exchange carrying reported domain events. */
|
||||
/**
|
||||
* Exchange carrying reported domain events.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_EVENT;
|
||||
/** Queue prefix for reported domain events. */
|
||||
/**
|
||||
* Queue prefix for reported domain events.
|
||||
*/
|
||||
public static final String QUEUE_EVENT_PREFIX;
|
||||
/** Routing key prefix for reported domain events. */
|
||||
/**
|
||||
* Routing key prefix for reported domain events.
|
||||
*/
|
||||
public static final String ROUTING_EVENT_PREFIX;
|
||||
// Point Value Dead Letter
|
||||
/** Dead-letter exchange for rejected point-value batches. */
|
||||
/**
|
||||
* Dead-letter exchange for rejected point-value batches.
|
||||
*/
|
||||
public static final String TOPIC_EXCHANGE_POINT_VALUE_DEAD;
|
||||
/** Dead-letter queue for rejected point-value batches. */
|
||||
/**
|
||||
* Dead-letter queue for rejected point-value batches.
|
||||
*/
|
||||
public static final String QUEUE_POINT_VALUE_DEAD;
|
||||
|
||||
static {
|
||||
|
||||
@@ -58,7 +58,9 @@ public class ScheduleConstant {
|
||||
*/
|
||||
public static final String BUFFER_REPUBLISH_SCHEDULE_JOB = "buffer-republish-schedule-job";
|
||||
|
||||
/** Driver runtime lease renewal job. */
|
||||
/**
|
||||
* Driver runtime lease renewal job.
|
||||
*/
|
||||
public static final String DRIVER_LEASE_RENEW_SCHEDULE_JOB = "driver-lease-renew-schedule-job";
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,25 +41,39 @@ public class StrategyConstant {
|
||||
*/
|
||||
public static class Storage {
|
||||
|
||||
/** Prefix of repository. */
|
||||
/**
|
||||
* Prefix of repository.
|
||||
*/
|
||||
public static final String REPOSITORY_PREFIX = "repository" + SymbolConstant.COLON;
|
||||
|
||||
/** postgres constant. */
|
||||
/**
|
||||
* postgres constant.
|
||||
*/
|
||||
public static final String POSTGRES = "postgres";
|
||||
|
||||
/** influxdb constant. */
|
||||
/**
|
||||
* influxdb constant.
|
||||
*/
|
||||
public static final String INFLUXDB = "influxdb";
|
||||
|
||||
/** tdengine constant. */
|
||||
/**
|
||||
* tdengine constant.
|
||||
*/
|
||||
public static final String TDENGINE = "tdengine";
|
||||
|
||||
/** opentsdb constant. */
|
||||
/**
|
||||
* opentsdb constant.
|
||||
*/
|
||||
public static final String OPENTSDB = "opentsdb";
|
||||
|
||||
/** mongodb constant. */
|
||||
/**
|
||||
* mongodb constant.
|
||||
*/
|
||||
public static final String MONGODB = "mongodb";
|
||||
|
||||
/** elasticsearch constant. */
|
||||
/**
|
||||
* elasticsearch constant.
|
||||
*/
|
||||
public static final String ELASTICSEARCH = "elasticsearch";
|
||||
|
||||
private Storage() {
|
||||
|
||||
@@ -25,9 +25,13 @@ package io.github.pnoker.common.constant.mq;
|
||||
*/
|
||||
public enum ConsumptionProfile {
|
||||
|
||||
/** Low latency, low volume (commands, metadata, control streams). */
|
||||
/**
|
||||
* Low latency, low volume (commands, metadata, control streams).
|
||||
*/
|
||||
LATENCY,
|
||||
|
||||
/** High throughput fan-in (point values and similar firehoses). */
|
||||
/**
|
||||
* High throughput fan-in (point values and similar firehoses).
|
||||
*/
|
||||
THROUGHPUT
|
||||
}
|
||||
|
||||
@@ -25,9 +25,13 @@ package io.github.pnoker.common.constant.mq;
|
||||
*/
|
||||
public enum DeliveryMode {
|
||||
|
||||
/** One message per listener invocation. */
|
||||
/**
|
||||
* One message per listener invocation.
|
||||
*/
|
||||
SINGLE,
|
||||
|
||||
/** Broker batches per listener invocation (batch is the ack unit). */
|
||||
/**
|
||||
* Broker batches per listener invocation (batch is the ack unit).
|
||||
*/
|
||||
BATCH
|
||||
}
|
||||
|
||||
@@ -26,48 +26,78 @@ package io.github.pnoker.common.constant.mq;
|
||||
*/
|
||||
public enum MqTopic {
|
||||
|
||||
/** Driver/device lifecycle states. */
|
||||
/**
|
||||
* Driver/device lifecycle states.
|
||||
*/
|
||||
STATE,
|
||||
|
||||
/** Driver/device alarms; also carries notify tasks. */
|
||||
/**
|
||||
* Driver/device alarms; also carries notify tasks.
|
||||
*/
|
||||
ALARM,
|
||||
|
||||
/** Driver metadata sync (broadcast to every driver instance). */
|
||||
/**
|
||||
* Driver metadata sync (broadcast to every driver instance).
|
||||
*/
|
||||
METADATA,
|
||||
|
||||
/** Point read/write commands, data center to driver. */
|
||||
/**
|
||||
* Point read/write commands, data center to driver.
|
||||
*/
|
||||
POINT_COMMAND,
|
||||
|
||||
/** Telemetry point values, driver to data center. */
|
||||
/**
|
||||
* Telemetry point values, driver to data center.
|
||||
*/
|
||||
POINT_VALUE,
|
||||
|
||||
/** Driver/device event reports. */
|
||||
/**
|
||||
* Driver/device event reports.
|
||||
*/
|
||||
EVENT,
|
||||
|
||||
/** Device-level custom commands, data center to driver. */
|
||||
/**
|
||||
* Device-level custom commands, data center to driver.
|
||||
*/
|
||||
COMMAND,
|
||||
|
||||
/** Custom command results, driver to data center. */
|
||||
/**
|
||||
* Custom command results, driver to data center.
|
||||
*/
|
||||
COMMAND_RESULT,
|
||||
|
||||
/** Point command results, driver to data center. */
|
||||
/**
|
||||
* Point command results, driver to data center.
|
||||
*/
|
||||
POINT_COMMAND_RESULT,
|
||||
|
||||
/** Outbound notification tasks. */
|
||||
/**
|
||||
* Outbound notification tasks.
|
||||
*/
|
||||
NOTIFY_TASK,
|
||||
|
||||
/** Driver lease timeout check (delayed trigger, DB lease is the source of truth). */
|
||||
/**
|
||||
* Driver lease timeout check (delayed trigger, DB lease is the source of truth).
|
||||
*/
|
||||
STATE_TIMEOUT,
|
||||
|
||||
/** Device scan tick (10 s delayed self-perpetuating cycle). */
|
||||
/**
|
||||
* Device scan tick (10 s delayed self-perpetuating cycle).
|
||||
*/
|
||||
DEVICE_SCAN,
|
||||
|
||||
/** Quarantine for point values (no consumer by design). */
|
||||
/**
|
||||
* Quarantine for point values (no consumer by design).
|
||||
*/
|
||||
POINT_VALUE_DEAD,
|
||||
|
||||
/** Dead letter for point commands. */
|
||||
/**
|
||||
* Dead letter for point commands.
|
||||
*/
|
||||
POINT_COMMAND_DEAD,
|
||||
|
||||
/** Dead letter for custom commands. */
|
||||
/**
|
||||
* Dead letter for custom commands.
|
||||
*/
|
||||
COMMAND_DEAD
|
||||
}
|
||||
|
||||
@@ -25,9 +25,13 @@ package io.github.pnoker.common.constant.mq;
|
||||
*/
|
||||
public enum OrderingGuarantee {
|
||||
|
||||
/** No ordering guarantee between deliveries. */
|
||||
/**
|
||||
* No ordering guarantee between deliveries.
|
||||
*/
|
||||
NONE,
|
||||
|
||||
/** Deliveries with the same partition key are ordered. */
|
||||
/**
|
||||
* Deliveries with the same partition key are ordered.
|
||||
*/
|
||||
PER_KEY
|
||||
}
|
||||
|
||||
@@ -26,9 +26,13 @@ package io.github.pnoker.common.constant.mq;
|
||||
*/
|
||||
public enum SubscriptionMode {
|
||||
|
||||
/** Competing consumers on a shared destination. */
|
||||
/**
|
||||
* Competing consumers on a shared destination.
|
||||
*/
|
||||
LOAD_BALANCE,
|
||||
|
||||
/** Every running instance receives its own copy. */
|
||||
/**
|
||||
* Every running instance receives its own copy.
|
||||
*/
|
||||
BROADCAST
|
||||
}
|
||||
|
||||
@@ -81,22 +81,34 @@ public class AgenticConstant {
|
||||
*/
|
||||
public static class ToolContextKey {
|
||||
|
||||
/** Tool-context key carrying the authenticated tenant id. */
|
||||
/**
|
||||
* Tool-context key carrying the authenticated tenant id.
|
||||
*/
|
||||
public static final String TENANT_ID = "dc3.agentic.tenantId";
|
||||
|
||||
/** Tool-context key carrying the authenticated user id. */
|
||||
/**
|
||||
* Tool-context key carrying the authenticated user id.
|
||||
*/
|
||||
public static final String USER_ID = "dc3.agentic.userId";
|
||||
|
||||
/** Tool-context key carrying the authenticated principal header. */
|
||||
/**
|
||||
* Tool-context key carrying the authenticated principal header.
|
||||
*/
|
||||
public static final String USER_HEADER = "dc3.agentic.userHeader";
|
||||
|
||||
/** Tool-context key carrying the conversation id. */
|
||||
/**
|
||||
* Tool-context key carrying the conversation id.
|
||||
*/
|
||||
public static final String CONVERSATION_ID = "dc3.agentic.conversationId";
|
||||
|
||||
/** Tool-context key accumulating runtime events of the current run. */
|
||||
/**
|
||||
* Tool-context key accumulating runtime events of the current run.
|
||||
*/
|
||||
public static final String RUN_EVENTS = "dc3.agentic.runEvents";
|
||||
|
||||
/** Tool-context key accumulating structured visualizations of the current run. */
|
||||
/**
|
||||
* Tool-context key accumulating structured visualizations of the current run.
|
||||
*/
|
||||
public static final String VISUALIZATIONS = "dc3.agentic.visualizations";
|
||||
|
||||
private ToolContextKey() {
|
||||
@@ -113,34 +125,54 @@ public class AgenticConstant {
|
||||
*/
|
||||
public static class Chat {
|
||||
|
||||
/** SSE object for a full completion response. */
|
||||
/**
|
||||
* SSE object for a full completion response.
|
||||
*/
|
||||
public static final String COMPLETION_OBJECT = "chat.completion";
|
||||
|
||||
/** SSE object for a completion stream chunk. */
|
||||
/**
|
||||
* SSE object for a completion stream chunk.
|
||||
*/
|
||||
public static final String COMPLETION_CHUNK_OBJECT = "chat.completion.chunk";
|
||||
|
||||
/** Prefix used to synthesize OpenAI-compatible response ids. */
|
||||
/**
|
||||
* Prefix used to synthesize OpenAI-compatible response ids.
|
||||
*/
|
||||
public static final String ID_PREFIX = "chatcmpl-";
|
||||
|
||||
/** Sentinel terminating an OpenAI-compatible completion stream. */
|
||||
/**
|
||||
* Sentinel terminating an OpenAI-compatible completion stream.
|
||||
*/
|
||||
public static final String STREAM_DONE = "[DONE]";
|
||||
|
||||
/** Chat role of the system message. */
|
||||
/**
|
||||
* Chat role of the system message.
|
||||
*/
|
||||
public static final String ROLE_SYSTEM = "system";
|
||||
|
||||
/** Chat role of user messages. */
|
||||
/**
|
||||
* Chat role of user messages.
|
||||
*/
|
||||
public static final String ROLE_USER = "user";
|
||||
|
||||
/** Chat role of assistant messages. */
|
||||
/**
|
||||
* Chat role of assistant messages.
|
||||
*/
|
||||
public static final String ROLE_ASSISTANT = "assistant";
|
||||
|
||||
/** Chat role of tool results. */
|
||||
/**
|
||||
* Chat role of tool results.
|
||||
*/
|
||||
public static final String ROLE_TOOL = "tool";
|
||||
|
||||
/** Finish reason for a normally completed response. */
|
||||
/**
|
||||
* Finish reason for a normally completed response.
|
||||
*/
|
||||
public static final String FINISH_REASON_STOP = "stop";
|
||||
|
||||
/** Finish reason for an errored response. */
|
||||
/**
|
||||
* Finish reason for an errored response.
|
||||
*/
|
||||
public static final String FINISH_REASON_ERROR = "error";
|
||||
|
||||
private Chat() {
|
||||
@@ -157,41 +189,63 @@ public class AgenticConstant {
|
||||
*/
|
||||
public static class Visualization {
|
||||
|
||||
/** SSE object identifying structured visualizations. */
|
||||
/**
|
||||
* SSE object identifying structured visualizations.
|
||||
*/
|
||||
public static final String OBJECT = "agentic.visualization";
|
||||
|
||||
private Visualization() {
|
||||
throw new IllegalStateException(BaseConstant.UTILITY_CLASS);
|
||||
}
|
||||
|
||||
/** Chart type codes the visualization channel accepts (line/area/column/bar/pie/donut/heatmap/scatter/stat). */
|
||||
/**
|
||||
* Chart type codes the visualization channel accepts (line/area/column/bar/pie/donut/heatmap/scatter/stat).
|
||||
*/
|
||||
public static class Type {
|
||||
|
||||
/** Line chart type code. */
|
||||
/**
|
||||
* Line chart type code.
|
||||
*/
|
||||
public static final String LINE = "line";
|
||||
|
||||
/** Area chart type code. */
|
||||
/**
|
||||
* Area chart type code.
|
||||
*/
|
||||
public static final String AREA = "area";
|
||||
|
||||
/** Column chart type code. */
|
||||
/**
|
||||
* Column chart type code.
|
||||
*/
|
||||
public static final String COLUMN = "column";
|
||||
|
||||
/** Bar chart type code. */
|
||||
/**
|
||||
* Bar chart type code.
|
||||
*/
|
||||
public static final String BAR = "bar";
|
||||
|
||||
/** Pie chart type code. */
|
||||
/**
|
||||
* Pie chart type code.
|
||||
*/
|
||||
public static final String PIE = "pie";
|
||||
|
||||
/** Donut chart type code. */
|
||||
/**
|
||||
* Donut chart type code.
|
||||
*/
|
||||
public static final String DONUT = "donut";
|
||||
|
||||
/** Heatmap chart type code. */
|
||||
/**
|
||||
* Heatmap chart type code.
|
||||
*/
|
||||
public static final String HEATMAP = "heatmap";
|
||||
|
||||
/** Scatter chart type code. */
|
||||
/**
|
||||
* Scatter chart type code.
|
||||
*/
|
||||
public static final String SCATTER = "scatter";
|
||||
|
||||
/** Stat card type code. */
|
||||
/**
|
||||
* Stat card type code.
|
||||
*/
|
||||
public static final String STAT = "stat";
|
||||
|
||||
private Type() {
|
||||
@@ -200,13 +254,19 @@ public class AgenticConstant {
|
||||
|
||||
}
|
||||
|
||||
/** Axis scale kinds: linear or time. */
|
||||
/**
|
||||
* Axis scale kinds: linear or time.
|
||||
*/
|
||||
public static class Scale {
|
||||
|
||||
/** Linear axis scale kind. */
|
||||
/**
|
||||
* Linear axis scale kind.
|
||||
*/
|
||||
public static final String LINEAR = "linear";
|
||||
|
||||
/** Time axis scale kind. */
|
||||
/**
|
||||
* Time axis scale kind.
|
||||
*/
|
||||
public static final String TIME = "time";
|
||||
|
||||
private Scale() {
|
||||
@@ -225,7 +285,9 @@ public class AgenticConstant {
|
||||
*/
|
||||
public static class Session {
|
||||
|
||||
/** Title assigned to sessions without a user-provided title. */
|
||||
/**
|
||||
* Title assigned to sessions without a user-provided title.
|
||||
*/
|
||||
public static final String DEFAULT_TITLE = "New Conversation";
|
||||
|
||||
private Session() {
|
||||
@@ -242,43 +304,69 @@ public class AgenticConstant {
|
||||
*/
|
||||
public static class RunEvent {
|
||||
|
||||
/** SSE object identifying structured visualizations. */
|
||||
/**
|
||||
* SSE object identifying structured visualizations.
|
||||
*/
|
||||
public static final String OBJECT = "agentic.event";
|
||||
|
||||
/** Run-event type for plain lifecycle events. */
|
||||
/**
|
||||
* Run-event type for plain lifecycle events.
|
||||
*/
|
||||
public static final String TYPE_EVENT = "event";
|
||||
|
||||
/** Run-event type for tool invocations. */
|
||||
/**
|
||||
* Run-event type for tool invocations.
|
||||
*/
|
||||
public static final String TYPE_TOOL = "tool";
|
||||
|
||||
/** Run-event type for reasoning steps. */
|
||||
/**
|
||||
* Run-event type for reasoning steps.
|
||||
*/
|
||||
public static final String TYPE_REASONING = "reasoning";
|
||||
|
||||
/** Run-event type for failures. */
|
||||
/**
|
||||
* Run-event type for failures.
|
||||
*/
|
||||
public static final String TYPE_ERROR = "error";
|
||||
|
||||
/** Emitter name shared by all agentic run events. */
|
||||
/**
|
||||
* Emitter name shared by all agentic run events.
|
||||
*/
|
||||
public static final String NAME_AGENTIC = "agentic";
|
||||
|
||||
/** Run-event phase marking the start of a step. */
|
||||
/**
|
||||
* Run-event phase marking the start of a step.
|
||||
*/
|
||||
public static final String PHASE_START = "start";
|
||||
|
||||
/** Run-event phase marking the result of a step. */
|
||||
/**
|
||||
* Run-event phase marking the result of a step.
|
||||
*/
|
||||
public static final String PHASE_RESULT = "result";
|
||||
|
||||
/** Run-event phase marking a failed step. */
|
||||
/**
|
||||
* Run-event phase marking a failed step.
|
||||
*/
|
||||
public static final String PHASE_ERROR = "error";
|
||||
|
||||
/** Run-event status for in-flight steps. */
|
||||
/**
|
||||
* Run-event status for in-flight steps.
|
||||
*/
|
||||
public static final String STATUS_RUNNING = "running";
|
||||
|
||||
/** Run-event status for completed steps. */
|
||||
/**
|
||||
* Run-event status for completed steps.
|
||||
*/
|
||||
public static final String STATUS_SUCCESS = "success";
|
||||
|
||||
/** Run-event status for steps with no data. */
|
||||
/**
|
||||
* Run-event status for steps with no data.
|
||||
*/
|
||||
public static final String STATUS_EMPTY = "empty";
|
||||
|
||||
/** Run-event status for failed steps. */
|
||||
/**
|
||||
* Run-event status for failed steps.
|
||||
*/
|
||||
public static final String STATUS_FAILED = "failed";
|
||||
|
||||
private RunEvent() {
|
||||
@@ -295,31 +383,49 @@ public class AgenticConstant {
|
||||
*/
|
||||
public static class ToolResult {
|
||||
|
||||
/** Tool-result field carrying structured visualizations. */
|
||||
/**
|
||||
* Tool-result field carrying structured visualizations.
|
||||
*/
|
||||
public static final String FIELD_VISUALIZATIONS = "visualizations";
|
||||
|
||||
/** Tool result code for success. */
|
||||
/**
|
||||
* Tool result code for success.
|
||||
*/
|
||||
public static final String CODE_OK = "OK";
|
||||
|
||||
/** Tool result code for empty results. */
|
||||
/**
|
||||
* Tool result code for empty results.
|
||||
*/
|
||||
public static final String CODE_EMPTY = "EMPTY";
|
||||
|
||||
/** Tool result code for invalid arguments. */
|
||||
/**
|
||||
* Tool result code for invalid arguments.
|
||||
*/
|
||||
public static final String CODE_INVALID_ARGUMENT = "INVALID_ARGUMENT";
|
||||
|
||||
/** Tool result code for missing resources. */
|
||||
/**
|
||||
* Tool result code for missing resources.
|
||||
*/
|
||||
public static final String CODE_NOT_FOUND = "NOT_FOUND";
|
||||
|
||||
/** Tool result code for unavailable capabilities. */
|
||||
/**
|
||||
* Tool result code for unavailable capabilities.
|
||||
*/
|
||||
public static final String CODE_UNAVAILABLE = "UNAVAILABLE";
|
||||
|
||||
/** Tool result code for failures. */
|
||||
/**
|
||||
* Tool result code for failures.
|
||||
*/
|
||||
public static final String CODE_ERROR = "ERROR";
|
||||
|
||||
/** Default success message for tool results. */
|
||||
/**
|
||||
* Default success message for tool results.
|
||||
*/
|
||||
public static final String MESSAGE_COMPLETED = "Tool completed";
|
||||
|
||||
/** Default failure message for tool results. */
|
||||
/**
|
||||
* Default failure message for tool results.
|
||||
*/
|
||||
public static final String MESSAGE_EXECUTION_FAILED = "Tool execution failed";
|
||||
|
||||
private ToolResult() {
|
||||
@@ -336,13 +442,19 @@ public class AgenticConstant {
|
||||
*/
|
||||
public static class ToolLimit {
|
||||
|
||||
/** Maximum ids accepted per tool call. */
|
||||
/**
|
||||
* Maximum ids accepted per tool call.
|
||||
*/
|
||||
public static final int MAX_IDS = 50;
|
||||
|
||||
/** Maximum history records returned per tool call. */
|
||||
/**
|
||||
* Maximum history records returned per tool call.
|
||||
*/
|
||||
public static final int MAX_HISTORY_RECORDS = 200;
|
||||
|
||||
/** Maximum agentic loop rounds per conversation turn. */
|
||||
/**
|
||||
* Maximum agentic loop rounds per conversation turn.
|
||||
*/
|
||||
public static final int MAX_AGENT_LOOP_ROUNDS = 8;
|
||||
|
||||
private ToolLimit() {
|
||||
@@ -359,17 +471,25 @@ public class AgenticConstant {
|
||||
*/
|
||||
public static class ToolMessage {
|
||||
|
||||
/** Tool message when status/health tools are unavailable in the deployment mode. */
|
||||
/**
|
||||
* Tool message when status/health tools are unavailable in the deployment mode.
|
||||
*/
|
||||
public static final String STATUS_HEALTH_UNAVAILABLE =
|
||||
"Status and health tools are not available in this deployment mode.";
|
||||
|
||||
/** Tool message when profile tools are unavailable in the deployment mode. */
|
||||
/**
|
||||
* Tool message when profile tools are unavailable in the deployment mode.
|
||||
*/
|
||||
public static final String PROFILE_UNAVAILABLE = "Profile tools are not available in this deployment mode.";
|
||||
|
||||
/** Tool message when the system health snapshot is unavailable. */
|
||||
/**
|
||||
* Tool message when the system health snapshot is unavailable.
|
||||
*/
|
||||
public static final String SYSTEM_HEALTH_UNAVAILABLE = "System health snapshot is unavailable.";
|
||||
|
||||
/** Generic tool request failure message. */
|
||||
/**
|
||||
* Generic tool request failure message.
|
||||
*/
|
||||
public static final String REQUEST_FAILED = "Request failed";
|
||||
|
||||
private ToolMessage() {
|
||||
|
||||
@@ -27,22 +27,34 @@ import io.github.pnoker.common.constant.common.BaseConstant;
|
||||
*/
|
||||
public class AlarmConstant {
|
||||
|
||||
/** Match type marking a firing (threshold-crossing) alarm evaluation. */
|
||||
/**
|
||||
* Match type marking a firing (threshold-crossing) alarm evaluation.
|
||||
*/
|
||||
public static final String MATCH_TYPE_FIRING = "FIRING";
|
||||
|
||||
/** Match type marking a recovery (back-to-normal) alarm evaluation. */
|
||||
/**
|
||||
* Match type marking a recovery (back-to-normal) alarm evaluation.
|
||||
*/
|
||||
public static final String MATCH_TYPE_RECOVERY = "RECOVERY";
|
||||
|
||||
/** JSON extension column holding the rule-event payload. */
|
||||
/**
|
||||
* JSON extension column holding the rule-event payload.
|
||||
*/
|
||||
public static final String EXT_RULE_EVENT = "ALARM_RULE_EVENT";
|
||||
|
||||
/** JSON extension column holding the rule-state snapshot. */
|
||||
/**
|
||||
* JSON extension column holding the rule-state snapshot.
|
||||
*/
|
||||
public static final String EXT_RULE_STATE = "ALARM_RULE_STATE";
|
||||
|
||||
/** JSON extension column holding the notify-history request payload. */
|
||||
/**
|
||||
* JSON extension column holding the notify-history request payload.
|
||||
*/
|
||||
public static final String EXT_NOTIFY_HISTORY_REQUEST = "ALARM_NOTIFY_HISTORY_REQUEST";
|
||||
|
||||
/** JSON extension column holding the notify-history response payload. */
|
||||
/**
|
||||
* JSON extension column holding the notify-history response payload.
|
||||
*/
|
||||
public static final String EXT_NOTIFY_HISTORY_RESPONSE = "ALARM_NOTIFY_HISTORY_RESPONSE";
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,55 +33,89 @@ public class AuthConstant {
|
||||
*/
|
||||
public static final String SERVICE_NAME = "dc3-center-auth";
|
||||
|
||||
/** URL prefix for the user controller. */
|
||||
/**
|
||||
* URL prefix for the user controller.
|
||||
*/
|
||||
public static final String USER_URL_PREFIX = "/user";
|
||||
|
||||
/** URL prefix for the user-profile controller. */
|
||||
/**
|
||||
* URL prefix for the user-profile controller.
|
||||
*/
|
||||
public static final String USER_PROFILE_URL_PREFIX = "/user_profile";
|
||||
|
||||
/** URL prefix for the local-credential controller. */
|
||||
/**
|
||||
* URL prefix for the local-credential controller.
|
||||
*/
|
||||
public static final String LOCAL_CREDENTIAL_URL_PREFIX = "/local_credential";
|
||||
|
||||
/** URL prefix for the service-account controller. */
|
||||
/**
|
||||
* URL prefix for the service-account controller.
|
||||
*/
|
||||
public static final String SERVICE_ACCOUNT_URL_PREFIX = "/service_account";
|
||||
|
||||
/** URL prefix for the principal controller. */
|
||||
/**
|
||||
* URL prefix for the principal controller.
|
||||
*/
|
||||
public static final String PRINCIPAL_URL_PREFIX = "/principal";
|
||||
|
||||
/** URL prefix for the tenant-membership controller. */
|
||||
/**
|
||||
* URL prefix for the tenant-membership controller.
|
||||
*/
|
||||
public static final String TENANT_MEMBERSHIP_URL_PREFIX = "/tenant_membership";
|
||||
|
||||
/** URL prefix for the identity-audit controller. */
|
||||
/**
|
||||
* URL prefix for the identity-audit controller.
|
||||
*/
|
||||
public static final String IDENTITY_AUDIT_URL_PREFIX = "/identity_audit";
|
||||
|
||||
/** URL prefix for the tenant controller. */
|
||||
/**
|
||||
* URL prefix for the tenant controller.
|
||||
*/
|
||||
public static final String TENANT_URL_PREFIX = "/tenant";
|
||||
|
||||
/** URL prefix for the token controller. */
|
||||
/**
|
||||
* URL prefix for the token controller.
|
||||
*/
|
||||
public static final String TOKEN_URL_PREFIX = "/token";
|
||||
|
||||
/** URL prefix for the dictionary controller. */
|
||||
/**
|
||||
* URL prefix for the dictionary controller.
|
||||
*/
|
||||
public static final String DICTIONARY_URL_PREFIX = "/dictionary";
|
||||
|
||||
/** URL prefix for the role controller. */
|
||||
/**
|
||||
* URL prefix for the role controller.
|
||||
*/
|
||||
public static final String ROLE_URL_PREFIX = "/role";
|
||||
|
||||
/** URL prefix for the resource controller. */
|
||||
/**
|
||||
* URL prefix for the resource controller.
|
||||
*/
|
||||
public static final String RESOURCE_URL_PREFIX = "/resource";
|
||||
|
||||
/** URL prefix for the role-principal bind controller. */
|
||||
/**
|
||||
* URL prefix for the role-principal bind controller.
|
||||
*/
|
||||
public static final String ROLE_PRINCIPAL_URL_PREFIX = "/role_principal";
|
||||
|
||||
/** URL prefix for the role-resource bind controller. */
|
||||
/**
|
||||
* URL prefix for the role-resource bind controller.
|
||||
*/
|
||||
public static final String ROLE_RESOURCE_URL_PREFIX = "/role_resource";
|
||||
|
||||
/** URL prefix for the API resource controller. */
|
||||
/**
|
||||
* URL prefix for the API resource controller.
|
||||
*/
|
||||
public static final String API_URL_PREFIX = "/api";
|
||||
|
||||
/** URL prefix for the menu controller. */
|
||||
/**
|
||||
* URL prefix for the menu controller.
|
||||
*/
|
||||
public static final String MENU_URL_PREFIX = "/menu";
|
||||
|
||||
/** URL prefix for MCP endpoints, defined by {@link McpConstant}. */
|
||||
/**
|
||||
* URL prefix for MCP endpoints, defined by {@link McpConstant}.
|
||||
*/
|
||||
public static final String MCP_URL_PREFIX = McpConstant.URL_PREFIX;
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,79 +38,129 @@ public class DataConstant {
|
||||
*/
|
||||
public static final String STATUS_UNKNOWN = "unknown";
|
||||
|
||||
/** URL prefix for the point-value controller. */
|
||||
/**
|
||||
* URL prefix for the point-value controller.
|
||||
*/
|
||||
public static final String POINT_VALUE_URL_PREFIX = "/point_value";
|
||||
|
||||
/** URL prefix for the point-command controller. */
|
||||
/**
|
||||
* URL prefix for the point-command controller.
|
||||
*/
|
||||
public static final String POINT_COMMAND_URL_PREFIX = "/point_command";
|
||||
|
||||
/** URL prefix for the point-command history controller. */
|
||||
/**
|
||||
* URL prefix for the point-command history controller.
|
||||
*/
|
||||
public static final String POINT_COMMAND_HISTORY_URL_PREFIX = "/point_command_history";
|
||||
|
||||
/** URL prefix for the dashboard controller. */
|
||||
/**
|
||||
* URL prefix for the dashboard controller.
|
||||
*/
|
||||
public static final String DASHBOARD_URL_PREFIX = "/dashboard";
|
||||
|
||||
/** URL prefix for the alarm-rule controller. */
|
||||
/**
|
||||
* URL prefix for the alarm-rule controller.
|
||||
*/
|
||||
public static final String RULE_URL_PREFIX = "/rule";
|
||||
|
||||
/** URL prefix for the rule-state controller. */
|
||||
/**
|
||||
* URL prefix for the rule-state controller.
|
||||
*/
|
||||
public static final String RULE_STATE_URL_PREFIX = "/rule/state";
|
||||
|
||||
/** URL prefix for the notify-policy controller. */
|
||||
/**
|
||||
* URL prefix for the notify-policy controller.
|
||||
*/
|
||||
public static final String NOTIFY_URL_PREFIX = "/notify";
|
||||
|
||||
/** URL prefix for the notify-channel controller. */
|
||||
/**
|
||||
* URL prefix for the notify-channel controller.
|
||||
*/
|
||||
public static final String NOTIFY_CHANNEL_URL_PREFIX = "/notify/channel";
|
||||
|
||||
/** URL prefix for the notify-channel bind controller. */
|
||||
/**
|
||||
* URL prefix for the notify-channel bind controller.
|
||||
*/
|
||||
public static final String NOTIFY_CHANNEL_BIND_URL_PREFIX = "/notify/channel/bind";
|
||||
|
||||
/** URL prefix for the notify-history controller. */
|
||||
/**
|
||||
* URL prefix for the notify-history controller.
|
||||
*/
|
||||
public static final String NOTIFY_HISTORY_URL_PREFIX = "/notify/history";
|
||||
|
||||
/** URL prefix for the message controller. */
|
||||
/**
|
||||
* URL prefix for the message controller.
|
||||
*/
|
||||
public static final String MESSAGE_URL_PREFIX = "/message";
|
||||
|
||||
/** URL prefix for the command-history controller. */
|
||||
/**
|
||||
* URL prefix for the command-history controller.
|
||||
*/
|
||||
public static final String COMMAND_HISTORY_URL_PREFIX = "/command_history";
|
||||
|
||||
/** URL prefix for the event-history controller. */
|
||||
/**
|
||||
* URL prefix for the event-history controller.
|
||||
*/
|
||||
public static final String EVENT_HISTORY_URL_PREFIX = "/event_history";
|
||||
|
||||
/** URL prefix for the driver-status controller. */
|
||||
/**
|
||||
* URL prefix for the driver-status controller.
|
||||
*/
|
||||
public static final String DRIVER_STATUS_URL_PREFIX = "/driver/status";
|
||||
|
||||
/** URL prefix for the driver-event controller. */
|
||||
/**
|
||||
* URL prefix for the driver-event controller.
|
||||
*/
|
||||
public static final String DRIVER_EVENT_URL_PREFIX = "/driver/event";
|
||||
|
||||
/** URL prefix for the device-status controller. */
|
||||
/**
|
||||
* URL prefix for the device-status controller.
|
||||
*/
|
||||
public static final String DEVICE_STATUS_URL_PREFIX = "/device/status";
|
||||
|
||||
/** URL prefix for the device-event controller. */
|
||||
/**
|
||||
* URL prefix for the device-event controller.
|
||||
*/
|
||||
public static final String DEVICE_EVENT_URL_PREFIX = "/device/event";
|
||||
|
||||
/** URL prefix for the RabbitMQ connection admin endpoint. */
|
||||
/**
|
||||
* URL prefix for the RabbitMQ connection admin endpoint.
|
||||
*/
|
||||
public static final String RABBITMQ_CONNECTION_URL_PREFIX = "/rabbitmq/connection";
|
||||
|
||||
/** URL prefix for the RabbitMQ message admin endpoint. */
|
||||
/**
|
||||
* URL prefix for the RabbitMQ message admin endpoint.
|
||||
*/
|
||||
public static final String RABBITMQ_MESSAGE_URL_PREFIX = "/rabbitmq/message";
|
||||
|
||||
/** URL prefix for the RabbitMQ publisher admin endpoint. */
|
||||
/**
|
||||
* URL prefix for the RabbitMQ publisher admin endpoint.
|
||||
*/
|
||||
public static final String RABBITMQ_PUBLISHER_URL_PREFIX = "/rabbitmq/publisher";
|
||||
|
||||
/** URL prefix for the RabbitMQ queue admin endpoint. */
|
||||
/**
|
||||
* URL prefix for the RabbitMQ queue admin endpoint.
|
||||
*/
|
||||
public static final String RABBITMQ_QUEUE_URL_PREFIX = "/rabbitmq/queue";
|
||||
|
||||
/** URL prefix for the RabbitMQ consumer admin endpoint. */
|
||||
/**
|
||||
* URL prefix for the RabbitMQ consumer admin endpoint.
|
||||
*/
|
||||
public static final String RABBITMQ_CONSUMER_URL_PREFIX = "/rabbitmq/consumer";
|
||||
|
||||
/** URL prefix for the RabbitMQ channel admin endpoint. */
|
||||
/**
|
||||
* URL prefix for the RabbitMQ channel admin endpoint.
|
||||
*/
|
||||
public static final String RABBITMQ_CHANNEL_URL_PREFIX = "/rabbitmq/channel";
|
||||
|
||||
/** URL prefix for the RabbitMQ node admin endpoint. */
|
||||
/**
|
||||
* URL prefix for the RabbitMQ node admin endpoint.
|
||||
*/
|
||||
public static final String RABBITMQ_NODE_URL_PREFIX = "/rabbitmq/node";
|
||||
|
||||
/** URL prefix for the RabbitMQ cluster admin endpoint. */
|
||||
/**
|
||||
* URL prefix for the RabbitMQ cluster admin endpoint.
|
||||
*/
|
||||
public static final String RABBITMQ_CLUSTER_URL_PREFIX = "/rabbitmq/cluster";
|
||||
|
||||
private DataConstant() {
|
||||
|
||||
@@ -33,7 +33,9 @@ public class DriverConstant {
|
||||
*/
|
||||
public static final String SERVICE_NAME = "dc3-driver";
|
||||
|
||||
/** URL prefix for the driver command endpoints. */
|
||||
/**
|
||||
* URL prefix for the driver command endpoints.
|
||||
*/
|
||||
public static final String COMMAND_URL_PREFIX = "/command";
|
||||
|
||||
private DriverConstant() {
|
||||
|
||||
@@ -33,79 +33,129 @@ public class ManagerConstant {
|
||||
*/
|
||||
public static final String SERVICE_NAME = "dc3-center-manager";
|
||||
|
||||
/** URL prefix for the driver controller. */
|
||||
/**
|
||||
* URL prefix for the driver controller.
|
||||
*/
|
||||
public static final String DRIVER_URL_PREFIX = "/driver";
|
||||
|
||||
/** URL prefix for batch operations. */
|
||||
/**
|
||||
* URL prefix for batch operations.
|
||||
*/
|
||||
public static final String BATCH_URL_PREFIX = "/batch";
|
||||
|
||||
/** URL prefix for the driver-attribute controller. */
|
||||
/**
|
||||
* URL prefix for the driver-attribute controller.
|
||||
*/
|
||||
public static final String DRIVER_ATTRIBUTE_URL_PREFIX = "/driver_attribute";
|
||||
|
||||
/** URL prefix for the point-attribute controller. */
|
||||
/**
|
||||
* URL prefix for the point-attribute controller.
|
||||
*/
|
||||
public static final String POINT_ATTRIBUTE_URL_PREFIX = "/point_attribute";
|
||||
|
||||
/** URL prefix for the command-attribute controller. */
|
||||
/**
|
||||
* URL prefix for the command-attribute controller.
|
||||
*/
|
||||
public static final String COMMAND_ATTRIBUTE_URL_PREFIX = "/command_attribute";
|
||||
|
||||
/** URL prefix for the event-attribute controller. */
|
||||
/**
|
||||
* URL prefix for the event-attribute controller.
|
||||
*/
|
||||
public static final String EVENT_ATTRIBUTE_URL_PREFIX = "/event_attribute";
|
||||
|
||||
/** URL prefix for the profile controller. */
|
||||
/**
|
||||
* URL prefix for the profile controller.
|
||||
*/
|
||||
public static final String PROFILE_URL_PREFIX = "/profile";
|
||||
|
||||
/** URL prefix for the point controller. */
|
||||
/**
|
||||
* URL prefix for the point controller.
|
||||
*/
|
||||
public static final String POINT_URL_PREFIX = "/point";
|
||||
|
||||
/** URL prefix for the group controller. */
|
||||
/**
|
||||
* URL prefix for the group controller.
|
||||
*/
|
||||
public static final String GROUP_URL_PREFIX = "/group";
|
||||
|
||||
/** URL prefix for the group-bind controller. */
|
||||
/**
|
||||
* URL prefix for the group-bind controller.
|
||||
*/
|
||||
public static final String GROUP_BIND_URL_PREFIX = "/group_bind";
|
||||
|
||||
/** URL prefix for the device controller. */
|
||||
/**
|
||||
* URL prefix for the device controller.
|
||||
*/
|
||||
public static final String DEVICE_URL_PREFIX = "/device";
|
||||
|
||||
/** URL prefix for the dashboard controller. */
|
||||
/**
|
||||
* URL prefix for the dashboard controller.
|
||||
*/
|
||||
public static final String DASHBOARD_URL_PREFIX = "/dashboard";
|
||||
|
||||
/** URL prefix for auto-completion endpoints. */
|
||||
/**
|
||||
* URL prefix for auto-completion endpoints.
|
||||
*/
|
||||
public static final String AUTO_URL_PREFIX = "/auto";
|
||||
|
||||
/** URL prefix for the point-attribute config controller. */
|
||||
/**
|
||||
* URL prefix for the point-attribute config controller.
|
||||
*/
|
||||
public static final String POINT_ATTRIBUTE_CONFIG_URL_PREFIX = "/point_attribute_config";
|
||||
|
||||
/** URL prefix for the driver-attribute config controller. */
|
||||
/**
|
||||
* URL prefix for the driver-attribute config controller.
|
||||
*/
|
||||
public static final String DRIVER_ATTRIBUTE_CONFIG_URL_PREFIX = "/driver_attribute_config";
|
||||
|
||||
/** URL prefix for the command-attribute config controller. */
|
||||
/**
|
||||
* URL prefix for the command-attribute config controller.
|
||||
*/
|
||||
public static final String COMMAND_ATTRIBUTE_CONFIG_URL_PREFIX = "/command_attribute_config";
|
||||
|
||||
/** URL prefix for the event-attribute config controller. */
|
||||
/**
|
||||
* URL prefix for the event-attribute config controller.
|
||||
*/
|
||||
public static final String EVENT_ATTRIBUTE_CONFIG_URL_PREFIX = "/event_attribute_config";
|
||||
|
||||
/** URL prefix for the label controller. */
|
||||
/**
|
||||
* URL prefix for the label controller.
|
||||
*/
|
||||
public static final String LABEL_URL_PREFIX = "/label";
|
||||
|
||||
/** URL prefix for the label-bind controller. */
|
||||
/**
|
||||
* URL prefix for the label-bind controller.
|
||||
*/
|
||||
public static final String LABEL_BIND_URL_PREFIX = "/label_bind";
|
||||
|
||||
/** URL prefix for the dictionary controller. */
|
||||
/**
|
||||
* URL prefix for the dictionary controller.
|
||||
*/
|
||||
public static final String DICTIONARY_URL_PREFIX = "/dictionary";
|
||||
|
||||
/** URL prefix for the topic controller. */
|
||||
/**
|
||||
* URL prefix for the topic controller.
|
||||
*/
|
||||
public static final String TOPIC_URL_PREFIX = "/topic";
|
||||
|
||||
/** URL prefix for the command controller. */
|
||||
/**
|
||||
* URL prefix for the command controller.
|
||||
*/
|
||||
public static final String COMMAND_URL_PREFIX = "/command";
|
||||
|
||||
/** URL prefix for the command-param controller. */
|
||||
/**
|
||||
* URL prefix for the command-param controller.
|
||||
*/
|
||||
public static final String COMMAND_PARAM_URL_PREFIX = "/command_param";
|
||||
|
||||
/** URL prefix for the event controller. */
|
||||
/**
|
||||
* URL prefix for the event controller.
|
||||
*/
|
||||
public static final String EVENT_URL_PREFIX = "/event";
|
||||
|
||||
/** URL prefix for the event-param controller. */
|
||||
/**
|
||||
* URL prefix for the event-param controller.
|
||||
*/
|
||||
public static final String EVENT_PARAM_URL_PREFIX = "/event_param";
|
||||
|
||||
private ManagerConstant() {
|
||||
|
||||
@@ -31,31 +31,49 @@ import java.util.Map;
|
||||
*/
|
||||
public class McpConstant {
|
||||
|
||||
/** Base URL prefix of the MCP endpoint. */
|
||||
/**
|
||||
* Base URL prefix of the MCP endpoint.
|
||||
*/
|
||||
public static final String URL_PREFIX = "/mcp";
|
||||
|
||||
/** Well-known URI advertising the OAuth authorization server metadata. */
|
||||
/**
|
||||
* Well-known URI advertising the OAuth authorization server metadata.
|
||||
*/
|
||||
public static final String WELL_KNOWN_AUTHORIZATION_SERVER = "/.well-known/oauth-authorization-server";
|
||||
|
||||
/** Well-known URI advertising the OAuth protected-resource metadata. */
|
||||
/**
|
||||
* Well-known URI advertising the OAuth protected-resource metadata.
|
||||
*/
|
||||
public static final String WELL_KNOWN_PROTECTED_RESOURCE = "/.well-known/oauth-protected-resource";
|
||||
|
||||
/** Base URL prefix of the OAuth2 endpoints. */
|
||||
/**
|
||||
* Base URL prefix of the OAuth2 endpoints.
|
||||
*/
|
||||
public static final String OAUTH2_URL_PREFIX = "/oauth2";
|
||||
|
||||
/** OAuth2 authorization endpoint path. */
|
||||
/**
|
||||
* OAuth2 authorization endpoint path.
|
||||
*/
|
||||
public static final String OAUTH2_AUTHORIZE = OAUTH2_URL_PREFIX + "/authorize";
|
||||
|
||||
/** OAuth2 JWKS endpoint path. */
|
||||
/**
|
||||
* OAuth2 JWKS endpoint path.
|
||||
*/
|
||||
public static final String OAUTH2_JWKS = OAUTH2_URL_PREFIX + "/jwks";
|
||||
|
||||
/** OAuth2 dynamic client registration endpoint path. */
|
||||
/**
|
||||
* OAuth2 dynamic client registration endpoint path.
|
||||
*/
|
||||
public static final String OAUTH2_REGISTER = OAUTH2_URL_PREFIX + "/register";
|
||||
|
||||
/** OAuth2 token revocation endpoint path. */
|
||||
/**
|
||||
* OAuth2 token revocation endpoint path.
|
||||
*/
|
||||
public static final String OAUTH2_REVOKE = OAUTH2_URL_PREFIX + "/revoke";
|
||||
|
||||
/** OAuth2 token endpoint path. */
|
||||
/**
|
||||
* OAuth2 token endpoint path.
|
||||
*/
|
||||
public static final String OAUTH2_TOKEN = OAUTH2_URL_PREFIX + "/token";
|
||||
|
||||
private McpConstant() {
|
||||
@@ -67,40 +85,64 @@ public class McpConstant {
|
||||
*/
|
||||
public static class OAuth {
|
||||
|
||||
/** Client authentication method: client_secret_basic. */
|
||||
/**
|
||||
* Client authentication method: client_secret_basic.
|
||||
*/
|
||||
public static final String AUTH_METHOD_CLIENT_SECRET_BASIC = "client_secret_basic";
|
||||
|
||||
/** Client authentication method: client_secret_post. */
|
||||
/**
|
||||
* Client authentication method: client_secret_post.
|
||||
*/
|
||||
public static final String AUTH_METHOD_CLIENT_SECRET_POST = "client_secret_post";
|
||||
|
||||
/** Client authentication method: none (public clients). */
|
||||
/**
|
||||
* Client authentication method: none (public clients).
|
||||
*/
|
||||
public static final String AUTH_METHOD_NONE = "none";
|
||||
|
||||
/** Prefix applied to generated client ids. */
|
||||
/**
|
||||
* Prefix applied to generated client ids.
|
||||
*/
|
||||
public static final String CLIENT_ID_PREFIX = "dc3_";
|
||||
|
||||
/** Confidential client type. */
|
||||
/**
|
||||
* Confidential client type.
|
||||
*/
|
||||
public static final String CLIENT_TYPE_CONFIDENTIAL = "CONFIDENTIAL";
|
||||
|
||||
/** Public client type. */
|
||||
/**
|
||||
* Public client type.
|
||||
*/
|
||||
public static final String CLIENT_TYPE_PUBLIC = "PUBLIC";
|
||||
|
||||
/** PKCE code challenge method: S256. */
|
||||
/**
|
||||
* PKCE code challenge method: S256.
|
||||
*/
|
||||
public static final String CODE_CHALLENGE_METHOD_S256 = "S256";
|
||||
|
||||
/** Authorization-code grant type. */
|
||||
/**
|
||||
* Authorization-code grant type.
|
||||
*/
|
||||
public static final String GRANT_AUTHORIZATION_CODE = "authorization_code";
|
||||
|
||||
/** Client-credentials grant type. */
|
||||
/**
|
||||
* Client-credentials grant type.
|
||||
*/
|
||||
public static final String GRANT_CLIENT_CREDENTIALS = "client_credentials";
|
||||
|
||||
/** Refresh-token grant type. */
|
||||
/**
|
||||
* Refresh-token grant type.
|
||||
*/
|
||||
public static final String GRANT_REFRESH_TOKEN = "refresh_token";
|
||||
|
||||
/** OAuth response type: code. */
|
||||
/**
|
||||
* OAuth response type: code.
|
||||
*/
|
||||
public static final String RESPONSE_TYPE_CODE = "code";
|
||||
|
||||
/** Bearer token type. */
|
||||
/**
|
||||
* Bearer token type.
|
||||
*/
|
||||
public static final String TOKEN_TYPE_BEARER = "Bearer";
|
||||
|
||||
private OAuth() {
|
||||
@@ -114,22 +156,34 @@ public class McpConstant {
|
||||
*/
|
||||
public static class Scope {
|
||||
|
||||
/** Regex splitting whitespace/comma-separated scope lists. */
|
||||
/**
|
||||
* Regex splitting whitespace/comma-separated scope lists.
|
||||
*/
|
||||
public static final String DELIMITER_REGEX = "[\\s,]+";
|
||||
|
||||
/** MCP scope granting resource reads. */
|
||||
/**
|
||||
* MCP scope granting resource reads.
|
||||
*/
|
||||
public static final String RESOURCES_READ = "mcp:resources:read";
|
||||
|
||||
/** MCP scope granting standard tool calls. */
|
||||
/**
|
||||
* MCP scope granting standard tool calls.
|
||||
*/
|
||||
public static final String TOOLS_CALL = "mcp:tools:call";
|
||||
|
||||
/** MCP scope granting high-risk tool calls. */
|
||||
/**
|
||||
* MCP scope granting high-risk tool calls.
|
||||
*/
|
||||
public static final String TOOLS_CALL_HIGH = "mcp:tools:call:high";
|
||||
|
||||
/** MCP scope granting tool listing. */
|
||||
/**
|
||||
* MCP scope granting tool listing.
|
||||
*/
|
||||
public static final String TOOLS_LIST = "mcp:tools:list";
|
||||
|
||||
/** Scopes the platform grants and recognizes. */
|
||||
/**
|
||||
* Scopes the platform grants and recognizes.
|
||||
*/
|
||||
public static final List<String> SUPPORTED = List.of(TOOLS_LIST, TOOLS_CALL, TOOLS_CALL_HIGH, RESOURCES_READ);
|
||||
|
||||
private Scope() {
|
||||
@@ -143,49 +197,79 @@ public class McpConstant {
|
||||
*/
|
||||
public static class JsonRpc {
|
||||
|
||||
/** JSON-RPC error field. */
|
||||
/**
|
||||
* JSON-RPC error field.
|
||||
*/
|
||||
public static final String FIELD_ERROR = "error";
|
||||
|
||||
/** JSON-RPC request/response id field. */
|
||||
/**
|
||||
* JSON-RPC request/response id field.
|
||||
*/
|
||||
public static final String FIELD_ID = "id";
|
||||
|
||||
/** JSON-RPC protocol version field. */
|
||||
/**
|
||||
* JSON-RPC protocol version field.
|
||||
*/
|
||||
public static final String FIELD_JSONRPC = "jsonrpc";
|
||||
|
||||
/** JSON-RPC method field. */
|
||||
/**
|
||||
* JSON-RPC method field.
|
||||
*/
|
||||
public static final String FIELD_METHOD = "method";
|
||||
|
||||
/** JSON-RPC result field. */
|
||||
/**
|
||||
* JSON-RPC result field.
|
||||
*/
|
||||
public static final String FIELD_RESULT = "result";
|
||||
|
||||
/** JSON-RPC error code field. */
|
||||
/**
|
||||
* JSON-RPC error code field.
|
||||
*/
|
||||
public static final String ERROR_FIELD_CODE = "code";
|
||||
|
||||
/** JSON-RPC error message field. */
|
||||
/**
|
||||
* JSON-RPC error message field.
|
||||
*/
|
||||
public static final String ERROR_FIELD_MESSAGE = "message";
|
||||
|
||||
/** JSON-RPC initialize method. */
|
||||
/**
|
||||
* JSON-RPC initialize method.
|
||||
*/
|
||||
public static final String METHOD_INITIALIZE = "initialize";
|
||||
|
||||
/** JSON-RPC notifications/initialized method. */
|
||||
/**
|
||||
* JSON-RPC notifications/initialized method.
|
||||
*/
|
||||
public static final String METHOD_NOTIFICATIONS_INITIALIZED = "notifications/initialized";
|
||||
|
||||
/** JSON-RPC ping method. */
|
||||
/**
|
||||
* JSON-RPC ping method.
|
||||
*/
|
||||
public static final String METHOD_PING = "ping";
|
||||
|
||||
/** JSON-RPC tools/call method. */
|
||||
/**
|
||||
* JSON-RPC tools/call method.
|
||||
*/
|
||||
public static final String METHOD_TOOLS_CALL = "tools/call";
|
||||
|
||||
/** JSON-RPC tools/list method. */
|
||||
/**
|
||||
* JSON-RPC tools/list method.
|
||||
*/
|
||||
public static final String METHOD_TOOLS_LIST = "tools/list";
|
||||
|
||||
/** Supported MCP protocol version. */
|
||||
/**
|
||||
* Supported MCP protocol version.
|
||||
*/
|
||||
public static final String VERSION = "2.0";
|
||||
|
||||
/** JSON-RPC internal-error code. */
|
||||
/**
|
||||
* JSON-RPC internal-error code.
|
||||
*/
|
||||
public static final int ERROR_INTERNAL = -32000;
|
||||
|
||||
/** JSON-RPC method-not-found code. */
|
||||
/**
|
||||
* JSON-RPC method-not-found code.
|
||||
*/
|
||||
public static final int ERROR_METHOD_NOT_FOUND = -32601;
|
||||
|
||||
private JsonRpc() {
|
||||
@@ -199,205 +283,339 @@ public class McpConstant {
|
||||
*/
|
||||
public static class Field {
|
||||
|
||||
/** Connection state value for active connections. */
|
||||
/**
|
||||
* Connection state value for active connections.
|
||||
*/
|
||||
public static final String ACTIVE = "active";
|
||||
|
||||
/** OAuth token field: access token. */
|
||||
/**
|
||||
* OAuth token field: access token.
|
||||
*/
|
||||
public static final String ACCESS_TOKEN = "access_token";
|
||||
|
||||
/** OAuth/MCP wire name for the ARGUMENT_DIGEST field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the ARGUMENT_DIGEST field.
|
||||
*/
|
||||
public static final String ARGUMENT_DIGEST = "argumentDigest";
|
||||
|
||||
/** OAuth/MCP wire name for the ARGUMENTS field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the ARGUMENTS field.
|
||||
*/
|
||||
public static final String ARGUMENTS = "arguments";
|
||||
|
||||
/** JWT claim: audience. */
|
||||
/**
|
||||
* JWT claim: audience.
|
||||
*/
|
||||
public static final String AUD = "aud";
|
||||
|
||||
/** OAuth request field: client id. */
|
||||
/**
|
||||
* OAuth request field: client id.
|
||||
*/
|
||||
public static final String CLIENT_ID = "client_id";
|
||||
|
||||
/** OAuth/MCP wire name for the CLIENT_ID_CAMEL field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CLIENT_ID_CAMEL field.
|
||||
*/
|
||||
public static final String CLIENT_ID_CAMEL = "clientId";
|
||||
|
||||
/** OAuth/MCP wire name for the CLIENT_NAME_META field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CLIENT_NAME_META field.
|
||||
*/
|
||||
public static final String CLIENT_NAME_META = "client_name";
|
||||
|
||||
/** OAuth registration metadata field: client name. */
|
||||
/**
|
||||
* OAuth registration metadata field: client name.
|
||||
*/
|
||||
public static final String CLIENT_NAME = "clientName";
|
||||
|
||||
/** OAuth request field: client secret. */
|
||||
/**
|
||||
* OAuth request field: client secret.
|
||||
*/
|
||||
public static final String CLIENT_SECRET = "client_secret";
|
||||
|
||||
/** OAuth/MCP wire name for the CLIENT_TYPE field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CLIENT_TYPE field.
|
||||
*/
|
||||
public static final String CLIENT_TYPE = "client_type";
|
||||
|
||||
/** OAuth/MCP wire name for the CLIENT_VERSION field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CLIENT_VERSION field.
|
||||
*/
|
||||
public static final String CLIENT_VERSION = "clientVersion";
|
||||
|
||||
/** PKCE request field: code challenge. */
|
||||
/**
|
||||
* PKCE request field: code challenge.
|
||||
*/
|
||||
public static final String CODE_CHALLENGE = "code_challenge";
|
||||
|
||||
/** PKCE request field: code challenge method. */
|
||||
/**
|
||||
* PKCE request field: code challenge method.
|
||||
*/
|
||||
public static final String CODE_CHALLENGE_METHOD = "code_challenge_method";
|
||||
|
||||
/** OAuth/MCP wire name for the CONFIRM_ID field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CONFIRM_ID field.
|
||||
*/
|
||||
public static final String CONFIRM_ID = "confirmId";
|
||||
|
||||
/** OAuth/MCP wire name for the CONFIRM_ID_META field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CONFIRM_ID_META field.
|
||||
*/
|
||||
public static final String CONFIRM_ID_META = "confirm_id";
|
||||
|
||||
/** OAuth/MCP wire name for the CONNECTION_ID field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CONNECTION_ID field.
|
||||
*/
|
||||
public static final String CONNECTION_ID = "connectionId";
|
||||
|
||||
/** OAuth/MCP wire name for the CONNECTION_ID_REQUEST field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CONNECTION_ID_REQUEST field.
|
||||
*/
|
||||
public static final String CONNECTION_ID_REQUEST = "connection_id";
|
||||
|
||||
/** OAuth/MCP wire name for the DISPLAY_NAME field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the DISPLAY_NAME field.
|
||||
*/
|
||||
public static final String DISPLAY_NAME = "display_name";
|
||||
|
||||
/** OAuth/MCP wire name for the DURATION_MS field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the DURATION_MS field.
|
||||
*/
|
||||
public static final String DURATION_MS = "durationMs";
|
||||
|
||||
/** OAuth/MCP wire name for the ERROR field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the ERROR field.
|
||||
*/
|
||||
public static final String ERROR = "error";
|
||||
|
||||
/** OAuth/MCP wire name for the ERROR_CODE field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the ERROR_CODE field.
|
||||
*/
|
||||
public static final String ERROR_CODE = "errorCode";
|
||||
|
||||
/** OAuth/MCP wire name for the ERROR_DESCRIPTION field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the ERROR_DESCRIPTION field.
|
||||
*/
|
||||
public static final String ERROR_DESCRIPTION = "error_description";
|
||||
|
||||
/** JWT claim: expiry time. */
|
||||
/**
|
||||
* JWT claim: expiry time.
|
||||
*/
|
||||
public static final String EXP = "exp";
|
||||
|
||||
/** OAuth token response field: lifetime in seconds. */
|
||||
/**
|
||||
* OAuth token response field: lifetime in seconds.
|
||||
*/
|
||||
public static final String EXPIRES_IN = "expires_in";
|
||||
|
||||
/** OAuth token request field: grant type. */
|
||||
/**
|
||||
* OAuth token request field: grant type.
|
||||
*/
|
||||
public static final String GRANT_TYPE = "grant_type";
|
||||
|
||||
/** OAuth registration metadata field: allowed grants. */
|
||||
/**
|
||||
* OAuth registration metadata field: allowed grants.
|
||||
*/
|
||||
public static final String GRANT_TYPES = "grant_types";
|
||||
|
||||
/** JWT claim: issued-at time. */
|
||||
/**
|
||||
* JWT claim: issued-at time.
|
||||
*/
|
||||
public static final String IAT = "iat";
|
||||
|
||||
/** OAuth/MCP wire name for the IDEMPOTENCY_KEY field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the IDEMPOTENCY_KEY field.
|
||||
*/
|
||||
public static final String IDEMPOTENCY_KEY = "idempotencyKey";
|
||||
|
||||
/** OAuth/MCP wire name for the IDEMPOTENCY_KEY_META field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the IDEMPOTENCY_KEY_META field.
|
||||
*/
|
||||
public static final String IDEMPOTENCY_KEY_META = "idempotency_key";
|
||||
|
||||
/** JWT claim: issuer. */
|
||||
/**
|
||||
* JWT claim: issuer.
|
||||
*/
|
||||
public static final String ISS = "iss";
|
||||
|
||||
/** JWT claim: token identifier. */
|
||||
/**
|
||||
* JWT claim: token identifier.
|
||||
*/
|
||||
public static final String JTI = "jti";
|
||||
|
||||
/** OAuth/MCP wire name for the KEYWORD field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the KEYWORD field.
|
||||
*/
|
||||
public static final String KEYWORD = "keyword";
|
||||
|
||||
/** OAuth/MCP wire name for the LIMIT field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the LIMIT field.
|
||||
*/
|
||||
public static final String LIMIT = "limit";
|
||||
|
||||
/** OAuth/MCP wire name for the MCP_CONNECTION_ID field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the MCP_CONNECTION_ID field.
|
||||
*/
|
||||
public static final String MCP_CONNECTION_ID = "mcp_connection_id";
|
||||
|
||||
/** OAuth/MCP wire name for the META field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the META field.
|
||||
*/
|
||||
public static final String META = "_meta";
|
||||
|
||||
/** OAuth/MCP wire name for the NAME field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the NAME field.
|
||||
*/
|
||||
public static final String NAME = "name";
|
||||
|
||||
/** OAuth/MCP wire name for the PARAMS field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the PARAMS field.
|
||||
*/
|
||||
public static final String PARAMS = "params";
|
||||
|
||||
/** OAuth/MCP wire name for the PERMISSION_CODE field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the PERMISSION_CODE field.
|
||||
*/
|
||||
public static final String PERMISSION_CODE = "permissionCode";
|
||||
|
||||
/** OAuth/MCP wire name for the PERMISSION_CODE_META field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the PERMISSION_CODE_META field.
|
||||
*/
|
||||
public static final String PERMISSION_CODE_META = "permission_code";
|
||||
|
||||
/** OAuth/MCP wire name for the PRINCIPAL_ID field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the PRINCIPAL_ID field.
|
||||
*/
|
||||
public static final String PRINCIPAL_ID = "principal_id";
|
||||
|
||||
/** OAuth/MCP wire name for the PRINCIPAL_ID_CAMEL field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the PRINCIPAL_ID_CAMEL field.
|
||||
*/
|
||||
public static final String PRINCIPAL_ID_CAMEL = "principalId";
|
||||
|
||||
/** OAuth/MCP wire name for the PRINCIPAL_NAME field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the PRINCIPAL_NAME field.
|
||||
*/
|
||||
public static final String PRINCIPAL_NAME = "principal_name";
|
||||
|
||||
/** OAuth/MCP wire name for the PRINCIPAL_TYPE field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the PRINCIPAL_TYPE field.
|
||||
*/
|
||||
public static final String PRINCIPAL_TYPE = "principal_type";
|
||||
|
||||
/** OAuth/MCP wire name for the PRINCIPAL_TYPE_CAMEL field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the PRINCIPAL_TYPE_CAMEL field.
|
||||
*/
|
||||
public static final String PRINCIPAL_TYPE_CAMEL = "principalType";
|
||||
|
||||
/** OAuth request field: redirect uri. */
|
||||
/**
|
||||
* OAuth request field: redirect uri.
|
||||
*/
|
||||
public static final String REDIRECT_URI = "redirect_uri";
|
||||
|
||||
/** OAuth registration metadata field: redirect uris. */
|
||||
/**
|
||||
* OAuth registration metadata field: redirect uris.
|
||||
*/
|
||||
public static final String REDIRECT_URIS = "redirect_uris";
|
||||
|
||||
/** OAuth token response field: refresh token. */
|
||||
/**
|
||||
* OAuth token response field: refresh token.
|
||||
*/
|
||||
public static final String REFRESH_TOKEN = "refresh_token";
|
||||
|
||||
/** OAuth/MCP wire name for the REMOTE_IP field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the REMOTE_IP field.
|
||||
*/
|
||||
public static final String REMOTE_IP = "remoteIp";
|
||||
|
||||
/** OAuth/MCP wire name for the RISK_LEVEL field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the RISK_LEVEL field.
|
||||
*/
|
||||
public static final String RISK_LEVEL = "riskLevel";
|
||||
|
||||
/** OAuth/MCP wire name for the RISK_LEVEL_META field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the RISK_LEVEL_META field.
|
||||
*/
|
||||
public static final String RISK_LEVEL_META = "risk_level";
|
||||
|
||||
/** OAuth request/response field: scopes. */
|
||||
/**
|
||||
* OAuth request/response field: scopes.
|
||||
*/
|
||||
public static final String SCOPE = "scope";
|
||||
|
||||
/** OAuth/MCP wire name for the SERVICE_ACCOUNT_PRINCIPAL_ID field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the SERVICE_ACCOUNT_PRINCIPAL_ID field.
|
||||
*/
|
||||
public static final String SERVICE_ACCOUNT_PRINCIPAL_ID = "service_account_principal_id";
|
||||
|
||||
/** OAuth/MCP wire name for the STATUS field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the STATUS field.
|
||||
*/
|
||||
public static final String STATUS = "status";
|
||||
|
||||
/** JWT claim: subject. */
|
||||
/**
|
||||
* JWT claim: subject.
|
||||
*/
|
||||
public static final String SUB = "sub";
|
||||
|
||||
/** OAuth/MCP wire name for the TENANT_ID field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TENANT_ID field.
|
||||
*/
|
||||
public static final String TENANT_ID = "tenant_id";
|
||||
|
||||
/** OAuth/MCP wire name for the TENANT_ID_CAMEL field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TENANT_ID_CAMEL field.
|
||||
*/
|
||||
public static final String TENANT_ID_CAMEL = "tenantId";
|
||||
|
||||
/** OAuth/MCP wire name for the TOKEN field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TOKEN field.
|
||||
*/
|
||||
public static final String TOKEN = "token";
|
||||
|
||||
/** OAuth/MCP wire name for the TOKEN_ENDPOINT_AUTH_METHOD field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TOKEN_ENDPOINT_AUTH_METHOD field.
|
||||
*/
|
||||
public static final String TOKEN_ENDPOINT_AUTH_METHOD = "token_endpoint_auth_method";
|
||||
|
||||
/** OAuth token response field: token type. */
|
||||
/**
|
||||
* OAuth token response field: token type.
|
||||
*/
|
||||
public static final String TOKEN_TYPE = "token_type";
|
||||
|
||||
/** OAuth/MCP wire name for the TOOL_ID field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TOOL_ID field.
|
||||
*/
|
||||
public static final String TOOL_ID = "toolId";
|
||||
|
||||
/** OAuth/MCP wire name for the TOOL_ID_META field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TOOL_ID_META field.
|
||||
*/
|
||||
public static final String TOOL_ID_META = "tool_id";
|
||||
|
||||
/** OAuth/MCP wire name for the TOOL_IDS field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TOOL_IDS field.
|
||||
*/
|
||||
public static final String TOOL_IDS = "tool_ids";
|
||||
|
||||
/** OAuth/MCP wire name for the TOOL_NAME field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TOOL_NAME field.
|
||||
*/
|
||||
public static final String TOOL_NAME = "toolName";
|
||||
|
||||
/** OAuth/MCP wire name for the TOOL_NAME_REQUEST field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TOOL_NAME_REQUEST field.
|
||||
*/
|
||||
public static final String TOOL_NAME_REQUEST = "tool_name";
|
||||
|
||||
/** OAuth/MCP wire name for the TOOLS field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TOOLS field.
|
||||
*/
|
||||
public static final String TOOLS = "tools";
|
||||
|
||||
/** OAuth/MCP wire name for the TRACE_ID field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TRACE_ID field.
|
||||
*/
|
||||
public static final String TRACE_ID = "traceId";
|
||||
|
||||
private Field() {
|
||||
@@ -412,40 +630,64 @@ public class McpConstant {
|
||||
*/
|
||||
public static class ToolDefinition {
|
||||
|
||||
/** OAuth/MCP wire name for the ADDITIONAL_PROPERTIES field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the ADDITIONAL_PROPERTIES field.
|
||||
*/
|
||||
public static final String ADDITIONAL_PROPERTIES = "additionalProperties";
|
||||
|
||||
/** OAuth/MCP wire name for the ANNOTATIONS field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the ANNOTATIONS field.
|
||||
*/
|
||||
public static final String ANNOTATIONS = "annotations";
|
||||
|
||||
/** OAuth/MCP wire name for the DESTRUCTIVE_HINT field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the DESTRUCTIVE_HINT field.
|
||||
*/
|
||||
public static final String DESTRUCTIVE_HINT = "destructiveHint";
|
||||
|
||||
/** OAuth/MCP wire name for the DESCRIPTION field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the DESCRIPTION field.
|
||||
*/
|
||||
public static final String DESCRIPTION = "description";
|
||||
|
||||
/** OAuth/MCP wire name for the IDEMPOTENT_HINT field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the IDEMPOTENT_HINT field.
|
||||
*/
|
||||
public static final String IDEMPOTENT_HINT = "idempotentHint";
|
||||
|
||||
/** OAuth/MCP wire name for the INPUT_SCHEMA field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the INPUT_SCHEMA field.
|
||||
*/
|
||||
public static final String INPUT_SCHEMA = "inputSchema";
|
||||
|
||||
/** OAuth/MCP wire name for the OPEN_WORLD_HINT field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the OPEN_WORLD_HINT field.
|
||||
*/
|
||||
public static final String OPEN_WORLD_HINT = "openWorldHint";
|
||||
|
||||
/** OAuth/MCP wire name for the READ_ONLY_HINT field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the READ_ONLY_HINT field.
|
||||
*/
|
||||
public static final String READ_ONLY_HINT = "readOnlyHint";
|
||||
|
||||
/** OAuth/MCP wire name for the TITLE field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TITLE field.
|
||||
*/
|
||||
public static final String TITLE = "title";
|
||||
|
||||
/** OAuth/MCP wire name for the TYPE field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TYPE field.
|
||||
*/
|
||||
public static final String TYPE = "type";
|
||||
|
||||
/** OAuth/MCP wire name for the TYPE_OBJECT field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TYPE_OBJECT field.
|
||||
*/
|
||||
public static final String TYPE_OBJECT = "object";
|
||||
|
||||
/** default input schema constant. */
|
||||
/**
|
||||
* default input schema constant.
|
||||
*/
|
||||
public static final Map<String, Object> DEFAULT_INPUT_SCHEMA = Map.of(
|
||||
TYPE, TYPE_OBJECT,
|
||||
ADDITIONAL_PROPERTIES, true
|
||||
@@ -462,19 +704,29 @@ public class McpConstant {
|
||||
*/
|
||||
public static class ToolResult {
|
||||
|
||||
/** OAuth/MCP wire name for the CONTENT field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CONTENT field.
|
||||
*/
|
||||
public static final String CONTENT = "content";
|
||||
|
||||
/** OAuth/MCP wire name for the IS_ERROR field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the IS_ERROR field.
|
||||
*/
|
||||
public static final String IS_ERROR = "isError";
|
||||
|
||||
/** OAuth/MCP wire name for the TEXT field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TEXT field.
|
||||
*/
|
||||
public static final String TEXT = "text";
|
||||
|
||||
/** OAuth/MCP wire name for the TYPE field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TYPE field.
|
||||
*/
|
||||
public static final String TYPE = "type";
|
||||
|
||||
/** OAuth/MCP wire name for the TYPE_TEXT field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the TYPE_TEXT field.
|
||||
*/
|
||||
public static final String TYPE_TEXT = "text";
|
||||
|
||||
private ToolResult() {
|
||||
@@ -488,22 +740,34 @@ public class McpConstant {
|
||||
*/
|
||||
public static class Server {
|
||||
|
||||
/** OAuth/MCP wire name for the BEARER_METHOD_HEADER field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the BEARER_METHOD_HEADER field.
|
||||
*/
|
||||
public static final String BEARER_METHOD_HEADER = "header";
|
||||
|
||||
/** OAuth/MCP wire name for the CAPABILITY_LIST_CHANGED field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CAPABILITY_LIST_CHANGED field.
|
||||
*/
|
||||
public static final String CAPABILITY_LIST_CHANGED = "listChanged";
|
||||
|
||||
/** OAuth/MCP wire name for the CAPABILITY_TOOLS field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the CAPABILITY_TOOLS field.
|
||||
*/
|
||||
public static final String CAPABILITY_TOOLS = "tools";
|
||||
|
||||
/** OAuth/MCP wire name for the NAME field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the NAME field.
|
||||
*/
|
||||
public static final String NAME = "iot-dc3-gateway";
|
||||
|
||||
/** OAuth/MCP wire name for the PROTOCOL_VERSION field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the PROTOCOL_VERSION field.
|
||||
*/
|
||||
public static final String PROTOCOL_VERSION = "2025-06-18";
|
||||
|
||||
/** Supported MCP protocol version. */
|
||||
/**
|
||||
* Supported MCP protocol version.
|
||||
*/
|
||||
public static final String VERSION = "2026.5.22";
|
||||
|
||||
private Server() {
|
||||
@@ -517,13 +781,19 @@ public class McpConstant {
|
||||
*/
|
||||
public static class RiskLevel {
|
||||
|
||||
/** OAuth/MCP wire name for the HIGH field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the HIGH field.
|
||||
*/
|
||||
public static final String HIGH = "HIGH";
|
||||
|
||||
/** OAuth/MCP wire name for the LOW field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the LOW field.
|
||||
*/
|
||||
public static final String LOW = "LOW";
|
||||
|
||||
/** OAuth/MCP wire name for the MEDIUM field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the MEDIUM field.
|
||||
*/
|
||||
public static final String MEDIUM = "MEDIUM";
|
||||
|
||||
private RiskLevel() {
|
||||
@@ -537,19 +807,29 @@ public class McpConstant {
|
||||
*/
|
||||
public static class Confirmation {
|
||||
|
||||
/** OAuth/MCP wire name for the DECISION_AUTHORIZED field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the DECISION_AUTHORIZED field.
|
||||
*/
|
||||
public static final String DECISION_AUTHORIZED = "AUTHORIZED";
|
||||
|
||||
/** OAuth/MCP wire name for the DECISION_CONFIRM_REQUIRED field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the DECISION_CONFIRM_REQUIRED field.
|
||||
*/
|
||||
public static final String DECISION_CONFIRM_REQUIRED = "CONFIRM_REQUIRED";
|
||||
|
||||
/** OAuth/MCP wire name for the DECISION_REJECTED field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the DECISION_REJECTED field.
|
||||
*/
|
||||
public static final String DECISION_REJECTED = "REJECTED";
|
||||
|
||||
/** OAuth/MCP wire name for the STATUS_PENDING field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the STATUS_PENDING field.
|
||||
*/
|
||||
public static final String STATUS_PENDING = "PENDING";
|
||||
|
||||
/** OAuth/MCP wire name for the STATUS_CONSUMED field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the STATUS_CONSUMED field.
|
||||
*/
|
||||
public static final String STATUS_CONSUMED = "CONSUMED";
|
||||
|
||||
private Confirmation() {
|
||||
@@ -563,19 +843,29 @@ public class McpConstant {
|
||||
*/
|
||||
public static class Audit {
|
||||
|
||||
/** OAuth/MCP wire name for the DENIED field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the DENIED field.
|
||||
*/
|
||||
public static final String DENIED = "DENIED";
|
||||
|
||||
/** OAuth/MCP wire name for the ERROR field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the ERROR field.
|
||||
*/
|
||||
public static final String ERROR = "ERROR";
|
||||
|
||||
/** OAuth/MCP wire name for the POLICY_DENIED field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the POLICY_DENIED field.
|
||||
*/
|
||||
public static final String POLICY_DENIED = "POLICY_DENIED";
|
||||
|
||||
/** OAuth/MCP wire name for the SUCCESS field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the SUCCESS field.
|
||||
*/
|
||||
public static final String SUCCESS = "SUCCESS";
|
||||
|
||||
/** OAuth/MCP wire name for the UNKNOWN field. */
|
||||
/**
|
||||
* OAuth/MCP wire name for the UNKNOWN field.
|
||||
*/
|
||||
public static final String UNKNOWN = "UNKNOWN";
|
||||
|
||||
private Audit() {
|
||||
|
||||
@@ -34,7 +34,9 @@ import java.util.Optional;
|
||||
@AllArgsConstructor
|
||||
public enum CredentialTypeEnum {
|
||||
|
||||
/** Password-based local credential. */
|
||||
/**
|
||||
* Password-based local credential.
|
||||
*/
|
||||
PASSWORD("PASSWORD", "password", "Password credential"),
|
||||
;
|
||||
|
||||
|
||||
@@ -37,13 +37,21 @@ import java.util.Optional;
|
||||
@AllArgsConstructor
|
||||
public enum EntityStatusEnum {
|
||||
|
||||
/** Entity is online and healthy. */
|
||||
/**
|
||||
* Entity is online and healthy.
|
||||
*/
|
||||
ONLINE((byte) 0, "online", "Online"),
|
||||
/** Entity is offline. */
|
||||
/**
|
||||
* Entity is offline.
|
||||
*/
|
||||
OFFLINE((byte) 1, "offline", "Offline"),
|
||||
/** Entity is under maintenance. */
|
||||
/**
|
||||
* Entity is under maintenance.
|
||||
*/
|
||||
MAINTAIN((byte) 2, "maintain", "Maintain"),
|
||||
/** Entity reported a fault. */
|
||||
/**
|
||||
* Entity reported a fault.
|
||||
*/
|
||||
FAULT((byte) 3, "fault", "Fault"),
|
||||
;
|
||||
|
||||
|
||||
@@ -37,25 +37,45 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum ErrorCode implements ResponseCode {
|
||||
|
||||
/** Resource does not exist. */
|
||||
/**
|
||||
* Resource does not exist.
|
||||
*/
|
||||
NOT_FOUND(404, "R404", "Resource does not exist"),
|
||||
/** Missing or invalid authentication. */
|
||||
/**
|
||||
* Missing or invalid authentication.
|
||||
*/
|
||||
UNAUTHORIZED(401, "R401", "Unauthorized"),
|
||||
/** The presented token is invalid or expired. */
|
||||
/**
|
||||
* The presented token is invalid or expired.
|
||||
*/
|
||||
TOKEN_INVALID(401, "R401", "Token is invalid"),
|
||||
/** The caller IP is not allowed. */
|
||||
/**
|
||||
* The caller IP is not allowed.
|
||||
*/
|
||||
IP_INVALID(401, "R401", "Invalid IP"),
|
||||
/** Authenticated principal lacks access. */
|
||||
/**
|
||||
* Authenticated principal lacks access.
|
||||
*/
|
||||
FORBIDDEN(403, "R403", "Access denied"),
|
||||
/** A password change is enforced before continuing. */
|
||||
/**
|
||||
* A password change is enforced before continuing.
|
||||
*/
|
||||
PASSWORD_CHANGE_REQUIRED(403, "R4031", "Password change required"),
|
||||
/** The password has expired. */
|
||||
/**
|
||||
* The password has expired.
|
||||
*/
|
||||
PASSWORD_EXPIRED(403, "R4032", "Password expired"),
|
||||
/** Request validation failed. */
|
||||
/**
|
||||
* Request validation failed.
|
||||
*/
|
||||
VALIDATION(422, "R422", "Validation failed"),
|
||||
/** A numeric value is out of range. */
|
||||
/**
|
||||
* A numeric value is out of range.
|
||||
*/
|
||||
OUT_OF_RANGE(422, "R422", "Number out of range"),
|
||||
/** Generic service failure. */
|
||||
/**
|
||||
* Generic service failure.
|
||||
*/
|
||||
FAILURE(500, "R500", "Service exception"),
|
||||
;
|
||||
|
||||
|
||||
@@ -34,13 +34,19 @@ import java.util.Optional;
|
||||
@AllArgsConstructor
|
||||
public enum MembershipStatusEnum {
|
||||
|
||||
/** Active member. */
|
||||
/**
|
||||
* Active member.
|
||||
*/
|
||||
ACTIVE("ACTIVE", "active", "Active member"),
|
||||
|
||||
/** Suspended member. */
|
||||
/**
|
||||
* Suspended member.
|
||||
*/
|
||||
SUSPENDED("SUSPENDED", "suspended", "Suspended member"),
|
||||
|
||||
/** Invited member. */
|
||||
/**
|
||||
* Invited member.
|
||||
*/
|
||||
INVITED("INVITED", "invited", "Invited member"),
|
||||
;
|
||||
|
||||
|
||||