Skip to content

Assignment 2 - Wan Harith Azdy bin Wan Ismail U2101138#14

Open
Wan2729 wants to merge 1 commit intomainfrom
assignment2_WanHarithAzdy
Open

Assignment 2 - Wan Harith Azdy bin Wan Ismail U2101138#14
Wan2729 wants to merge 1 commit intomainfrom
assignment2_WanHarithAzdy

Conversation

@Wan2729
Copy link
Collaborator

@Wan2729 Wan2729 commented Dec 30, 2025

1. Overview of the change

Addressed Component

org.openhab.core.io.rest.core

Files Modified

File Purpose Changes Made
ItemResource.java Acts as the main REST API endpoint controller for managing Items, including retrieving states, updating metadata, and modifying tags. 1. Added validation to check if a tag exists before adding it.
2. Added a new function to handle adding multiple tags in a single request.

2. Call Graph

image

3. Impact Analysis

Impacted Component

Component Impact Level Description
ItemResource High Modified REST behavior and new endpoint
GenericItem Medium Tag addition invoked more frequently
ManagedItemProvider Medium Update operations now conditional
Logging subsystem Low Additional info/warn logs
REST clients Medium New response semantics

Behavioural Impact

Positive Impacts

  • Improved correctness: Ensures tag addition actually succeeded.
  • Better REST compliance: Uses 304 NOT_MODIFIED appropriately for existing tags.
  • Enhanced observability: Logging aids debugging and monitoring.
  • Scalability: Batch tag API reduces network calls.

Potential Risks

  • Slight performance overhead: Due to extra hasTag() checks.
  • REST client compatibility: Clients expecting unconditional 200 OK may need adaptation.
  • Increased logging: Higher volume under high-frequency updates.

@Wan2729 Wan2729 changed the title [IMPACT ANALYSIS] Improve @PUT function for Item's tag Assignment 2 - Wan Harith Azdy bin Wan Ismail U2101138 Jan 1, 2026
@RareZyn RareZyn requested a review from suhadaudd11 January 2, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants