Search in sources :

Example 21 with DnsRecord

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);
}
Also used : DnsRecord(org.nhind.config.DnsRecord) Command(org.nhindirect.dns.tools.utils.Command)

Example 22 with DnsRecord

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);
}
Also used : DnsRecord(org.nhind.config.DnsRecord)

Example 23 with 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-------------------------------------------");
        }
    }
}
Also used : DnsRecord(org.nhind.config.DnsRecord)

Example 24 with DnsRecord

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);
}
Also used : DnsRecord(org.nhind.config.DnsRecord) Command(org.nhindirect.dns.tools.utils.Command)

Example 25 with DnsRecord

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);
}
Also used : DnsRecord(org.nhind.config.DnsRecord) Command(org.nhindirect.dns.tools.utils.Command)

Aggregations

DnsRecord (org.nhind.config.DnsRecord)32 Command (org.nhindirect.dns.tools.utils.Command)14 Record (org.xbill.DNS.Record)7 ArrayList (java.util.ArrayList)6 RemoteException (java.rmi.RemoteException)4 CertificateConversionException (org.nhindirect.config.model.exceptions.CertificateConversionException)3 CERTRecord (org.xbill.DNS.CERTRecord)3 SOARecord (org.xbill.DNS.SOARecord)3 File (java.io.File)2 List (java.util.List)2 Matcher (java.util.regex.Matcher)2 Pattern (java.util.regex.Pattern)2 BaseTestPlan (org.nhindirect.dns.util.BaseTestPlan)2 ARecord (org.xbill.DNS.ARecord)2 MXRecord (org.xbill.DNS.MXRecord)2 Test (org.junit.Test)1 ConfigurationServiceProxy (org.nhind.config.ConfigurationServiceProxy)1 DNSRecord (org.nhindirect.config.store.DNSRecord)1 RRset (org.xbill.DNS.RRset)1