Skip to content

Commit

Permalink
Removed RVInfoDeseriializer validation checking
Browse files Browse the repository at this point in the history
Signed-off-by: adarsh-intel <[email protected]>
  • Loading branch information
adarshan-intel committed Nov 13, 2023
1 parent a8e1e4d commit cd8d297
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,13 @@ private byte[] getSubValue(RendezvousVariable variable, JsonNode subNode)
case WIFI_SSID:
case WIFI_PW:
case DNS:
if (subNode.isNull()) {
throw new InvalidMessageException("expecting rv dns value");
}
return Mapper.INSTANCE.writeValue(subNode.textValue());
case IP_ADDRESS:
return Mapper.INSTANCE.writeValue(
InetAddress.getByName(subNode.textValue()).getAddress());
case OWNER_PORT:
if (subNode.isNull()) {
throw new InvalidMessageException("expecting rv owner port value");
}
return Mapper.INSTANCE.writeValue(subNode.intValue());
case DEV_PORT:
if (subNode.isNull()) {
throw new InvalidMessageException("expecting rv dev port value");
}
return Mapper.INSTANCE.writeValue(subNode.intValue());
case PROTOCOL:
if (subNode.isNull() || subNode.intValue() < 1 || subNode.intValue() > 2) {
throw new InvalidMessageException("expecting rv protocol value 1 or 2");
}
return Mapper.INSTANCE.writeValue(subNode.intValue());
case MEDIUM:
case DELAYSEC:
return Mapper.INSTANCE.writeValue(subNode.intValue());
Expand Down Expand Up @@ -104,7 +89,7 @@ public RendezvousInstruction deserialize(JsonParser jp, DeserializationContext c
rvi.setValue(getSubValue(variable, subNode));
}
}
// now check
//now check

return rvi;
}
Expand Down

0 comments on commit cd8d297

Please sign in to comment.