Package org.xbill.DNS
Class Master
java.lang.Object
org.xbill.DNS.Master
- All Implemented Interfaces:
AutoCloseable
A DNS master file parser. This incrementally parses the file, returning one record at a time.
When directives are seen, they are added to the state and used when parsing future records.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMaster(InputStream in) Initializes the master file reader.Master(InputStream in, Name origin) Initializes the master file reader.Master(InputStream in, Name origin, long ttl) Initializes the master file reader.Initializes the master file reader and opens the specified master file.Initializes the master file reader and opens the specified master file.Initializes the master file reader and opens the specified master file. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidDisable processing of $INCLUDE directives.voiddisableIncludes(boolean strict) Disable processing of $INCLUDE directives.private voidvoidexpandGenerate(boolean wantExpand) Specifies whether $GENERATE statements should be expanded.Returns an iterator over the generators specified in the master file; that is, the parsed contents of $GENERATE statements.private RecordReturns the next record in the master file.private RecordReturns the next record in the master file.private Nameprivate voidprivate longprivate void
-
Field Details
-
origin
-
file
-
last
-
defaultTTL
private long defaultTTL -
included
-
st
-
currentType
private int currentType -
currentDClass
private int currentDClass -
currentTTL
private long currentTTL -
needSOATTL
private boolean needSOATTL -
generator
-
generators
-
noExpandGenerate
private boolean noExpandGenerate -
noExpandIncludes
private boolean noExpandIncludes -
includeThrowsException
private boolean includeThrowsException
-
-
Constructor Details
-
Master
Master(File file, Name origin, long initialTTL) throws IOException - Throws:
IOException
-
Master
Initializes the master file reader and opens the specified master file.- Parameters:
filename- The master file.origin- The initial origin to append to relative names.ttl- The initial default TTL.- Throws:
IOException- The master file could not be opened.
-
Master
Initializes the master file reader and opens the specified master file.- Parameters:
filename- The master file.origin- The initial origin to append to relative names.- Throws:
IOException- The master file could not be opened.
-
Master
Initializes the master file reader and opens the specified master file.- Parameters:
filename- The master file.- Throws:
IOException- The master file could not be opened.
-
Master
Initializes the master file reader.- Parameters:
in- The input stream containing a master file.origin- The initial origin to append to relative names.ttl- The initial default TTL.
-
Master
Initializes the master file reader.- Parameters:
in- The input stream containing a master file.origin- The initial origin to append to relative names.
-
Master
Initializes the master file reader.- Parameters:
in- The input stream containing a master file.
-
-
Method Details
-
parseName
- Throws:
TextParseException
-
parseTTLClassAndType
- Throws:
IOException
-
parseUInt32
-
startGenerate
- Throws:
IOException
-
endGenerate
- Throws:
IOException
-
nextGenerated
- Throws:
IOException
-
nextRecordInternal
Returns the next record in the master file. This will process any directives before the next record.- Returns:
- The next record.
- Throws:
IOException- The master file could not be read, or was syntactically invalid.
-
nextRecord
Returns the next record in the master file. This will process any directives before the next record.- Returns:
- The next record.
- Throws:
IOException- The master file could not be read, or was syntactically invalid.
-
disableIncludes
public void disableIncludes()Disable processing of $INCLUDE directives. When disabled, $INCLUDE statements will not be processed. Depending on the contents of the file that would have been included, this may cause the zone to be invalid. (e.g. if there is no SOA or NS at the apex) -
disableIncludes
public void disableIncludes(boolean strict) Disable processing of $INCLUDE directives. When disabled, $INCUDE statements will not be processed. Depending on the contents of the file that would have been included, this may cause the zone to be invalid. (e.g. if there's no SOA or NS at the apex)- Parameters:
strict- If true, an exception will be thrown if $INCLUDE is encountered.
-
expandGenerate
public void expandGenerate(boolean wantExpand) Specifies whether $GENERATE statements should be expanded. Whether expanded or not, the specifications for generated records are available by callinggenerators. This must be called before a $GENERATE statement is seen during iteration to have an effect. -
generators
Returns an iterator over the generators specified in the master file; that is, the parsed contents of $GENERATE statements.- See Also:
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-