<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	    <channel>
        <title>Prosys Forum - Forum: OPC UA SDK for Java</title>
        <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/</link>
        <description><![CDATA[Prosys OPC &#038; OPC UA related discussion]]></description>
        <generator>Simple:Press Version 6.11.14</generator>
        <atom:link href="https://forum.prosysopc.com/forum/opc-ua-java-sdk/rss/" rel="self" type="application/rss+xml"/>
		                <item>
                    <title>hbrackel on Duplicate methods in generated code from MDIS Companion Standard</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/duplicate-methods-in-generated-code-from-mdis-companion-standard/#p7577</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/duplicate-methods-in-generated-code-from-mdis-companion-standard/#p7577</guid>
					                        <description><![CDATA[<p>The gradle script distinguishes between method calls and setters using the presence of the ServiceException clause. This should leave all method declarations and implementation untouched.</p>
<p>Let me reformulate my "wish" for an ideal code generator:<br />
Assuming a / any valid nodeset.xml as an input, the generated code should be compileable without errors and expose all features of the nodeset design. I am very aware that this presents a real challenge and that this is hardly - if at all- ever accomplishable. So this is not any criticism - just a Christmas wish 🙂</p>
]]></description>
					                    <pubDate>Thu, 28 May 2026 17:48:21 +0300</pubDate>
                </item>
				                <item>
                    <title>Bjarne Boström on Duplicate methods in generated code from MDIS Companion Standard</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/duplicate-methods-in-generated-code-from-mdis-companion-standard/#p7576</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/duplicate-methods-in-generated-code-from-mdis-companion-standard/#p7576</guid>
					                        <description><![CDATA[<p>Codegen-InstanceDeclaration-excluded nodes do still exist in the node-graph at runtime and are accessible via UaNode.getComponent(QualifiedName). Though, excluded Methods cannot be implemented in the generated XXXTypeNode (and the XXXTypeNodeBase will not have the routing logic to it either). I do recognize that in a development flow e.g. checking via autocomplete has every component been set could miss the excluded one as there is no individual method so it is easier to forget.</p>
<p>As far as I'm aware, AccessLevel in the InstanceDeclarations is more like a "default value", not a "contract". At least based on the base spec I mean. A companion spec might be able to limit this (in the text, not in a way for Codegen to know). Some Attributes have limits, <a href="https://reference.opcfoundation.org/specs/OPC-10000-3/6.2.7" rel="nofollow" target="_blank"><a href="https://reference.opcfoundatio" rel="nofollow">https://reference.opcfoundatio</a>.....00-3/6.2.7</a> + <a href="https://reference.opcfoundation.org/specs/OPC-10000-3/6.2.8" rel="nofollow" target="_blank"><a href="https://reference.opcfoundatio" rel="nofollow">https://reference.opcfoundatio</a>.....00-3/6.2.8</a>, but to my knowledge nothing is said for AccessLevel. Also, the generated setters are mostly for server side, but there it is usable always for setting the value, even if it would be read-only from a client's point of view.</p>
<p>Just be careful to remove the component-setter version from all of the generated files (i.e. not accidentally removing the method one in e.g. one file). The method one does also have ServiceException in addition to the StatusException. Note that the only difference to the Codegen-InstanceDeclaration-exclusion-way is that the getter and "node-getter" generated methods exist still (but this could be important).</p>
<p>P.S.<br />
This of course causes me to think could we have some day an option to exclude "any generated method". We do have class-level exclusions <a href="https://documentation.prosysopc.com/JSDK/tutorial/html/Prosys_OPC_UA_SDK_for_Java_Codegen_Manual.html#excluding-output-classes" rel="nofollow" target="_blank"><a href="https://documentation.prosysop" rel="nofollow">https://documentation.prosysop</a>.....ut-classes</a>, basically to avoid generating XXXTypeNodes that are in version control due to implemented methods. </p>
<p>Though it would still be more of a workaround than an actual solution.</p>
]]></description>
					                    <pubDate>Thu, 28 May 2026 17:28:42 +0300</pubDate>
                </item>
				                <item>
                    <title>hbrackel on Duplicate methods in generated code from MDIS Companion Standard</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/duplicate-methods-in-generated-code-from-mdis-companion-standard/#p7575</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/duplicate-methods-in-generated-code-from-mdis-companion-standard/#p7575</guid>
					                        <description><![CDATA[<p>Thank you very much for looking into this. </p>
<p>I am reluctant to exclude anything from code generation because most of the variables/components/methods are indeed important and required.<br />
While the nodeset design is a bit unfortunate from a code generation perspective, it is still quite common to use explicit UA methods as setters and have likewise named read-only variables. It would be "cool" if some time in the future the code generator could consider the accesslevel of a variable.as well. if it is "CurrentRead", then not generate a setter, if it is CurrentWrite and a setter method exists as well, then emit a warning.</p>
<p>I created (or rather Github Copilot) a gradle task to analyze the generated code, looking for setter and method definitions with conflicting signatures and remove just the duplicate setters. This way I don't need to exclude any components and the code is compiling okay.</p>
<p>Once again, many thanks for looking into this.</p>
]]></description>
					                    <pubDate>Thu, 28 May 2026 15:12:54 +0300</pubDate>
                </item>
				                <item>
                    <title>Bjarne Boström on Duplicate methods in generated code from MDIS Companion Standard</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/duplicate-methods-in-generated-code-from-mdis-companion-standard/#p7574</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/duplicate-methods-in-generated-code-from-mdis-companion-standard/#p7574</guid>
					                        <description><![CDATA[<p>Hi,</p>
<p>It is a known issue: <a href="https://documentation.prosysopc.com/JSDK/tutorial/html/Prosys_OPC_UA_SDK_for_Java_Codegen_Manual.html#known-issues" rel="nofollow" target="_blank"><a href="https://documentation.prosysop" rel="nofollow">https://documentation.prosysop</a>.....own-issues</a></p>
<p>The model <a href="https://reference.opcfoundation.org/specs/OPC-30020/6.6.3" rel="nofollow" target="_blank"><a href="https://reference.opcfoundatio" rel="nofollow">https://reference.opcfoundatio</a>.....0020/6.6.3</a> defines both a CalculatedPosition component and a SetCalculatedPosition Method. Thus it will conflict when we create the setter for the CalculatedPosition component and then the actual method for calling the Method. Codegen is not yet smart enough that it would detect and report this as an error directly. (There are also few other types in this model that do the same); we can hopefully do this at some point.</p>
<p>You must exclude one of them via <a href="https://documentation.prosysopc.com/JSDK/tutorial/html/Prosys_OPC_UA_SDK_for_Java_Codegen_Manual.html#excluding-sub-nodes-under-a-type-node-from-generation" rel="nofollow" target="_blank"><a href="https://documentation.prosysop" rel="nofollow">https://documentation.prosysop</a>.....generation</a>. I would recommend excluding the CalculatedPosition component, as it is easier to get via the generic UaNode.getComponent(QualifiedName) than implementing the Method call via <a href="https://documentation.prosysopc.com/JSDK/samples/sampleconsoleserver/src-html/com/prosysopc/ua/samples/server/MyMethodManagerListener.html" rel="nofollow" target="_blank"><a href="https://documentation.prosysop" rel="nofollow">https://documentation.prosysop</a>.....tener.html</a> style.</p>
<p>Thus, something like this in the Codegen configuration should do it:</p>
<p></p>
<div class="sfcode" id="sfcode2141">
&#060;excludes&#062;<br />
	&#060;instanceDeclarations&#062;<br />
		&#060;instanceDeclaration&#062;<a href="http://opcfoundation.org/UA/MDIS:CalculatedPosition&lt;/instanceDeclaration&amp;gt" rel="nofollow" target="_blank"><a href="http://opcfoundation.org/UA/MD" rel="nofollow">http://opcfoundation.org/UA/MD</a>.....on&#038;gt</a>;<br />
	&#060;/instanceDeclarations&#062;<br />
&#060;/excludes&#062;
</div>
<p>(...some day better code-snippet way.... but anyway have "http://opcfoundation.org/UA/MDIS:CalculatedPosition" without quotes as the 'instanceDeclaration' tag data)<br />
Note that it does exclude the CalculatedPosition node from all types of <a href="http://opcfoundation.org/UA/MDIS" rel="nofollow" target="_blank">http://opcfoundation.org/UA/MDIS</a>. This was originally designed to avoid conflicts with the SDK API itself.</p>
<p>P.S.<br />
Personally I would say it is a bit of an odd choice in the model that there seems to be Methods that just serves the same role as what a simple Write operation could do. There is maybe a bit of nuances regarding the async clause <a href="https://reference.opcfoundation.org/specs/OPC-30020/6.6.7" rel="nofollow" target="_blank"><a href="https://reference.opcfoundatio" rel="nofollow">https://reference.opcfoundatio</a>.....0020/6.6.7</a> though Write does have that as well <a href="https://reference.opcfoundation.org/specs/OPC-10000-4/5.11.4.4" rel="nofollow" target="_blank"><a href="https://reference.opcfoundatio" rel="nofollow">https://reference.opcfoundatio</a>.....4/5.11.4.4</a>. (though only in the presence of an "intermediate system", though an UA Client doesn't anyway know nothing of that so.. why does it matter). However, this is not the first time we see such models, so it is probably too late anyway to try to change them. Also, there could be valid cases, if more parameters would be involved the very least. (Or there could be something I miss here).</p>
<p>P.S.2.<br />
It is possible we some day do something for this. Though it is .. somewhat complicated to find a good solution that doesn't involve excluding. We could e.g. start to use prefixes for methods i.e. 'callXXX' instead of 'xXX' where XXX is the method name (though this would change all existing ones). It could maybe be a flag in the Codegen configuration, though then it gets tricky with overriding of methods (even more if doing so from the core model that is already generated in the SDK). We could try doing that only for methods starting with 'set'/'get', but then it is different based on the name (and could still maybe theoretically conflict). We could add a unused parameter as the first java-parameter in the method, but that too is a bit clunky solution.</p>
]]></description>
					                    <pubDate>Thu, 28 May 2026 14:47:41 +0300</pubDate>
                </item>
				                <item>
                    <title>hbrackel on Duplicate methods in generated code from MDIS Companion Standard</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/duplicate-methods-in-generated-code-from-mdis-companion-standard/#p7573</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/duplicate-methods-in-generated-code-from-mdis-companion-standard/#p7573</guid>
					                        <description><![CDATA[<p>Good afternoon,</p>
<p>I would like to generate code from the MDIS Companion standard, v1.3. The code generation itself succeeds without warnings or errors. The code does not compile, though, because some method declarations occur twice within the same class or interface.</p>
<p>Is this a problem with/of the companion standard or does the code generator need to be configured in a custom way?</p>
<p>As an example:</p>
<p></p>
<div class="sfcode" id="sfcode4567">
@TypeDefinitionId(&#034;nsu=http://opcfoundation.org/UA/MDIS;i=1066&#034;)<br />
public interface MDISChokeObjectType extends MDISBaseObjectType {<br />
...<br />
line 100:<br />
@Mandatory<br />
  void setCalculatedPosition(Float value) throws StatusException;<br />
...<br />
line 189: void setCalculatedPosition(Float f_position) throws StatusException, ServiceException;<br />
...
</div>
<p>Edit: Taking a closer look at the nodeset / companion standard, there is a read-only variable for each method, reflecting the value, which the method is expected to set. It looks like the code generator creates a setter method for those variables nonetheless. Another indicator for this are the declared exception types.<br />
Is there any way to configure the code generator to NOT generate setters for any variable at all?</p>
]]></description>
					                    <pubDate>Wed, 27 May 2026 22:13:01 +0300</pubDate>
                </item>
				                <item>
                    <title>Bjarne Boström on Fine control over client connections and requests</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7572</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7572</guid>
					                        <description><![CDATA[<p>Probably it would be best that you contact <a href="mailto:sales@prosysopc.com" target="_blank">sales@prosysopc.com</a> regarding <a href="https://prosysopc.com/services/opc-ua-consulting/" rel="nofollow" target="_blank"><a href="https://prosysopc.com/services" rel="nofollow">https://prosysopc.com/services</a>.....onsulting/</a>. Without knowing specifics it is hard to say, plus I might not be the best person to answer.</p>
<p>Define 'isolation' and 'user'. </p>
<p>Some levels of 'isolation' is impossible, as the network and execution environment is shared. For example, the message processing does use a shared thread pool (but even if not, individual threads would share the CPU). You would need a separate server per user and different hardware or container execution limits to avoid that. (Then you could use <a href="https://prosysopc.com/products/opc-ua-forge/" rel="nofollow" target="_blank"><a href="https://prosysopc.com/products" rel="nofollow">https://prosysopc.com/products</a>.....-ua-forge/</a> to aggregate them to create an "admin view" server).</p>
<p>For 'user' are we talking about your customers (i.e. "your users") or an OPC UA 'User'. Note that the UA User is only known at ActivateSession, before that you do not know it, thus you can only have "global limits". Non-UA-users would then be e.g. IP-ranges (socket connection), ApplicationUris (client certificates, UA Applications, OpenSecureChannel) or ApplicationDescription (CreateSession, has more detail than just ApplicationUri, though not much more). Personally I would say socket-level limitations should be done on the firewall already, maybe we some-day have things in the SDK, but at the moment it is not possible to limit on that level (other than the global limit).</p>
<p>There is a thing UaServer.setOperationLimits(OperationLimits) (set before UaServer.init()), that does control how many operations a ServiceRequest can contain. Default is 10000 in each type. This is also global though. And assuming relatively normal hardware I would keep it at 10000. One reason is that our client side by default does Read/Browse the entire Types part of the address space on connect (skipping some details, but mostly for Structure metadata; not ideal, but I would say best option so far). It doesn't typically result in that many individual ServiceRequests, but the total number of operations of them might be in 10000-30000 range total. </p>
<p>P.S.<br />
This forum will most likely be down for a few hours later today due to infrastructure changes.</p>
]]></description>
					                    <pubDate>Tue, 26 May 2026 14:59:29 +0300</pubDate>
                </item>
				                <item>
                    <title>t.tulka on Fine control over client connections and requests</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7571</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7571</guid>
					                        <description><![CDATA[<blockquote class="spPostEmbedQuote">
<p><strong>Bjarne Boström said </strong><br />
SDK already limits sessions and connections.</p>
</blockquote>
<p>Yes, but those limits are global and not user-specific, right? As I said, we have a multi-tenant service (OPCUA as a service), where users should be isolated from each other and handled individually.</p>
]]></description>
					                    <pubDate>Tue, 26 May 2026 11:53:55 +0300</pubDate>
                </item>
				                <item>
                    <title>Bjarne Boström on Fine control over client connections and requests</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7570</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7570</guid>
					                        <description><![CDATA[<p>The RequestResponseListener is ok there as well. </p>
<p>The SessionServiceHandler lacks the protected xxx(ServiceContext serviceContext, XXXRequest request, XXXResponse response) methods what are in the others. It goes more directly to the SessionManager. In the others they are sort of a "last effort place" to try to implement something, but regarding sessions SDK already should be implementing it .. completely (compared to e.g. data related to a Node's Attributes).</p>
<p>We do have intended ways for this as well: UaServer.getSessionManager().addListener(SessionManagerListener) see <a href="https://documentation.prosysopc.com/JSDK/javadoc/com/prosysopc/ua/server/SessionManagerListener.html" rel="nofollow" target="_blank"><a href="https://documentation.prosysop" rel="nofollow">https://documentation.prosysop</a>.....tener.html</a>. Also, for just user-validation there is UaServer.setUserValidator(UserValidator).</p>
<p>We have also build ways to override the SessionManager via a subtype, similar to the handlers, though the raw ServiceRequest is not available (but the relevant parameters of it are, in the protected methods). It is also possible to use a subtyped Session.</p>
<p>Note that SDK already limits sessions and connections. They are separate things, though most of the time it is 1:1. By default SessionManager.getMaxSessionCount() defines max number of sessions and by default 10% more (at least +1) opc.tcp connections can be made. This so that a client can see that the server is at session limit. UaServer.setMaxOpcTcpConnections(Integer) can be used to set a different limit. Note that in the SDK (and per UA spec), non-properly-ActivateSession'd connections are dropped if at connection limit and a new one arrives. Note that there is not a way to observe the actual connections (we might build this some day).</p>
]]></description>
					                    <pubDate>Fri, 22 May 2026 15:13:31 +0300</pubDate>
                </item>
				                <item>
                    <title>t.tulka on Fine control over client connections and requests</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7569</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7569</guid>
					                        <description><![CDATA[<p>&#062; RequestResponseListener<br />
Sounds really good!</p>
<p>&#062; In practice we have not encountered that much “real world examples”<br />
Yes, I guess our usecase is special: we are providing access to dynamically registered devices, kinda "OPCUA as a service" thing. But anyways, “Simple things should be simple, complex things should be possible.” is also valid here 🙂</p>
<p>One more question: You said you don't recommend overwriting SessionServiceHandler - for what reason? It would also be interesting for us to listen and monitor attempts to create (or activate) sessions, as those indicate the number of connections. And it would be good to use the same technique as with the other requests.</p>
<p>Thanks!</p>
]]></description>
					                    <pubDate>Fri, 22 May 2026 12:27:50 +0300</pubDate>
                </item>
				                <item>
                    <title>Bjarne Boström on Fine control over client connections and requests</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7568</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7568</guid>
					                        <description><![CDATA[<p>Maybe something similar to the ServiceHandler.setRequestResponseListener(RequestResponseListener) (see the P.S. from above), but only for requests and called as part of the validate. It would still be a bit hidden, but maybe a bit easier to use. We'll have to discuss this internally.</p>
<p>I did mean the EndpointServiceRequest version, but as long as you have not used UaServer.getLoopbackClient() (skipping details) then validateRequest(ServiceRequest, ServerSecureChannel) is ok as well.</p>
<p>In practice we have not encountered that much "real world examples". Like, the best one is our public Simulation Server instance which sometimes get "stuck" when someone makes many sessions so that the max sessions/connections limit is reached. But then again normally one has firewall rules that only accepts connections from defined sources, so not sure does even this count.</p>
]]></description>
					                    <pubDate>Thu, 21 May 2026 20:14:16 +0300</pubDate>
                </item>
				                <item>
                    <title>t.tulka on Fine control over client connections and requests</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7567</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7567</guid>
					                        <description><![CDATA[<p>Thanks!<br />
I absolutely agree that no direct access to the stack should be provided. What I am wishing for would be a listener injection on the UaServer level, like `UaServer.addListener(RequestTypeEnumeration type, BiConsumer callback)` or similar, where `Request` would be a new abstraction for this particular purpose, not an implementation detail from the stack.</p>
<p>I will try the proposed approach and let you know, but it looks promising! I just guess you meant `com.prosysopc.ua.server.ServiceHandler.validateRequest(ServiceRequest, ServerSecureChannel)` ?</p>
<p>Regarding the rate limiting, yes, what you say makes sense, but how can an OPC UA server then deal with misconfigured clients and prevent being taken down by an unintended DoS? Do you have any recommendations or experience? I already asked about this in particular in this old thread, but a real-world solution was not found: <a href="https://forum.prosysopc.com/forum/opc-ua-java-sdk/rate-limiting-for-server/" target="_blank"><a href="https://forum.prosysopc.com/fo">https://forum.prosysopc.com/fo</a>.....or-server/</a></p>
]]></description>
					                    <pubDate>Thu, 21 May 2026 18:42:00 +0300</pubDate>
                </item>
				                <item>
                    <title>Bjarne Boström on Fine control over client connections and requests</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7566</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7566</guid>
					                        <description><![CDATA[<p>P.S.</p>
<p>There exists ServiceHandler.setRequestResponseListener(RequestResponseListener), which could be used for a logging-only scenario, you can get the XXXServiceHandlers from UaServer. This listener is called just before sending back the response (which should not be modified here). This is what our Simulation Server Application's Req/Res Log tab uses. Though, seems we have not used ServiceContext here in this Listener, thus the logic relies on com.prosysopc.ua.server.SessionManager.getSession(NodeId) using the authentication token from the header (though, this is what is also used for forming the ServiceContext).</p>
]]></description>
					                    <pubDate>Thu, 21 May 2026 18:34:50 +0300</pubDate>
                </item>
				                <item>
                    <title>Bjarne Boström on Fine control over client connections and requests</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7565</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7565</guid>
					                        <description><![CDATA[<p>Hi,</p>
<p>Not exactly, as the point of an OPC UA SDK, in general, is to provide a higher-level abstraction and thus to try hiding the complex raw communication details.</p>
<p>10+ years ago the communication layers of OPC UA typically looked like:</p>
<pre>
+----------------------+
&#124;         TCP            &#124;
+----------------------+
&#124;      UA Stack       &#124;
+----------------------+
&#124;       UA SDK        &#124;
+----------------------+
&#124;  UA Application  &#124;
+----------------------+
</pre>
<p>Stacks were responsible to handling the raw socket connections, encoding messages to binary and then provide a raw request-response layer for the actual services. SDKs then abstract things more and provide something more use-able. What you basically say you would want would have been inside the Stack level, though 'SecurityToken' is not actually a "user token", but instead details related to the opc.tcp SecureChannel. </p>
<p>Nowadays Stacks are basically gone extinct. Some history regarding our SDK: <a href="https://documentation.prosysopc.com/JSDK/tutorial/html/Prosys_OPC_UA_SDK_for_Java_3_To_4_Migration_Guide.html#stack-changes" rel="nofollow" target="_blank"><a href="https://documentation.prosysop" rel="nofollow">https://documentation.prosysop</a>.....ck-changes</a> .We did make a mistake 15+ years ago that the stack classes were used directly in the SDK APIs, unfortunately fixing that might be impossible at this point. But basically other than those (and some util classes), classes being in 'com.prosysopc.ua.stack' package and subpackage should be considered to be "SDK private API".</p>
<p>That all is to say that it is not intended that you would normally handle the raw requests and doing so could break SDK's own functionality.</p>
<p>That being said, we do have some options, but it does require a bit more work. We would instead recommend using things that the sampleconsoleserver example shows, those are the intended ways, though that does involve attaching numerous XXXListeners to places for access control.</p>
<p>Anyway, you could try the following and let us know how it goes:<br />
Subtype UaServer, override protected createXXXServiceHandler methods. Return sub-typed XXXServiceHandlers where 'XXX' is either 'Attribute', 'NodeManagement' or 'Subscription'. There exist also a SessionServiceHandler, but we recommend not to touch that one. Note that there are some methods that are final, those are historical Stack-to-SDK entry points and cannot be overridden.</p>
<p>However, you could override the com.prosysopc.ua.server.ServiceHandler.validateRequest(EndpointServiceRequest). It is recommended to call super first, to receive the ServiceContext that needs to be returned. You could throw ServiceException to fail the entire service. The ServiceRequest can be obtained from EndpointServiceRequest.getRequest(). However, I would be very cautious on doing any 'rate limiting' attempts, it is not something expected by UA Clients, they will either break or retry immediately, which would defeat the point.</p>
<p>The ServiceContext does tell the Session and from the Session you can get the ServerUserIdentity, which is server-side variation of the UserIdentity a client would use. The ServiceContext is a parameter in most of the recommended Listener-ways for handling authorization, it is passed along the call chain, see below.</p>
<p>An alternative is to look for methods such as <a href="https://documentation.prosysopc.com/JSDK/javadoc/com/prosysopc/ua/server/AttributeServiceHandler.html#read-com.prosysopc.ua.server.ServiceContext-com.prosysopc.ua.stack.core.ReadRequest-com.prosysopc.ua.stack.core.ReadResponse-" rel="nofollow" target="_blank"><a href="https://documentation.prosysop" rel="nofollow">https://documentation.prosysop</a>.....dResponse-</a> , and override them. These are called after the validate and then some of them will then split up more to other protected methods, then eventually they will go to YYYManagers. XXX and YYY might not be the same, but e.g. in Sessions it will go to SessionManager, which you can get normally from UaServer. It would provide info (a bit) about the sessions (UA has a Diagnostics concept). Many of YYY will have also YYYListener, here SessionManagerListener, that provides handles to react to their creation etc.</p>
<p>As this post is already quite long, I'll stop here for now, but please ask more and explain more about specifics what you would want to do.</p>
]]></description>
					                    <pubDate>Thu, 21 May 2026 18:04:27 +0300</pubDate>
                </item>
				                <item>
                    <title>t.tulka on Fine control over client connections and requests</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7564</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/fine-control-over-client-connections-and-requests/#p7564</guid>
					                        <description><![CDATA[<p>Hi,<br />
I am using Prosys client-server Java SDK 5.6.2</p>
<p>I need finer control over client connections for various reasons (monitoring, statistics, access control, rate limiting, licensing, etc.).<br />
I am interested in intercepting *all* low-level requests such as Create Session, Activate Session, Read, Write, Browse, etc.</p>
<p>Inspecting the code, the best would be to have a callback in the method `handleSecureMessage` of `OpcTcpServerConnection` (line 721), where I have access to the current `ServiceRequest` as well as `SecurityToken`. Unfortunately, the API doesn't provide access to this part of the code. </p>
<p>I also do not see any option in the `UaServer` API to inject any listener to handle requests on this level of granularity. Ideally, with the User token included.</p>
<p>Is there any option to intercept all requests, or would it be possible to build such an option in? </p>
<p>Thanks!</p>
]]></description>
					                    <pubDate>Wed, 20 May 2026 12:43:58 +0300</pubDate>
                </item>
				                <item>
                    <title>rocket science on Question about ApplicationIdentity constructor with keyStoreType parameter</title>
                    <link>https://forum.prosysopc.com/forum/opc-ua-java-sdk/question-about-applicationidentity-constructor-with-keystoretype-parameter/#p7563</link>
                    <category>OPC UA SDK for Java</category>
                    <guid isPermaLink="true">https://forum.prosysopc.com/forum/opc-ua-java-sdk/question-about-applicationidentity-constructor-with-keystoretype-parameter/#p7563</guid>
					                        <description><![CDATA[<p>Thank you so much for providing the beta version that quick.</p>
<p>I've tested it and worked 😉</p>
]]></description>
					                    <pubDate>Mon, 11 May 2026 14:42:55 +0300</pubDate>
                </item>
				    </channel>
	</rss>
