use of org.nhind.config.DnsRecord in project nhin-d by DirectProject.
the class DNSRecordCommands method addANAME.
/**
* Adds an A records to the configuration service.
* @param args Contains the A record attributes.
*
* @since 1.0
*/
@Command(name = "Dns_ANAME_Add", usage = ADD_ANAME_USAGE)
public void addANAME(String[] args) {
DnsRecord record = fromRecord(parser.parseANAME(args));
addDNS(record);
}
use of org.nhind.config.DnsRecord in project nhin-d by DirectProject.
the class DNSRecordCommands method importRecord.
/*
* Imports a specific DNS record type from a file.
*/
private void importRecord(String path, int type) {
DnsRecord dnsRecord = loadAndVerifyDnsRecordFromBin(path);
if (dnsRecord.getType() != type) {
throw new IllegalArgumentException("File " + path + " does not contain the requested record type");
}
addDNS(dnsRecord);
}
use of org.nhind.config.DnsRecord in project nhin-d by DirectProject.
the class DNSRecordCommands method print.
/*
* prints the contents of an array of records
*/
private void print(DnsRecord[] records) {
if (records != null) {
for (DnsRecord record : records) {
print(record);
System.out.println("\r\n-------------------------------------------");
}
}
}
use of org.nhind.config.DnsRecord in project nhin-d by DirectProject.
the class DNSRecordCommands method ensureMX.
/**
* Adds an MX records to the configuration service only if the record does not exist.
* @param args Contains the MX record attributes.
*
* @since 1.0
*/
@Command(name = "Dns_MX_Ensure", usage = ENSURE_MX_USAGE)
public void ensureMX(String[] args) {
DnsRecord record = fromRecord(parser.parseMX(args));
if (!verifyIsUnique(record, false)) {
return;
}
addDNS(record);
}
use of org.nhind.config.DnsRecord in project nhin-d by DirectProject.
the class DNSRecordCommands method ensureANAME.
/**
* Adds an A records to the configuration service only if the record does not exist.
* @param args Contains the A record attributes.
*
* @since 1.0
*/
@Command(name = "Dns_ANAME_Ensure", usage = ENSURE_ANAME_USAGE)
public void ensureANAME(String[] args) {
DnsRecord record = fromRecord(parser.parseANAME(args));
if (!verifyIsUnique(record, false)) {
return;
}
addDNS(record);
}
Aggregations