Expose ActivateSession service result on UaSession#1730
Merged
kevinherron merged 2 commits intomainfrom Apr 19, 2026
Merged
Conversation
Store the most recent successful ActivateSession status on UaSession so clients can inspect advisory Good_* responses like Good_PasswordChangeRequired after activation succeeds. Update the value during both initial activation and reactivation so the session reflects the latest server response.
- Introduce `ActivateSessionServiceResultOverrideTest` to validate custom `ActivateSessionResponse` service results. - Add `ActivateSessionServiceResultTest` to ensure the last service result is recorded correctly post-connect. - Implement `DelegatingSessionServiceSet` to delegate and customize session service handling in tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose the most recent successful
ActivateSessionservice result throughUaSessionso client code can observe advisoryGood_*outcomes such asGood_PasswordChangeRequiredafter a session is established or reactivated.UaSession.getLastActivateSessionServiceResult()and back it withOpcUaSessionso callers can inspect the latest successfulActivateSessionstatus without reaching into lower-level protocol objects.ActivateSessionResponseservice result on both initial activation and reactivation so the session reflects the server's latest accepted response.Good_PasswordChangeRequired, using a delegating test service set to customizeActivateSessionresponses.Key Changes
UaSessionnow exposes an optional lastActivateSessionservice result, which keeps the API backward compatible for session implementations that do not populate it.SessionFsmFactorystores the service result after both initial activation and reactivation so the session reflects the latest successful server response.ActivateSessionresponses can be overridden without replacing the default session service implementation.Testing
ActivateSessionServiceResultTestverifies that a connected client session exposes a present, goodActivateSessionservice result after connect.ActivateSessionServiceResultOverrideTestverifies that advisory good codes returned byActivateSession, includingGood_PasswordChangeRequired, are preserved on the client session.mvn -q clean verifyReferences