Getting the session that triggers from TagChangeListener?

How would I get the user that modified properties when a tag configuration change occur?
I tried using session context, but it would not resolve during the TagChangeEvent.

TagPath tagPath = TagPathParser.parseSafe("Some Tag.modifiedProperties");
TagChangeListener tagChangeListener = e -> {
	if (e.getValue().getQuality().isGood()) {
		this.logger.info(String.format("TagPath that triggered: %s", tagPath.toStringFull()));
		/* Code breaks below.......
		User currentUser = (User) gatewayContext.getGatewaySessionManager().getSessionContext().getAttribute(ClientReqSession.SESSION_USER);
		this.logger.info(String.format("User triggered: %s", currentUser.getUserName()));
		*/
	}
};
tagManager.subscribeAsync(tagPath, tagChangeListener);
1 Like