|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.sagestudio.jh2n.jh2n
JH2N - A java host to name server converter.
A java replacement/enhancement of the perl program of the same name.
It does operate in a slightly different manner then the original h2n, as this
version was written to support the many virtual domains found at an ISP.
The -d option is not meaningfull, as this h2n assumes that every domain
found in the host file is to have SOA records built.
This version takes many of the same arguments as the original h2n.
To make jh2n work properly, first create an instance, passing any command line args
as a string array.
Next use the readHostFile method to have it read the input file and
build all the internal structures
Next use the writeFiles method to get it to create the named.boot file,
as well as all the db resource record files.
| Field Summary | |
java.lang.String |
copyright
|
| Constructor Summary | |
jh2n(java.lang.String[] args)
Constructors |
|
| Method Summary | |
static void |
main(java.lang.String[] args)
Main method is used to allow this class to run stand-alone |
java.lang.String |
printAliases()
prints all the entries in the hostHash |
void |
printFooter(java.io.PrintWriter printout,
java.lang.String domain)
prints the $INCLUDE directive at the bottom of the db files |
void |
printGNUGPL()
|
void |
printHeader(java.io.PrintWriter printout,
java.lang.String domain)
Used to write the SOA and NS records to the db files Note that the serial number is generated using the current date/time in the form YYYYmmDDnn where nn is a unique number incremented every 15 minutes |
java.lang.String |
printHosts()
prints all the entries in the hostHash |
boolean |
testForDomain(java.lang.String junk)
tests to see if a given domain is supposed to be processed returns false if its in the list of ignored domains |
boolean |
testForNetwork(java.lang.String junk)
tests to see if a given network is in the list of accepted networks |
boolean |
testNetworkAddress(java.lang.String address)
|
void |
writeBoot(java.lang.String outfile,
java.lang.String primaryServer,
boolean savefile)
writeBoot creates the named.boot file parameters are the output file boolean indicating primary or secondary String indicating a folder to prepend to the files, if the string is null, then don't save the files if the string is empty, then don't prepend anything if the string contains something, then prepend the filenames with the string (note that the string should only be passwd for secondary files, not primaries) |
void |
writeDomainList(java.lang.String outfile)
|
void |
writeHostPrefixList(java.lang.String prefix,
java.lang.String outfile)
write the list of hosts with passed prefix but that are on a controlled network! |
void |
writeRR(java.lang.String domain)
|
void |
writeRRAll()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public java.lang.String copyright
| Constructor Detail |
public jh2n(java.lang.String[] args)
| Method Detail |
public static void main(java.lang.String[] args)
public void writeBoot(java.lang.String outfile,
java.lang.String primaryServer,
boolean savefile)
public boolean testForNetwork(java.lang.String junk)
public boolean testForDomain(java.lang.String junk)
public boolean testNetworkAddress(java.lang.String address)
public void writeRRAll()
public void writeRR(java.lang.String domain)
public void writeDomainList(java.lang.String outfile)
public void writeHostPrefixList(java.lang.String prefix,
java.lang.String outfile)
public void printHeader(java.io.PrintWriter printout,
java.lang.String domain)
public void printFooter(java.io.PrintWriter printout,
java.lang.String domain)
public java.lang.String printHosts()
public java.lang.String printAliases()
public void printGNUGPL()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||