Open TheRedTrainer opened 7 years ago
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.