Skip to content

Commit

Permalink
Checkin of generated contents.
Browse files Browse the repository at this point in the history
Signed-off-by: Łukasz Dywicki <[email protected]>
  • Loading branch information
splatch committed Aug 23, 2024
1 parent e28bd63 commit fa105b4
Show file tree
Hide file tree
Showing 15 changed files with 233 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand All @@ -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;
}
}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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));

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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));

Expand All @@ -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();

Expand All @@ -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",
Expand All @@ -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;
}
}
Expand All @@ -146,15 +166,16 @@ 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;
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), getTokenData(), getEncryptionAlgorithm());
return Objects.hash(super.hashCode(), getPolicyId(), getTokenData(), getEncryptionAlgorithm());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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");
}

Expand All @@ -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;
}

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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");
}

Expand All @@ -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;
}

Expand All @@ -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
Expand Down
Loading

0 comments on commit fa105b4

Please sign in to comment.