- java.lang.Object
-
- com.aoindustries.aoserv.client.AOServObject<K,T>
-
- com.aoindustries.aoserv.client.CachedObject<String,V>
-
- com.aoindustries.aoserv.client.CachedObjectStringKey<Zone>
-
- com.aoindustries.aoserv.client.dns.Zone
-
- All Implemented Interfaces:
Streamable,StreamReadable,StreamWritable,Row,AOServReadable,AOServStreamable,AOServWritable,Dumpable,Removable,SingleTableObject<String,Zone>
public final class Zone extends CachedObjectStringKey<Zone> implements Removable, Dumpable
ADNSZoneis one domain hosted in the name servers. It can have any number ofDNSRecords. Please seeDNSTLDfor domain restrictions.- Author:
- AO Industries, Inc.
- See Also:
TopLevelDomain,Record
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPI_ZONEThe zone that is in charge of the API.static StringDEFAULT_HOSTMASTERThe hostmaster that is placed in a newly createdDNSZone.static intDEFAULT_MX_PRIORITYThe default priority for new MX records.static intDEFAULT_TTLstatic intMAX_LINE_LENGTHThe maximum number of characters allowed in a line.-
Fields inherited from class com.aoindustries.aoserv.client.CachedObjectStringKey
pkey
-
Fields inherited from class com.aoindustries.aoserv.client.CachedObject
table
-
Fields inherited from class com.aoindustries.aoserv.client.AOServObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE
-
-
Constructor Summary
Constructors Constructor Description Zone()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddDNSRecord(String domain, RecordType type, int priority, int weight, int port, String destination, int ttl)voiddump(PrintWriter out)Dumps the contents of this object into aWriterRecordType[]getAllowedDNSTypes()static StringgetArpaZoneForIPAddress(InetAddress ip, String netmask)List<CannotRemoveReason<Zone>>getCannotRemoveReasons()Lists the reasons an object may not be removed.protected ObjectgetColumnImpl(int i)static longgetCurrentSerial()List<Record>getDNSRecords()List<Record>getDNSRecords(String domain, RecordType type)StringgetFile()StringgetHostmaster()PackagegetPackage()longgetSerial()Table.TableIDgetTableID()intgetTTL()StringgetZone()StringgetZoneFile()voidinit(ResultSet result)Initializes this object from the raw database contents.booleanisArpa()voidprintZoneFile(PrintWriter out)voidread(StreamableInput in, AoservProtocol.Version protocolVersion)voidremove()Removes this object, and all dependant objects, from the system.voidsetTTL(int ttl)voidwrite(StreamableOutput out, AoservProtocol.Version protocolVersion)-
Methods inherited from class com.aoindustries.aoserv.client.CachedObjectStringKey
equals, getKey, hashCode, toStringImpl
-
Methods inherited from class com.aoindustries.aoserv.client.CachedObject
getTable, setTable
-
Methods inherited from class com.aoindustries.aoserv.client.AOServObject
compare, compare, compare, compare, compareIgnoreCaseConsistentWithEquals, compareTo, compareTo, compareTo, getAccountingCode, getColumn, getColumns, getColumns, getDomainLabel, getDomainLabels, getDomainName, getDto, getEmail, getGecos, getGroupId, getHashedKey, getHashedPassword, getHostname, getInetAddress, getLinuxID, getLinuxUserName, getMacAddress, getMySQLDatabaseName, getMySQLServerName, getMysqlUserName, getPort, getPostgresDatabaseName, getPostgresServerName, getPostgresUserId, getTableSchema, getTimeMillis, getTimeMillis, getUnixPath, getUserId, read, toString, write
-
-
-
-
Field Detail
-
DEFAULT_TTL
public static final int DEFAULT_TTL
- See Also:
- Constant Field Values
-
MAX_LINE_LENGTH
public static final int MAX_LINE_LENGTH
The maximum number of characters allowed in a line.- See Also:
- Constant Field Values
-
API_ZONE
public static final String API_ZONE
The zone that is in charge of the API.- See Also:
- Constant Field Values
-
DEFAULT_HOSTMASTER
public static final String DEFAULT_HOSTMASTER
The hostmaster that is placed in a newly createdDNSZone.- See Also:
- Constant Field Values
-
DEFAULT_MX_PRIORITY
public static final int DEFAULT_MX_PRIORITY
The default priority for new MX records.- See Also:
- Constant Field Values
-
-
Method Detail
-
addDNSRecord
public int addDNSRecord(String domain, RecordType type, int priority, int weight, int port, String destination, int ttl) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
dump
public void dump(PrintWriter out) throws SQLException, IOException
Description copied from interface:DumpableDumps the contents of this object into aWriter- Specified by:
dumpin interfaceDumpable- Throws:
SQLExceptionIOException
-
getAllowedDNSTypes
public RecordType[] getAllowedDNSTypes() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getArpaZoneForIPAddress
public static String getArpaZoneForIPAddress(InetAddress ip, String netmask) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getColumnImpl
protected Object getColumnImpl(int i)
- Specified by:
getColumnImplin classAOServObject<String,Zone>
-
getCurrentSerial
public static long getCurrentSerial()
-
getDNSRecords
public List<Record> getDNSRecords() throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getDNSRecords
public List<Record> getDNSRecords(String domain, RecordType type) throws IOException, SQLException
- Throws:
IOExceptionSQLException
-
getFile
public String getFile()
-
getHostmaster
public String getHostmaster()
-
getPackage
public Package getPackage() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getSerial
public long getSerial()
-
getTTL
public int getTTL()
-
getTableID
public Table.TableID getTableID()
- Specified by:
getTableIDin classAOServObject<String,Zone>
-
getZone
public String getZone()
-
getZoneFile
public String getZoneFile() throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
init
public void init(ResultSet result) throws SQLException
Description copied from class:AOServObjectInitializes this object from the raw database contents.- Specified by:
initin classAOServObject<String,Zone>- Parameters:
result- theResultSetcontaining the row to copy into this object- Throws:
SQLException
-
isArpa
public boolean isArpa()
-
printZoneFile
public void printZoneFile(PrintWriter out) throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
read
public void read(StreamableInput in, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
readin interfaceAOServReadable- Specified by:
readin interfaceAOServStreamable- Specified by:
readin classAOServObject<String,Zone>- Throws:
IOException
-
getCannotRemoveReasons
public List<CannotRemoveReason<Zone>> getCannotRemoveReasons()
Description copied from interface:RemovableLists the reasons an object may not be removed.- Specified by:
getCannotRemoveReasonsin interfaceRemovable- Returns:
- an empty
List<CannotRemoveReason>if this object may be removed, or a list of descriptions
-
remove
public void remove() throws IOException, SQLExceptionDescription copied from interface:RemovableRemoves this object, and all dependant objects, from the system.- Specified by:
removein interfaceRemovable- Throws:
IOExceptionSQLException
-
setTTL
public void setTTL(int ttl) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
write
public void write(StreamableOutput out, AoservProtocol.Version protocolVersion) throws IOException
- Specified by:
writein interfaceAOServStreamable- Specified by:
writein interfaceAOServWritable- Specified by:
writein classAOServObject<String,Zone>- Throws:
IOException
-
-