Skip to content

Typed session-start and session-end records - #768

Merged
ar merged 1 commit into
mainfrom
feature/typed-session-records
Sep 4, 2026
Merged

ar merged 1 commit into
mainfrom
feature/typed-session-records

Conversation

@ar

@ar ar commented Sep 4, 2026

Copy link
Copy Markdown
Member

Implements #767. First slice of typed payloads for opaque audit records.

What

public record SessionStart(int connections, int permits, String host, int remotePort, int localPort)
public record SessionEnd  (int connections, int permits, String host, int remotePort, int localPort, Duration duration)
  • info (which was Socket.toString()) is gone. Host, remote port and local port are named fields, with the same names as Connect and Disconnect so one viewer template renders all four.
  • SessionEnd.duration is the session length, measured from an Instant captured when the session thread starts.
  • host is null-omitted in JSON for channels that expose no socket; the ports default to 0 in that case.
  • ISOServer populates both records from the accepted socket. No other construction site exists in jPOS or jPOS-EE, so no deprecated constructor is kept.

Tests

  • ISOServerTest.testSessionEventsUseStableRealmAndDynamicTags now asserts host 127.0.0.1, local port equal to the server port and a positive remote port on SessionStart, and matching ports plus a non-negative duration on SessionEnd.
  • KindTest constructor calls updated.
  • Full :jpos:test and :jpos:javadoc pass.

Release note

The session-start and session-end payload shape changes: info disappears; host, remotePort, localPort appear, and session-end gains duration. The Control Plane log viewer renders both records and needs to read the new fields, keeping a fallback on info for already-indexed events.

SessionStart and SessionEnd carried Socket.toString() as an opaque info
string. They now expose host, remotePort and localPort, named as in
Connect and Disconnect so viewers can share one template, and SessionEnd
adds the session duration measured from accept to close.

ISOServer populates both from the accepted socket. No other construction
site exists in jPOS or jPOS-EE.

Closes #767
@ar
ar merged commit 4c2cf17 into main Sep 4, 2026
1 check passed
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.

1 participant