本文整理了Java中org.xbill.DNS.ZoneTransferIn.run()
方法的一些代码示例,展示了ZoneTransferIn.run()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneTransferIn.run()
方法的具体详情如下:
包路径:org.xbill.DNS.ZoneTransferIn
类名称:ZoneTransferIn
方法名:run
暂无
代码示例来源:origin: OpenNMS/opennms
@SuppressWarnings("unchecked")
private static List<Record> getRecords(ZoneTransferIn xfer) throws IOException, ZoneTransferException {
return (List<Record>) xfer.run();
}
代码示例来源:origin: dnsjava/dnsjava
/**
* Does the zone transfer.
* @return A list, which is either an AXFR-style response (List of Records),
* and IXFR-style response (List of Deltas), or null, which indicates that
* an IXFR was performed and the zone is up to date.
* @throws IOException The zone transfer failed to due an IO problem.
* @throws ZoneTransferException The zone transfer failed to due a problem
* with the zone transfer itself.
*/
public List
run() throws IOException, ZoneTransferException {
BasicHandler handler = new BasicHandler();
run(handler);
if (handler.axfr != null)
return handler.axfr;
return handler.ixfr;
}
代码示例来源:origin: org.littleshoot/dnsjava
/**
* Does the zone transfer.
* @return A list, which is either an AXFR-style response (List of Records),
* and IXFR-style response (List of Deltas), or null, which indicates that
* an IXFR was performed and the zone is up to date.
* @throws IOException The zone transfer failed to due an IO problem.
* @throws ZoneTransferException The zone transfer failed to due a problem
* with the zone transfer itself.
*/
public List
run() throws IOException, ZoneTransferException {
BasicHandler handler = new BasicHandler();
run(handler);
if (handler.axfr != null)
return handler.axfr;
return handler.ixfr;
}
代码示例来源:origin: tiandawu/IotXmpp
/**
* Does the zone transfer.
* @return A list, which is either an AXFR-style response (List of Records),
* and IXFR-style response (List of Deltas), or null, which indicates that
* an IXFR was performed and the zone is up to date.
* @throws IOException The zone transfer failed to due an IO problem.
* @throws ZoneTransferException The zone transfer failed to due a problem
* with the zone transfer itself.
*/
public List
run() throws IOException, ZoneTransferException {
BasicHandler handler = new BasicHandler();
run(handler);
if (handler.axfr != null)
return handler.axfr;
return handler.ixfr;
}
代码示例来源:origin: LendingClub/mercator
public Optional<List> getRecordsbyZone(String zone) {
Preconditions.checkArgument(!Strings.isNullOrEmpty(zone), "Zone name can not be empty");
ZoneTransferIn xfrin;
try {
xfrin = ZoneTransferIn.newAXFR(new Name(zone), dnsServer, getTSIGKey());
logger.info("Trying a zone transfer from {} for {} zone with {} key", dnsServer, zone, keyName);
return Optional.of(xfrin.run());
} catch (IOException | ZoneTransferException e) {
logger.error("Failed to extract the records for {} zone", zone);
}
return Optional.empty();
}
代码示例来源:origin: tiandawu/IotXmpp
private void
fromXFR(ZoneTransferIn xfrin) throws IOException, ZoneTransferException {
data = new TreeMap();
origin = xfrin.getName();
List records = xfrin.run();
for (Iterator it = records.iterator(); it.hasNext(); ) {
Record record = (Record) it.next();
maybeAddRecord(record);
}
if (!xfrin.isAXFR())
throw new IllegalArgumentException("zones can only be " +
"created from AXFRs");
validate();
}
代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi
private void
fromXFR(ZoneTransferIn xfrin) throws IOException, ZoneTransferException {
data = new HashMap();
type = SECONDARY;
if (!xfrin.isAXFR())
throw new IllegalArgumentException("zones can only be " +
"created from AXFRs");
origin = xfrin.getName();
List records = xfrin.run();
for (Iterator it = records.iterator(); it.hasNext(); ) {
Record record = (Record) it.next();
maybeAddRecord(record);
}
validate();
}
代码示例来源:origin: dnsjava/dnsjava
private void
fromXFR(ZoneTransferIn xfrin) throws IOException, ZoneTransferException {
data = new TreeMap();
origin = xfrin.getName();
List records = xfrin.run();
for (Iterator it = records.iterator(); it.hasNext(); ) {
Record record = (Record) it.next();
maybeAddRecord(record);
}
if (!xfrin.isAXFR())
throw new IllegalArgumentException("zones can only be " +
"created from AXFRs");
validate();
}
代码示例来源:origin: org.littleshoot/dnsjava
private void
fromXFR(ZoneTransferIn xfrin) throws IOException, ZoneTransferException {
data = new TreeMap();
origin = xfrin.getName();
List records = xfrin.run();
for (Iterator it = records.iterator(); it.hasNext(); ) {
Record record = (Record) it.next();
maybeAddRecord(record);
}
if (!xfrin.isAXFR())
throw new IllegalArgumentException("zones can only be " +
"created from AXFRs");
validate();
}
代码示例来源:origin: sensepost/yeti
public static List<ForwardLookupResult> attemptZoneTransfer(String domain, List<ForwardLookupResult> nameServers) throws TextParseException {
List<ForwardLookupResult> result = new ArrayList<>();
ZoneTransferIn xfr;
Iterator i = nameServers.iterator();
for (ForwardLookupResult nameServer : nameServers) {
try {
xfr = ZoneTransferIn.newAXFR(new Name(domain), nameServer.getIpAddress(), null);
List records = xfr.run();
for (Iterator it = records.iterator(); it.hasNext();) {
Record r = (Record) it.next();
if (r.getType() == 1) {
ForwardLookupResult rec = new ForwardLookupResult(domain);
String hostName = ((ARecord) r).getName().toString().toLowerCase();
if (hostName.endsWith(".")) {
hostName = hostName.substring(0, hostName.length() - 1);
}
rec.setHostName(hostName);
rec.setIpAddress(((ARecord) r).getAddress().getHostAddress());
rec.setLookupType("A");
result.add(rec);
}
}
} catch (IOException ioex) {
Logger.getLogger("ForwardLookupHelper.attemptZoneTransfer").log(Level.WARNING, null, ioex);
} catch (ZoneTransferException zex) {
Log.debug("ForwardLookupHelper.attemptZoneTransfer: Failed zonetransfer");
}
}
return result;
}
代码示例来源:origin: org.littleshoot/dnsjava
xfrin = ZoneTransferIn.newAXFR(zname, server, port, key);
List response = xfrin.run();
if (xfrin.isAXFR()) {
if (ixfr_serial >= 0)
代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi
xfrin = ZoneTransferIn.newAXFR(zname, server, port, key);
List response = xfrin.run();
if (xfrin.isAXFR()) {
if (ixfr_serial >= 0)
代码示例来源:origin: tiandawu/IotXmpp
xfrin = ZoneTransferIn.newAXFR(zname, server, port, key);
List response = xfrin.run();
if (xfrin.isAXFR()) {
if (ixfr_serial >= 0)
代码示例来源:origin: dnsjava/dnsjava
private Message
sendAXFR(Message query) throws IOException {
Name qname = query.getQuestion().getName();
ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(qname, address, tsig);
xfrin.setTimeout((int)(getTimeout() / 1000));
xfrin.setLocalAddress(localAddress);
try {
xfrin.run();
}
catch (ZoneTransferException e) {
throw new WireParseException(e.getMessage());
}
List records = xfrin.getAXFR();
Message response = new Message(query.getHeader().getID());
response.getHeader().setFlag(Flags.AA);
response.getHeader().setFlag(Flags.QR);
response.addRecord(query.getQuestion(), Section.QUESTION);
Iterator it = records.iterator();
while (it.hasNext())
response.addRecord((Record)it.next(), Section.ANSWER);
return response;
}
代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi
private Message
sendAXFR(Message query) throws IOException {
Name qname = query.getQuestion().getName();
ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(qname, address, tsig);
xfrin.setTimeout((int)(getTimeout() / 1000));
xfrin.setLocalAddress(localAddress);
try {
xfrin.run();
}
catch (ZoneTransferException e) {
throw new WireParseException(e.getMessage());
}
List records = xfrin.getAXFR();
Message response = new Message(query.getHeader().getID());
response.getHeader().setFlag(Flags.AA);
response.getHeader().setFlag(Flags.QR);
response.addRecord(query.getQuestion(), Section.QUESTION);
Iterator it = records.iterator();
while (it.hasNext())
response.addRecord((Record)it.next(), Section.ANSWER);
return response;
}
代码示例来源:origin: tiandawu/IotXmpp
private Message
sendAXFR(Message query) throws IOException {
Name qname = query.getQuestion().getName();
ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(qname, address, tsig);
xfrin.setTimeout((int)(getTimeout() / 1000));
xfrin.setLocalAddress(localAddress);
try {
xfrin.run();
}
catch (ZoneTransferException e) {
throw new WireParseException(e.getMessage());
}
List records = xfrin.getAXFR();
Message response = new Message(query.getHeader().getID());
response.getHeader().setFlag(Flags.AA);
response.getHeader().setFlag(Flags.QR);
response.addRecord(query.getQuestion(), Section.QUESTION);
Iterator it = records.iterator();
while (it.hasNext())
response.addRecord((Record)it.next(), Section.ANSWER);
return response;
}
代码示例来源:origin: org.jboss.resteasy/resteasy-eagledns-fork
xfrin.setTimeout(axfrTimeout);
List<?> records = xfrin.run();
代码示例来源:origin: org.littleshoot/dnsjava
private Message
sendAXFR(Message query) throws IOException {
Name qname = query.getQuestion().getName();
ZoneTransferIn xfrin = ZoneTransferIn.newAXFR(qname, address, tsig);
xfrin.setTimeout((int)(getTimeout() / 1000));
xfrin.setLocalAddress(localAddress);
try {
xfrin.run();
}
catch (ZoneTransferException e) {
throw new WireParseException(e.getMessage());
}
List records = xfrin.getAXFR();
Message response = new Message(query.getHeader().getID());
response.getHeader().setFlag(Flags.AA);
response.getHeader().setFlag(Flags.QR);
response.addRecord(query.getQuestion(), Section.QUESTION);
Iterator it = records.iterator();
while (it.hasNext())
response.addRecord((Record)it.next(), Section.ANSWER);
return response;
}
内容来源于网络,如有侵权,请联系作者删除!