hasSoa = true;
}
r.records = Lists.newArrayList();
for (DnsRecord dnsRecord : recordset.getRecords()) {
Record record = new Record();
DnsRecordData recordData = dnsRecord.getData();
record.value = recordData.getTarget();
if (recordData.hasWeight()) {
record.weight = recordData.getWeight();
}
if (recordData.hasPort()) {
record.port = recordData.getPort();
}
if (recordData.hasPriority()) {
record.priority = recordData.getPriority();
}
r.records.add(record);
}
recordsets.add(r);
}
if (createSoa && !hasSoa) {
Recordset r = new Recordset();
r.name = zoneName;
// primary hostmaster serial refresh retry expire default_ttl
String primary = "ns." + zoneName;
String hostmaster = "hostmaster@" + zoneName;
String serial = Long.toString(System.currentTimeMillis() / 1000L);
int refresh = 7200;
int retry = 900;
int expire = 1209600;
int defaultTtl = 86400;
r.records = Lists.newArrayList();
{
Record record = new Record();
record.value = primary + " " + hostmaster + " " + serial + " " + refresh + " " + retry + " "
+ expire + " " + defaultTtl;
r.records.add(record);
}