예제 #1
0
 private int addObject(final RpslObject rpslObject) {
   databaseHelper.addObject(
       "inet-rtr: " + rpslObject.findAttribute(AttributeType.INET_RTR).getValue());
   final int objectId = getObjectId(rpslObject);
   final long ifAddr = Ipv4Resource.parse(getIfAddrAttributeAsString(rpslObject)).begin();
   whoisTemplate.update("INSERT INTO ifaddr (object_id, ifaddr) VALUES (?, ?)", objectId, ifAddr);
   return objectId;
 }
예제 #2
0
 private String getIfAddrAttributeAsString(final RpslObject rpslObject) {
   return rpslObject.findAttribute(AttributeType.IFADDR).getCleanValue().toString().split(" ")[0];
 }