From fa105b45a7790dbc46abaed0d9cff90f97df8847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Dywicki?= Date: Fri, 23 Aug 2024 00:50:05 +0200 Subject: [PATCH] Checkin of generated contents. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ɓukasz Dywicki --- .../readwrite/AnonymousIdentityToken.java | 48 +++++++++++---- .../java/opcua/readwrite/ExpandedNodeId.java | 11 ---- .../readwrite/ExtensionObjectDefinition.java | 17 +++++- .../opcua/readwrite/IssuedIdentityToken.java | 47 +++++++++++---- .../plc4x/java/opcua/readwrite/NodeId.java | 11 ---- .../opcua/readwrite/NodeIdByteString.java | 11 ++++ .../java/opcua/readwrite/NodeIdFourByte.java | 11 ++++ .../java/opcua/readwrite/NodeIdGuid.java | 11 ++++ .../java/opcua/readwrite/NodeIdNumeric.java | 11 ++++ .../java/opcua/readwrite/NodeIdString.java | 11 ++++ .../java/opcua/readwrite/NodeIdTwoByte.java | 11 ++++ .../opcua/readwrite/NodeIdTypeDefinition.java | 2 + .../opcua/readwrite/UserIdentityToken.java | 59 +++---------------- .../readwrite/UserNameIdentityToken.java | 53 +++++++++++++---- .../opcua/readwrite/X509IdentityToken.java | 48 +++++++++++---- 15 files changed, 233 insertions(+), 129 deletions(-) diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/AnonymousIdentityToken.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/AnonymousIdentityToken.java index 688351e192f..84737653936 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/AnonymousIdentityToken.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/AnonymousIdentityToken.java @@ -35,24 +35,35 @@ // Code generated by code-generation. DO NOT EDIT. -public class AnonymousIdentityToken extends UserIdentityTokenDefinition implements Message { +public class AnonymousIdentityToken extends ExtensionObjectDefinition implements Message { // Accessors for discriminator values. - public String getIdentifier() { - return (String) "anonymous"; + public Integer getExtensionId() { + return (int) 321; } - public AnonymousIdentityToken() { + // Properties. + protected final PascalString policyId; + + public AnonymousIdentityToken(PascalString policyId) { super(); + this.policyId = policyId; + } + + public PascalString getPolicyId() { + return policyId; } @Override - protected void serializeUserIdentityTokenDefinitionChild(WriteBuffer writeBuffer) + protected void serializeExtensionObjectDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { PositionAware positionAware = writeBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); writeBuffer.pushContext("AnonymousIdentityToken"); + // Simple Field (policyId) + writeSimpleField("policyId", policyId, new DataWriterComplexDefault<>(writeBuffer)); + writeBuffer.popContext("AnonymousIdentityToken"); } @@ -67,27 +78,38 @@ public int getLengthInBits() { AnonymousIdentityToken _value = this; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + // Simple field (policyId) + lengthInBits += policyId.getLengthInBits(); + return lengthInBits; } - public static UserIdentityTokenDefinitionBuilder staticParseUserIdentityTokenDefinitionBuilder( - ReadBuffer readBuffer, String identifier) throws ParseException { + public static ExtensionObjectDefinitionBuilder staticParseExtensionObjectDefinitionBuilder( + ReadBuffer readBuffer, Integer extensionId) throws ParseException { readBuffer.pullContext("AnonymousIdentityToken"); PositionAware positionAware = readBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + PascalString policyId = + readSimpleField( + "policyId", + new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer)); + readBuffer.closeContext("AnonymousIdentityToken"); // Create the instance - return new AnonymousIdentityTokenBuilderImpl(); + return new AnonymousIdentityTokenBuilderImpl(policyId); } public static class AnonymousIdentityTokenBuilderImpl - implements UserIdentityTokenDefinition.UserIdentityTokenDefinitionBuilder { + implements ExtensionObjectDefinition.ExtensionObjectDefinitionBuilder { + private final PascalString policyId; - public AnonymousIdentityTokenBuilderImpl() {} + public AnonymousIdentityTokenBuilderImpl(PascalString policyId) { + this.policyId = policyId; + } public AnonymousIdentityToken build() { - AnonymousIdentityToken anonymousIdentityToken = new AnonymousIdentityToken(); + AnonymousIdentityToken anonymousIdentityToken = new AnonymousIdentityToken(policyId); return anonymousIdentityToken; } } @@ -101,12 +123,12 @@ public boolean equals(Object o) { return false; } AnonymousIdentityToken that = (AnonymousIdentityToken) o; - return super.equals(that) && true; + return (getPolicyId() == that.getPolicyId()) && super.equals(that) && true; } @Override public int hashCode() { - return Objects.hash(super.hashCode()); + return Objects.hash(super.hashCode(), getPolicyId()); } @Override diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/ExpandedNodeId.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/ExpandedNodeId.java index 2241fb143a5..16d07b197a7 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/ExpandedNodeId.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/ExpandedNodeId.java @@ -78,10 +78,6 @@ public Long getServerIndex() { return serverIndex; } - public String getIdentifier() { - return String.valueOf(getNodeId().getIdentifier()); - } - public void serialize(WriteBuffer writeBuffer) throws SerializationException { PositionAware positionAware = writeBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); @@ -96,10 +92,6 @@ public void serialize(WriteBuffer writeBuffer) throws SerializationException { // Simple Field (nodeId) writeSimpleField("nodeId", nodeId, new DataWriterComplexDefault<>(writeBuffer)); - // Virtual field (doesn't actually serialize anything, just makes the value available) - String identifier = getIdentifier(); - writeBuffer.writeVirtual("identifier", identifier); - // Optional Field (namespaceURI) (Can be skipped, if the value is null) writeOptionalField("namespaceURI", namespaceURI, new DataWriterComplexDefault<>(writeBuffer)); @@ -129,8 +121,6 @@ public int getLengthInBits() { // Simple field (nodeId) lengthInBits += nodeId.getLengthInBits(); - // A virtual field doesn't have any in- or output. - // Optional Field (namespaceURI) if (namespaceURI != null) { lengthInBits += namespaceURI.getLengthInBits(); @@ -165,7 +155,6 @@ public static ExpandedNodeId staticParse(ReadBuffer readBuffer) throws ParseExce "nodeId", new DataReaderComplexDefault<>( () -> NodeIdTypeDefinition.staticParse(readBuffer), readBuffer)); - String identifier = readVirtualField("identifier", String.class, nodeId.getIdentifier()); PascalString namespaceURI = readOptionalField( diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/ExtensionObjectDefinition.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/ExtensionObjectDefinition.java index d13f97b6239..fbc48d55bf8 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/ExtensionObjectDefinition.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/ExtensionObjectDefinition.java @@ -556,6 +556,20 @@ public static ExtensionObjectDefinition staticParse(ReadBuffer readBuffer, Integ } else if (EvaluationHelper.equals(extensionId, (int) 318)) { builder = UserIdentityToken.staticParseExtensionObjectDefinitionBuilder(readBuffer, extensionId); + } else if (EvaluationHelper.equals(extensionId, (int) 321)) { + builder = + AnonymousIdentityToken.staticParseExtensionObjectDefinitionBuilder( + readBuffer, extensionId); + } else if (EvaluationHelper.equals(extensionId, (int) 324)) { + builder = + UserNameIdentityToken.staticParseExtensionObjectDefinitionBuilder( + readBuffer, extensionId); + } else if (EvaluationHelper.equals(extensionId, (int) 327)) { + builder = + X509IdentityToken.staticParseExtensionObjectDefinitionBuilder(readBuffer, extensionId); + } else if (EvaluationHelper.equals(extensionId, (int) 940)) { + builder = + IssuedIdentityToken.staticParseExtensionObjectDefinitionBuilder(readBuffer, extensionId); } else if (EvaluationHelper.equals(extensionId, (int) 467)) { builder = ActivateSessionRequest.staticParseExtensionObjectDefinitionBuilder( @@ -1106,9 +1120,6 @@ public static ExtensionObjectDefinition staticParse(ReadBuffer readBuffer, Integ readBuffer, extensionId); } else if (EvaluationHelper.equals(extensionId, (int) 893)) { builder = Annotation.staticParseExtensionObjectDefinitionBuilder(readBuffer, extensionId); - } else if (EvaluationHelper.equals(extensionId, (int) 316)) { - builder = - UserIdentityToken.staticParseExtensionObjectDefinitionBuilder(readBuffer, extensionId); } if (builder == null) { throw new ParseException( diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/IssuedIdentityToken.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/IssuedIdentityToken.java index d2219b20bd1..f5ab58baaad 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/IssuedIdentityToken.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/IssuedIdentityToken.java @@ -35,23 +35,30 @@ // Code generated by code-generation. DO NOT EDIT. -public class IssuedIdentityToken extends UserIdentityTokenDefinition implements Message { +public class IssuedIdentityToken extends ExtensionObjectDefinition implements Message { // Accessors for discriminator values. - public String getIdentifier() { - return (String) "identity"; + public Integer getExtensionId() { + return (int) 940; } // Properties. + protected final PascalString policyId; protected final PascalByteString tokenData; protected final PascalString encryptionAlgorithm; - public IssuedIdentityToken(PascalByteString tokenData, PascalString encryptionAlgorithm) { + public IssuedIdentityToken( + PascalString policyId, PascalByteString tokenData, PascalString encryptionAlgorithm) { super(); + this.policyId = policyId; this.tokenData = tokenData; this.encryptionAlgorithm = encryptionAlgorithm; } + public PascalString getPolicyId() { + return policyId; + } + public PascalByteString getTokenData() { return tokenData; } @@ -61,12 +68,15 @@ public PascalString getEncryptionAlgorithm() { } @Override - protected void serializeUserIdentityTokenDefinitionChild(WriteBuffer writeBuffer) + protected void serializeExtensionObjectDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { PositionAware positionAware = writeBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); writeBuffer.pushContext("IssuedIdentityToken"); + // Simple Field (policyId) + writeSimpleField("policyId", policyId, new DataWriterComplexDefault<>(writeBuffer)); + // Simple Field (tokenData) writeSimpleField("tokenData", tokenData, new DataWriterComplexDefault<>(writeBuffer)); @@ -88,6 +98,9 @@ public int getLengthInBits() { IssuedIdentityToken _value = this; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + // Simple field (policyId) + lengthInBits += policyId.getLengthInBits(); + // Simple field (tokenData) lengthInBits += tokenData.getLengthInBits(); @@ -97,12 +110,17 @@ public int getLengthInBits() { return lengthInBits; } - public static UserIdentityTokenDefinitionBuilder staticParseUserIdentityTokenDefinitionBuilder( - ReadBuffer readBuffer, String identifier) throws ParseException { + public static ExtensionObjectDefinitionBuilder staticParseExtensionObjectDefinitionBuilder( + ReadBuffer readBuffer, Integer extensionId) throws ParseException { readBuffer.pullContext("IssuedIdentityToken"); PositionAware positionAware = readBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + PascalString policyId = + readSimpleField( + "policyId", + new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer)); + PascalByteString tokenData = readSimpleField( "tokenData", @@ -116,23 +134,25 @@ public static UserIdentityTokenDefinitionBuilder staticParseUserIdentityTokenDef readBuffer.closeContext("IssuedIdentityToken"); // Create the instance - return new IssuedIdentityTokenBuilderImpl(tokenData, encryptionAlgorithm); + return new IssuedIdentityTokenBuilderImpl(policyId, tokenData, encryptionAlgorithm); } public static class IssuedIdentityTokenBuilderImpl - implements UserIdentityTokenDefinition.UserIdentityTokenDefinitionBuilder { + implements ExtensionObjectDefinition.ExtensionObjectDefinitionBuilder { + private final PascalString policyId; private final PascalByteString tokenData; private final PascalString encryptionAlgorithm; public IssuedIdentityTokenBuilderImpl( - PascalByteString tokenData, PascalString encryptionAlgorithm) { + PascalString policyId, PascalByteString tokenData, PascalString encryptionAlgorithm) { + this.policyId = policyId; this.tokenData = tokenData; this.encryptionAlgorithm = encryptionAlgorithm; } public IssuedIdentityToken build() { IssuedIdentityToken issuedIdentityToken = - new IssuedIdentityToken(tokenData, encryptionAlgorithm); + new IssuedIdentityToken(policyId, tokenData, encryptionAlgorithm); return issuedIdentityToken; } } @@ -146,7 +166,8 @@ public boolean equals(Object o) { return false; } IssuedIdentityToken that = (IssuedIdentityToken) o; - return (getTokenData() == that.getTokenData()) + return (getPolicyId() == that.getPolicyId()) + && (getTokenData() == that.getTokenData()) && (getEncryptionAlgorithm() == that.getEncryptionAlgorithm()) && super.equals(that) && true; @@ -154,7 +175,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(super.hashCode(), getTokenData(), getEncryptionAlgorithm()); + return Objects.hash(super.hashCode(), getPolicyId(), getTokenData(), getEncryptionAlgorithm()); } @Override diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeId.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeId.java index bc818ba38fe..9ceefa8a0d4 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeId.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeId.java @@ -49,10 +49,6 @@ public NodeIdTypeDefinition getNodeId() { return nodeId; } - public String getId() { - return String.valueOf(getNodeId().getIdentifier()); - } - public void serialize(WriteBuffer writeBuffer) throws SerializationException { PositionAware positionAware = writeBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); @@ -64,10 +60,6 @@ public void serialize(WriteBuffer writeBuffer) throws SerializationException { // Simple Field (nodeId) writeSimpleField("nodeId", nodeId, new DataWriterComplexDefault<>(writeBuffer)); - // Virtual field (doesn't actually serialize anything, just makes the value available) - String id = getId(); - writeBuffer.writeVirtual("id", id); - writeBuffer.popContext("NodeId"); } @@ -88,8 +80,6 @@ public int getLengthInBits() { // Simple field (nodeId) lengthInBits += nodeId.getLengthInBits(); - // A virtual field doesn't have any in- or output. - return lengthInBits; } @@ -110,7 +100,6 @@ public static NodeId staticParse(ReadBuffer readBuffer) throws ParseException { "nodeId", new DataReaderComplexDefault<>( () -> NodeIdTypeDefinition.staticParse(readBuffer), readBuffer)); - String id = readVirtualField("id", String.class, nodeId.getIdentifier()); readBuffer.closeContext("NodeId"); // Create the instance diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdByteString.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdByteString.java index 9f602f2f7d3..b4c8d770c67 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdByteString.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdByteString.java @@ -64,6 +64,10 @@ public String getIdentifier() { return String.valueOf(getId().getStringValue()); } + public int getNamespace() { + return (int) (getNamespaceIndex()); + } + @Override protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { @@ -81,6 +85,10 @@ protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) String identifier = getIdentifier(); writeBuffer.writeVirtual("identifier", identifier); + // Virtual field (doesn't actually serialize anything, just makes the value available) + int namespace = getNamespace(); + writeBuffer.writeVirtual("namespace", namespace); + writeBuffer.popContext("NodeIdByteString"); } @@ -103,6 +111,8 @@ public int getLengthInBits() { // A virtual field doesn't have any in- or output. + // A virtual field doesn't have any in- or output. + return lengthInBits; } @@ -120,6 +130,7 @@ public static NodeIdTypeDefinitionBuilder staticParseNodeIdTypeDefinitionBuilder new DataReaderComplexDefault<>( () -> PascalByteString.staticParse(readBuffer), readBuffer)); String identifier = readVirtualField("identifier", String.class, id.getStringValue()); + int namespace = readVirtualField("namespace", int.class, namespaceIndex); readBuffer.closeContext("NodeIdByteString"); // Create the instance diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdFourByte.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdFourByte.java index 67a4cf95046..6a5739d20c5 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdFourByte.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdFourByte.java @@ -64,6 +64,10 @@ public String getIdentifier() { return String.valueOf(getId()); } + public int getNamespace() { + return (int) (getNamespaceIndex()); + } + @Override protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { @@ -81,6 +85,10 @@ protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) String identifier = getIdentifier(); writeBuffer.writeVirtual("identifier", identifier); + // Virtual field (doesn't actually serialize anything, just makes the value available) + int namespace = getNamespace(); + writeBuffer.writeVirtual("namespace", namespace); + writeBuffer.popContext("NodeIdFourByte"); } @@ -103,6 +111,8 @@ public int getLengthInBits() { // A virtual field doesn't have any in- or output. + // A virtual field doesn't have any in- or output. + return lengthInBits; } @@ -116,6 +126,7 @@ public static NodeIdTypeDefinitionBuilder staticParseNodeIdTypeDefinitionBuilder int id = readSimpleField("id", readUnsignedInt(readBuffer, 16)); String identifier = readVirtualField("identifier", String.class, id); + int namespace = readVirtualField("namespace", int.class, namespaceIndex); readBuffer.closeContext("NodeIdFourByte"); // Create the instance diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdGuid.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdGuid.java index 3df366f018d..e949a9cdd2a 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdGuid.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdGuid.java @@ -64,6 +64,10 @@ public String getIdentifier() { return String.valueOf(getId()); } + public int getNamespace() { + return (int) (getNamespaceIndex()); + } + @Override protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { @@ -81,6 +85,10 @@ protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) String identifier = getIdentifier(); writeBuffer.writeVirtual("identifier", identifier); + // Virtual field (doesn't actually serialize anything, just makes the value available) + int namespace = getNamespace(); + writeBuffer.writeVirtual("namespace", namespace); + writeBuffer.popContext("NodeIdGuid"); } @@ -105,6 +113,8 @@ public int getLengthInBits() { // A virtual field doesn't have any in- or output. + // A virtual field doesn't have any in- or output. + return lengthInBits; } @@ -118,6 +128,7 @@ public static NodeIdTypeDefinitionBuilder staticParseNodeIdTypeDefinitionBuilder byte[] id = readBuffer.readByteArray("id", Math.toIntExact(16)); String identifier = readVirtualField("identifier", String.class, id); + int namespace = readVirtualField("namespace", int.class, namespaceIndex); readBuffer.closeContext("NodeIdGuid"); // Create the instance diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdNumeric.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdNumeric.java index c00daa406bb..1b538f2e483 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdNumeric.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdNumeric.java @@ -64,6 +64,10 @@ public String getIdentifier() { return String.valueOf(getId()); } + public int getNamespace() { + return (int) (getNamespaceIndex()); + } + @Override protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { @@ -81,6 +85,10 @@ protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) String identifier = getIdentifier(); writeBuffer.writeVirtual("identifier", identifier); + // Virtual field (doesn't actually serialize anything, just makes the value available) + int namespace = getNamespace(); + writeBuffer.writeVirtual("namespace", namespace); + writeBuffer.popContext("NodeIdNumeric"); } @@ -103,6 +111,8 @@ public int getLengthInBits() { // A virtual field doesn't have any in- or output. + // A virtual field doesn't have any in- or output. + return lengthInBits; } @@ -116,6 +126,7 @@ public static NodeIdTypeDefinitionBuilder staticParseNodeIdTypeDefinitionBuilder long id = readSimpleField("id", readUnsignedLong(readBuffer, 32)); String identifier = readVirtualField("identifier", String.class, id); + int namespace = readVirtualField("namespace", int.class, namespaceIndex); readBuffer.closeContext("NodeIdNumeric"); // Create the instance diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdString.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdString.java index f6a66b3cfea..9baa08a5bcb 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdString.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdString.java @@ -64,6 +64,10 @@ public String getIdentifier() { return String.valueOf(getId().getStringValue()); } + public int getNamespace() { + return (int) (getNamespaceIndex()); + } + @Override protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { @@ -81,6 +85,10 @@ protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) String identifier = getIdentifier(); writeBuffer.writeVirtual("identifier", identifier); + // Virtual field (doesn't actually serialize anything, just makes the value available) + int namespace = getNamespace(); + writeBuffer.writeVirtual("namespace", namespace); + writeBuffer.popContext("NodeIdString"); } @@ -103,6 +111,8 @@ public int getLengthInBits() { // A virtual field doesn't have any in- or output. + // A virtual field doesn't have any in- or output. + return lengthInBits; } @@ -119,6 +129,7 @@ public static NodeIdTypeDefinitionBuilder staticParseNodeIdTypeDefinitionBuilder "id", new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer)); String identifier = readVirtualField("identifier", String.class, id.getStringValue()); + int namespace = readVirtualField("namespace", int.class, namespaceIndex); readBuffer.closeContext("NodeIdString"); // Create the instance diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdTwoByte.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdTwoByte.java index 955ca03a4ec..7286daca1a7 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdTwoByte.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdTwoByte.java @@ -58,6 +58,10 @@ public String getIdentifier() { return String.valueOf(getId()); } + public int getNamespace() { + return (int) (-(1)); + } + @Override protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { @@ -72,6 +76,10 @@ protected void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) String identifier = getIdentifier(); writeBuffer.writeVirtual("identifier", identifier); + // Virtual field (doesn't actually serialize anything, just makes the value available) + int namespace = getNamespace(); + writeBuffer.writeVirtual("namespace", namespace); + writeBuffer.popContext("NodeIdTwoByte"); } @@ -91,6 +99,8 @@ public int getLengthInBits() { // A virtual field doesn't have any in- or output. + // A virtual field doesn't have any in- or output. + return lengthInBits; } @@ -102,6 +112,7 @@ public static NodeIdTypeDefinitionBuilder staticParseNodeIdTypeDefinitionBuilder short id = readSimpleField("id", readUnsignedShort(readBuffer, 8)); String identifier = readVirtualField("identifier", String.class, id); + int namespace = readVirtualField("namespace", int.class, -(1)); readBuffer.closeContext("NodeIdTwoByte"); // Create the instance diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdTypeDefinition.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdTypeDefinition.java index 8cdd7ed289e..46ea38a8cee 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdTypeDefinition.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/NodeIdTypeDefinition.java @@ -46,6 +46,8 @@ public NodeIdTypeDefinition() { public abstract String getIdentifier(); + public abstract int getNamespace(); + protected abstract void serializeNodeIdTypeDefinitionChild(WriteBuffer writeBuffer) throws SerializationException; diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/UserIdentityToken.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/UserIdentityToken.java index 217290b0f10..3c6ca3adb98 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/UserIdentityToken.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/UserIdentityToken.java @@ -39,28 +39,21 @@ public class UserIdentityToken extends ExtensionObjectDefinition implements Mess // Accessors for discriminator values. public Integer getExtensionId() { - return (int) 316; + return (int) 318; } // Properties. protected final PascalString policyId; - protected final UserIdentityTokenDefinition userIdentityTokenDefinition; - public UserIdentityToken( - PascalString policyId, UserIdentityTokenDefinition userIdentityTokenDefinition) { + public UserIdentityToken(PascalString policyId) { super(); this.policyId = policyId; - this.userIdentityTokenDefinition = userIdentityTokenDefinition; } public PascalString getPolicyId() { return policyId; } - public UserIdentityTokenDefinition getUserIdentityTokenDefinition() { - return userIdentityTokenDefinition; - } - @Override protected void serializeExtensionObjectDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { @@ -68,23 +61,9 @@ protected void serializeExtensionObjectDefinitionChild(WriteBuffer writeBuffer) boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); writeBuffer.pushContext("UserIdentityToken"); - // Implicit Field (policyLength) (Used for parsing, but its value is not stored as it's - // implicitly given by the objects content) - int policyLength = - (int) - ((getPolicyId().getLengthInBytes()) - + (getUserIdentityTokenDefinition().getLengthInBytes())); - writeImplicitField("policyLength", policyLength, writeSignedInt(writeBuffer, 32)); - // Simple Field (policyId) writeSimpleField("policyId", policyId, new DataWriterComplexDefault<>(writeBuffer)); - // Simple Field (userIdentityTokenDefinition) - writeSimpleField( - "userIdentityTokenDefinition", - userIdentityTokenDefinition, - new DataWriterComplexDefault<>(writeBuffer)); - writeBuffer.popContext("UserIdentityToken"); } @@ -99,15 +78,9 @@ public int getLengthInBits() { UserIdentityToken _value = this; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - // Implicit Field (policyLength) - lengthInBits += 32; - // Simple field (policyId) lengthInBits += policyId.getLengthInBits(); - // Simple field (userIdentityTokenDefinition) - lengthInBits += userIdentityTokenDefinition.getLengthInBits(); - return lengthInBits; } @@ -117,41 +90,26 @@ public static ExtensionObjectDefinitionBuilder staticParseExtensionObjectDefinit PositionAware positionAware = readBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - int policyLength = readImplicitField("policyLength", readSignedInt(readBuffer, 32)); - PascalString policyId = readSimpleField( "policyId", new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer)); - UserIdentityTokenDefinition userIdentityTokenDefinition = - readSimpleField( - "userIdentityTokenDefinition", - new DataReaderComplexDefault<>( - () -> - UserIdentityTokenDefinition.staticParse( - readBuffer, (String) (policyId.getStringValue())), - readBuffer)); - readBuffer.closeContext("UserIdentityToken"); // Create the instance - return new UserIdentityTokenBuilderImpl(policyId, userIdentityTokenDefinition); + return new UserIdentityTokenBuilderImpl(policyId); } public static class UserIdentityTokenBuilderImpl implements ExtensionObjectDefinition.ExtensionObjectDefinitionBuilder { private final PascalString policyId; - private final UserIdentityTokenDefinition userIdentityTokenDefinition; - public UserIdentityTokenBuilderImpl( - PascalString policyId, UserIdentityTokenDefinition userIdentityTokenDefinition) { + public UserIdentityTokenBuilderImpl(PascalString policyId) { this.policyId = policyId; - this.userIdentityTokenDefinition = userIdentityTokenDefinition; } public UserIdentityToken build() { - UserIdentityToken userIdentityToken = - new UserIdentityToken(policyId, userIdentityTokenDefinition); + UserIdentityToken userIdentityToken = new UserIdentityToken(policyId); return userIdentityToken; } } @@ -165,15 +123,12 @@ public boolean equals(Object o) { return false; } UserIdentityToken that = (UserIdentityToken) o; - return (getPolicyId() == that.getPolicyId()) - && (getUserIdentityTokenDefinition() == that.getUserIdentityTokenDefinition()) - && super.equals(that) - && true; + return (getPolicyId() == that.getPolicyId()) && super.equals(that) && true; } @Override public int hashCode() { - return Objects.hash(super.hashCode(), getPolicyId(), getUserIdentityTokenDefinition()); + return Objects.hash(super.hashCode(), getPolicyId()); } @Override diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/UserNameIdentityToken.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/UserNameIdentityToken.java index 8a43797e9d4..c7df90b14d2 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/UserNameIdentityToken.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/UserNameIdentityToken.java @@ -35,26 +35,35 @@ // Code generated by code-generation. DO NOT EDIT. -public class UserNameIdentityToken extends UserIdentityTokenDefinition implements Message { +public class UserNameIdentityToken extends ExtensionObjectDefinition implements Message { // Accessors for discriminator values. - public String getIdentifier() { - return (String) "username"; + public Integer getExtensionId() { + return (int) 324; } // Properties. + protected final PascalString policyId; protected final PascalString userName; protected final PascalByteString password; protected final PascalString encryptionAlgorithm; public UserNameIdentityToken( - PascalString userName, PascalByteString password, PascalString encryptionAlgorithm) { + PascalString policyId, + PascalString userName, + PascalByteString password, + PascalString encryptionAlgorithm) { super(); + this.policyId = policyId; this.userName = userName; this.password = password; this.encryptionAlgorithm = encryptionAlgorithm; } + public PascalString getPolicyId() { + return policyId; + } + public PascalString getUserName() { return userName; } @@ -68,12 +77,15 @@ public PascalString getEncryptionAlgorithm() { } @Override - protected void serializeUserIdentityTokenDefinitionChild(WriteBuffer writeBuffer) + protected void serializeExtensionObjectDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { PositionAware positionAware = writeBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); writeBuffer.pushContext("UserNameIdentityToken"); + // Simple Field (policyId) + writeSimpleField("policyId", policyId, new DataWriterComplexDefault<>(writeBuffer)); + // Simple Field (userName) writeSimpleField("userName", userName, new DataWriterComplexDefault<>(writeBuffer)); @@ -98,6 +110,9 @@ public int getLengthInBits() { UserNameIdentityToken _value = this; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + // Simple field (policyId) + lengthInBits += policyId.getLengthInBits(); + // Simple field (userName) lengthInBits += userName.getLengthInBits(); @@ -110,12 +125,17 @@ public int getLengthInBits() { return lengthInBits; } - public static UserIdentityTokenDefinitionBuilder staticParseUserIdentityTokenDefinitionBuilder( - ReadBuffer readBuffer, String identifier) throws ParseException { + public static ExtensionObjectDefinitionBuilder staticParseExtensionObjectDefinitionBuilder( + ReadBuffer readBuffer, Integer extensionId) throws ParseException { readBuffer.pullContext("UserNameIdentityToken"); PositionAware positionAware = readBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + PascalString policyId = + readSimpleField( + "policyId", + new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer)); + PascalString userName = readSimpleField( "userName", @@ -134,17 +154,22 @@ public static UserIdentityTokenDefinitionBuilder staticParseUserIdentityTokenDef readBuffer.closeContext("UserNameIdentityToken"); // Create the instance - return new UserNameIdentityTokenBuilderImpl(userName, password, encryptionAlgorithm); + return new UserNameIdentityTokenBuilderImpl(policyId, userName, password, encryptionAlgorithm); } public static class UserNameIdentityTokenBuilderImpl - implements UserIdentityTokenDefinition.UserIdentityTokenDefinitionBuilder { + implements ExtensionObjectDefinition.ExtensionObjectDefinitionBuilder { + private final PascalString policyId; private final PascalString userName; private final PascalByteString password; private final PascalString encryptionAlgorithm; public UserNameIdentityTokenBuilderImpl( - PascalString userName, PascalByteString password, PascalString encryptionAlgorithm) { + PascalString policyId, + PascalString userName, + PascalByteString password, + PascalString encryptionAlgorithm) { + this.policyId = policyId; this.userName = userName; this.password = password; this.encryptionAlgorithm = encryptionAlgorithm; @@ -152,7 +177,7 @@ public UserNameIdentityTokenBuilderImpl( public UserNameIdentityToken build() { UserNameIdentityToken userNameIdentityToken = - new UserNameIdentityToken(userName, password, encryptionAlgorithm); + new UserNameIdentityToken(policyId, userName, password, encryptionAlgorithm); return userNameIdentityToken; } } @@ -166,7 +191,8 @@ public boolean equals(Object o) { return false; } UserNameIdentityToken that = (UserNameIdentityToken) o; - return (getUserName() == that.getUserName()) + return (getPolicyId() == that.getPolicyId()) + && (getUserName() == that.getUserName()) && (getPassword() == that.getPassword()) && (getEncryptionAlgorithm() == that.getEncryptionAlgorithm()) && super.equals(that) @@ -175,7 +201,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(super.hashCode(), getUserName(), getPassword(), getEncryptionAlgorithm()); + return Objects.hash( + super.hashCode(), getPolicyId(), getUserName(), getPassword(), getEncryptionAlgorithm()); } @Override diff --git a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/X509IdentityToken.java b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/X509IdentityToken.java index d6148e08e23..2d32d08542a 100644 --- a/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/X509IdentityToken.java +++ b/plc4j/drivers/opcua/src/main/generated/org/apache/plc4x/java/opcua/readwrite/X509IdentityToken.java @@ -35,32 +35,41 @@ // Code generated by code-generation. DO NOT EDIT. -public class X509IdentityToken extends UserIdentityTokenDefinition implements Message { +public class X509IdentityToken extends ExtensionObjectDefinition implements Message { // Accessors for discriminator values. - public String getIdentifier() { - return (String) "certificate"; + public Integer getExtensionId() { + return (int) 327; } // Properties. + protected final PascalString policyId; protected final PascalByteString certificateData; - public X509IdentityToken(PascalByteString certificateData) { + public X509IdentityToken(PascalString policyId, PascalByteString certificateData) { super(); + this.policyId = policyId; this.certificateData = certificateData; } + public PascalString getPolicyId() { + return policyId; + } + public PascalByteString getCertificateData() { return certificateData; } @Override - protected void serializeUserIdentityTokenDefinitionChild(WriteBuffer writeBuffer) + protected void serializeExtensionObjectDefinitionChild(WriteBuffer writeBuffer) throws SerializationException { PositionAware positionAware = writeBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); writeBuffer.pushContext("X509IdentityToken"); + // Simple Field (policyId) + writeSimpleField("policyId", policyId, new DataWriterComplexDefault<>(writeBuffer)); + // Simple Field (certificateData) writeSimpleField( "certificateData", certificateData, new DataWriterComplexDefault<>(writeBuffer)); @@ -79,18 +88,26 @@ public int getLengthInBits() { X509IdentityToken _value = this; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + // Simple field (policyId) + lengthInBits += policyId.getLengthInBits(); + // Simple field (certificateData) lengthInBits += certificateData.getLengthInBits(); return lengthInBits; } - public static UserIdentityTokenDefinitionBuilder staticParseUserIdentityTokenDefinitionBuilder( - ReadBuffer readBuffer, String identifier) throws ParseException { + public static ExtensionObjectDefinitionBuilder staticParseExtensionObjectDefinitionBuilder( + ReadBuffer readBuffer, Integer extensionId) throws ParseException { readBuffer.pullContext("X509IdentityToken"); PositionAware positionAware = readBuffer; boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + PascalString policyId = + readSimpleField( + "policyId", + new DataReaderComplexDefault<>(() -> PascalString.staticParse(readBuffer), readBuffer)); + PascalByteString certificateData = readSimpleField( "certificateData", @@ -99,19 +116,21 @@ public static UserIdentityTokenDefinitionBuilder staticParseUserIdentityTokenDef readBuffer.closeContext("X509IdentityToken"); // Create the instance - return new X509IdentityTokenBuilderImpl(certificateData); + return new X509IdentityTokenBuilderImpl(policyId, certificateData); } public static class X509IdentityTokenBuilderImpl - implements UserIdentityTokenDefinition.UserIdentityTokenDefinitionBuilder { + implements ExtensionObjectDefinition.ExtensionObjectDefinitionBuilder { + private final PascalString policyId; private final PascalByteString certificateData; - public X509IdentityTokenBuilderImpl(PascalByteString certificateData) { + public X509IdentityTokenBuilderImpl(PascalString policyId, PascalByteString certificateData) { + this.policyId = policyId; this.certificateData = certificateData; } public X509IdentityToken build() { - X509IdentityToken x509IdentityToken = new X509IdentityToken(certificateData); + X509IdentityToken x509IdentityToken = new X509IdentityToken(policyId, certificateData); return x509IdentityToken; } } @@ -125,12 +144,15 @@ public boolean equals(Object o) { return false; } X509IdentityToken that = (X509IdentityToken) o; - return (getCertificateData() == that.getCertificateData()) && super.equals(that) && true; + return (getPolicyId() == that.getPolicyId()) + && (getCertificateData() == that.getCertificateData()) + && super.equals(that) + && true; } @Override public int hashCode() { - return Objects.hash(super.hashCode(), getCertificateData()); + return Objects.hash(super.hashCode(), getPolicyId(), getCertificateData()); } @Override