Skip to content

EDG-255 Reclaim Tag Ownership from Adapters, v2 - phase 3 (Edge)#1457

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

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

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)

Once all known adapters have migrated:

  • Remove tagConfigurationClass() from ProtocolAdapterInformation entirely (or keep as deprecated)
  • Remove the old-style dispatch path from ProtocolAdapterFactory.convertTagDefinitionObject
  • Remove setScope() from the Tag interface — scope is set by Edge infrastructure, not by implementations. GenericTag retains its internal setScope as package-private or constructor parameter.
  • Rename tagDefinitionClass() to tagConfigurationClass() for consistency (with updated return type Class<? extends TagDefinition>)

…edge

- ProtocolAdapterConfigConverter constructs GenericTag directly from
  TagEntity and DomainTag fields instead of going through the factory's
  full tag-map path
- ProtocolAdaptersResourceImpl.getTagSchema() calls tagDefinitionClass()
  directly, removing the null-check fallback to tagConfigurationClass()
- Update two test stubs to implement tagDefinitionClass() instead of the
  removed tagConfigurationClass()
- Update HttpProtocolAdapterConfigTest to construct GenericTag directly
  instead of using the removed convertTagDefinitionObjects()
@cla-bot cla-bot bot added the cla-signed label Mar 15, 2026
@mschoenert-hivemq mschoenert-hivemq changed the title EDG-255 Reclaim Tag Ownership from Adapters, v2 - phase 3 (EDge) EDG-255 Reclaim Tag Ownership from Adapters, v2 - phase 3 (Edge) Mar 15, 2026
@github-actions
Copy link
Copy Markdown

Test Results

  490 files  ±0    490 suites  ±0   6m 15s ⏱️ +18s
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 74fa4df. ± Comparison against base commit 03b17f2.

@github-actions
Copy link
Copy Markdown

Coverage Report

Overall Project 65.94% -0.02%
Files changed 40.43%

File Coverage
ProtocolAdapterConfigConverter.java 68.89% -18.52%
ProtocolAdaptersResourceImpl.java 30.22% -0.13%

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