Skip to content

EDG-255 Reclaim Tag Ownership from Adapters, v2 - phase 4 (Edge)#1464

Open
mschoenert-hivemq wants to merge 2 commits intoexploration/EDG-255/reclaim-tag-ownership-from-adapters-v2-phase-3from
exploration/EDG-255/reclaim-tag-ownership-from-adapters-v2-phase-4
Open

EDG-255 Reclaim Tag Ownership from Adapters, v2 - phase 4 (Edge)#1464
mschoenert-hivemq wants to merge 2 commits intoexploration/EDG-255/reclaim-tag-ownership-from-adapters-v2-phase-3from
exploration/EDG-255/reclaim-tag-ownership-from-adapters-v2-phase-4

Conversation

@mschoenert-hivemq
Copy link
Copy Markdown
Contributor

Motivation

A Tag is an Edge concept. It represents a named, described data point as Edge understands it — with a name, a description, and a lifecycle. A TagDefinition is the adapter's concern: it is the adapter-specific addressing information needed to locate that data point on a device (e.g. a Modbus register address, an OPC-UA node ID).

Edge should have complete control over what a tag is and how it behaves. Protocol adapters should only own what is necessary to address a tag on the device — i.e. the TagDefinition. Adapters receive Tag objects and pass them back to Edge, but they must not define or own the Tag implementation.

Approach

The migration is done in phases. Phases 1 and 2 are fully compatible — no existing adapter needs to change. Phase 3 is incompatible and cleans up the SDK once all adapters have migrated. Phase 4 seals the interface to enforce the invariant permanently.

Phase 1 — SDK and Edge changes (compatible, no adapter changes required)

Phase 2 — Migrate adapters one at a time (compatible, per-adapter)

Phase 3 — Clean up the SDK (incompatible)

Phase 4 — Seal the Tag interface (incompatible)

Once it is confirmed that no external adapters implement Tag directly, seal the interface to enforce that Edge is the sole creator of tags

…rnal code

- ProtocolAdapterConfig, InputImpl, Manager, Wrapper use List<GenericTag>
- ProtocolAdapterEntity.fromAdapterTag() takes GenericTag directly
- ProtocolAdapterConfigConverter builds GenericTag with scope (adapterId) at construction
- domainTagToTag() returns GenericTag
- TagSchemaNodeGeneratorTest.TestTag no longer implements sealed Tag interface
- DatabasesPollingProtocolAdapter uses GenericTag throughout
@cla-bot cla-bot bot added the cla-signed label Mar 17, 2026
…to List<GenericTag>

getTags() returns List<GenericTag>; the intermediate List<Tag> variable caused
a type mismatch with Mockito's OngoingStubbing. Tighten the parameter type to
match the callers (which already pass List<GenericTag>) and remove the unused
Tag import.
@github-actions
Copy link
Copy Markdown

Test Results

  490 files  ±0    490 suites  ±0   5m 55s ⏱️ -20s
4 160 tests ±0  4 157 ✅ ±0  3 💤 ±0  0 ❌ ±0 
4 177 runs  ±0  4 174 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit 82ce420. ± Comparison against base commit 74fa4df.

@github-actions
Copy link
Copy Markdown

Coverage Report

Overall Project 65.95% -0.01%
Files changed 50%

File Coverage
ProtocolAdapterConfigConverter.java 69.23% -19.23%
ProtocolAdapterEntity.java 68.72%
ProtocolAdapterWrapper.java 64.43%
ProtocolAdapterConfig.java 40.76%
ProtocolAdapterManager.java 29.85%
ProtocolAdapterInputImpl.java 0%
DatabasesPollingProtocolAdapter.java 0%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant