Package io.fathom.cloud.openstack.client.dns.model

Examples of io.fathom.cloud.openstack.client.dns.model.Record


    }

    static Record toModel(DnsRecord record) {
        DnsRecordData data = record.getData();

        Record model = new Record();
        if (data.hasTarget()) {
            model.value = data.getTarget();
        }
        if (data.hasWeight()) {
            model.weight = data.getWeight();
View Full Code Here


                recordset.ttl = awsRecordset.getTTL();
                recordset.weight = awsRecordset.getWeight();
                recordset.records = Lists.newArrayList();
                for (ResourceRecord awsRR : awsRecordset.getResourceRecords()) {
                    Record rr = new Record();
                    rr.value = awsRR.getValue();
                    if (rr.value.contains(" ")) {
                        List<String> tokens = Splitter.on(' ').splitToList(rr.value);

                        if (recordset.type.equals("SOA") && tokens.size() == 7) {
View Full Code Here

                    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);
                }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.openstack.client.dns.model.Record

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.