- All Implemented Interfaces:
MasterService
- Author:
- AO Industries, Inc.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDnsZone
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, Account.Name packageName, String zone, InetAddress ip, int ttl) Creates a newZone
.int
addRecord
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, String zone, String domain, String type, int priority, int weight, int port, short flag, String tag, String destination, int ttl) Creates a newRecord
.boolean
canAccessDnsZone
(DatabaseConnection conn, RequestSource source, String zone) Gets the contents of thedns.TopLevelDomain
table.void
invalidateTable
(Table.TableId tableId) boolean
isDnsZoneAvailable
(DatabaseConnection conn, String zone) void
removeDnsZone
(DatabaseConnection conn, InvalidateList invalidateList, String zone) Removes aZone
.void
removeDnsZone
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, String zone) Removes aZone
.void
removeRecord
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int recordId) Removes aRecord
.void
removeUnusedDnsRecord
(DatabaseConnection conn, InvalidateList invalidateList, DomainName hostname, List<DomainName> tlds) void
setDnsZoneTtl
(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, String zone, int ttl) Sets the default TTL for aZone
.void
updateDhcpDnsRecords
(DatabaseConnection conn, InvalidateList invalidateList, int dhcpAddress, InetAddress destination) void
updateReverseDnsIfExists
(DatabaseConnection conn, InvalidateList invalidateList, InetAddress ip, DomainName hostname) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.aoindustries.aoserv.master.MasterService
start, startGetObjectHandler, startGetObjectHandlers, startGetTableHandler, startGetTableHandlers
-
Constructor Details
-
DnsService
public DnsService()
-
-
Method Details
-
addRecord
public int addRecord(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, String zone, String domain, String type, int priority, int weight, int port, short flag, String tag, String destination, int ttl) throws IOException, SQLException Creates a newRecord
.- Throws:
IOException
SQLException
-
addDnsZone
public void addDnsZone(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, Account.Name packageName, String zone, InetAddress ip, int ttl) throws IOException, SQLException Creates a newZone
.- Throws:
IOException
SQLException
-
removeRecord
public void removeRecord(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, int recordId) throws IOException, SQLException Removes aRecord
.- Throws:
IOException
SQLException
-
removeDnsZone
public void removeDnsZone(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, String zone) throws IOException, SQLException Removes aZone
.- Throws:
IOException
SQLException
-
removeDnsZone
public void removeDnsZone(DatabaseConnection conn, InvalidateList invalidateList, String zone) throws IOException, SQLException Removes aZone
.- Throws:
IOException
SQLException
-
canAccessDnsZone
public boolean canAccessDnsZone(DatabaseConnection conn, RequestSource source, String zone) throws IOException, SQLException - Throws:
IOException
SQLException
-
getTopLevelDomains
public List<DomainName> getTopLevelDomains(DatabaseConnection conn) throws IOException, SQLException Gets the contents of thedns.TopLevelDomain
table. Please note that these are only our manually configured entries, and do not contain the full list fromTopLevelDomain
.Also, this is a list of effective top-level domains, for the purposes of domain allocation. This means it includes things like
com.au
, whereas theTopLevelDomain
only includesau
.TODO: Automatically maintain this list from the
TopLevelDomain
source, with an "auto" flag. Add/remove as-needed when auto.TODO: Have a flag "isRegistrable" that enables/disables a domain as being allowed for use by clients. Something marked isRegistrable and auto should never be removed? Instead of removing auto entries, have a "removed" timestamp showing when it no longer exists?
TODO: Allow a comment on each entry, too.
TODO: This could replace ForbiddenZones by adding more specific entries, and marking as isRegistrable=false?
- Throws:
IOException
SQLException
-
isDnsZoneAvailable
public boolean isDnsZoneAvailable(DatabaseConnection conn, String zone) throws IOException, SQLException - Throws:
IOException
SQLException
-
invalidateTable
-
removeUnusedDnsRecord
public void removeUnusedDnsRecord(DatabaseConnection conn, InvalidateList invalidateList, DomainName hostname, List<DomainName> tlds) throws IOException, SQLException - Throws:
IOException
SQLException
-
setDnsZoneTtl
public void setDnsZoneTtl(DatabaseConnection conn, RequestSource source, InvalidateList invalidateList, String zone, int ttl) throws IOException, SQLException Sets the default TTL for aZone
.- Throws:
IOException
SQLException
-
updateDhcpDnsRecords
public void updateDhcpDnsRecords(DatabaseConnection conn, InvalidateList invalidateList, int dhcpAddress, InetAddress destination) throws IOException, SQLException - Throws:
IOException
SQLException
-
updateReverseDnsIfExists
public void updateReverseDnsIfExists(DatabaseConnection conn, InvalidateList invalidateList, InetAddress ip, DomainName hostname) throws IOException, SQLException - Throws:
IOException
SQLException
-