Package io.fathom.cloud.dns.model

Examples of io.fathom.cloud.dns.model.DnsZone


    @Override
    public List<DnsZone> listZones(Project project) throws CloudException {
        List<DnsZone> records = Lists.newArrayList();
        for (DnsZoneData data : repository.getDnsZones(project.getId()).list()) {
            DnsZone record = new DnsZone(data);
            records.add(record);
        }
        return records;
    }
View Full Code Here


            data.setBackendId(backendId);
        }

        DnsZoneData created = repository.getDnsZones(project.getId()).create(data);

        DnsZone dnsDomain = new DnsZone(created);
        backend.updateDomain(project, dnsDomain);
        return dnsDomain;
    }
View Full Code Here

        NumberedItemCollection<DnsZoneData> dnsDomains = repository.getDnsZones(project.getId());
        DnsZoneData data = dnsDomains.findByKey(zoneName);
        if (data == null) {
            return null;
        }
        return new DnsZone(data);
    }
View Full Code Here

    public DnsZone findDomain(Project project, long id) throws CloudException {
        DnsZoneData data = repository.getDnsZones(project.getId()).find(id);
        if (data == null) {
            return null;
        }
        return new DnsZone(data);
    }
View Full Code Here

            // String name = findHost(recordset.fqdn, domainName);

            DnsZoneSpec zoneSpec = new DnsZoneSpec();
            zoneSpec.name = domainName;

            DnsZone zone = findOrCreateDomain(project, zoneSpec);

            DnsRecordsetData.Builder data = DnsRecordsetData.newBuilder();
            data.setProjectId(project.getId());

            for (DnsRecordSpec record : recordsetSpec.records) {
                // Sanity check
                InetAddress address = InetAddresses.forString(record.address);
                String ip = InetAddresses.toAddrString(address);

                DnsRecordData.Builder recordBuilder = data.addRecordBuilder();
                recordBuilder.setTarget(ip);
            }

            data.setType(recordsetSpec.type);
            data.setFqdn(recordsetSpec.fqdn);
            data.setZoneId(zone.getId());
            data.setSystemKey(systemKey);

            recordsets.add(data.build());
        }
View Full Code Here

                dirtyDomains.add(r.getZoneId());
            }
        }

        for (Long domainId : dirtyDomains) {
            DnsZone zone = findDomain(project, domainId);

            DnsBackend backend = findBackend(zone);

            backend.updateDomain(project, zone);
        }
View Full Code Here

            backend.updateDomain(project, zone);
        }
    }

    private DnsZone findOrCreateDomain(Project project, DnsZoneSpec zoneSpec) throws CloudException {
        DnsZone zone = findZoneByName(project, zoneSpec.name);

        if (zone == null) {
            try {
                zone = createZone(project, zoneSpec);
            } catch (DuplicateValueException e) {
View Full Code Here

                return null;
            }

            DnsZoneData data = store.findByKey(name);
            if (data != null) {
                return new DnsZone(data);
            }

            int dotIndex = name.indexOf('.');
            if (dotIndex == -1) {
                return null;
View Full Code Here

TOP

Related Classes of io.fathom.cloud.dns.model.DnsZone

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.