You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a ip address is loaded from database (according to mx.nic.rdap.sql.objects.IpAddressDbObj.java class), all the data is setted with db values, except the internet address type as it is showed in the following method loadFromDatabase:
public void loadFromDatabase(ResultSet resultSet) throws SQLException {
this.setId(resultSet.getLong("iad_id"));
this.setNameserverId(resultSet.getLong("nse_id"));
try {
this.setAddress(InetAddress.getByName(resultSet.getString("iad_value")));
} catch (UnknownHostException e) {
// The address is validate in the store process,so this exception
// will never be throw.
}
if (this.getAddress() instanceof Inet4Address) {
this.setType(4);
} else if (this.getAddress() instanceof Inet6Address) {
this.setType(6);
}
}
Ip Address type attribute is setted in a validation of the instance of inet address, but the iad_type value from db is never accessed. It is necessary to obtain the ip address type from db and, if it is necessary, validate it with the instance of inet address, in order to confirm or throw an exception.
The text was updated successfully, but these errors were encountered:
When the object IpAddress is loaded as a property of a nameserver object, it is not critical to load the column "iad_type" from the database.
The column "iad_type" is used when a partial search is requested (more specific, at the /nameservers/nsIp=XXX request), with this column is easier to search only information of that kind of IP version, and do not perform a full table scan. As our project RDAP does not store data in the database, the project do not have control if the iad_type and the value of the IP match when performing a search.
In conclusion, the column "iad_type" is useful as a filter when the user requests a search.
Verified and agreed. However, talking about with @pcarana , it could be an enhancement to add comments related to that fact to the code, scripts and web site, in order to explain this behaviour that could be misunderstood by other developers. This issue will be closed and a new enhancement will be reported to explain the situation.
When a ip address is loaded from database (according to mx.nic.rdap.sql.objects.IpAddressDbObj.java class), all the data is setted with db values, except the internet address type as it is showed in the following method loadFromDatabase:
Ip Address type attribute is setted in a validation of the instance of inet address, but the iad_type value from db is never accessed. It is necessary to obtain the ip address type from db and, if it is necessary, validate it with the instance of inet address, in order to confirm or throw an exception.
The text was updated successfully, but these errors were encountered: