Esempio n. 1
0
 /**
  * Creates an A Record from the given data
  *
  * @param address The address that the name refers to
  */
 public ARecord(Name name, int dclass, long ttl, InetAddress address) {
   super(name, Type.A, dclass, ttl);
   if (Address.familyOf(address) != Address.IPv4)
     throw new IllegalArgumentException("invalid IPv4 address");
   addr = fromArray(address.getAddress());
 }
Esempio n. 2
0
 /**
  * Creates an AAAA Record from the given data
  *
  * @param address The address suffix
  */
 public AAAARecord(Name name, int dclass, long ttl, InetAddress address) {
   super(name, Type.AAAA, dclass, ttl);
   if (Address.familyOf(address) != Address.IPv6)
     throw new IllegalArgumentException("invalid IPv6 address");
   this.address = address.getAddress();
 }