本文整理了Java中org.xbill.DNS.Header.setID()
方法的一些代码示例,展示了Header.setID()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Header.setID()
方法的具体详情如下:
包路径:org.xbill.DNS.Header
类名称:Header
方法名:setID
暂无
代码示例来源:origin: tiandawu/IotXmpp
/**
* Create a new empty header.
* @param id The message id
*/
public
Header(int id) {
init();
setID(id);
}
代码示例来源:origin: dnsjava/dnsjava
/**
* Create a new empty header.
* @param id The message id
*/
public
Header(int id) {
init();
setID(id);
}
代码示例来源:origin: org.littleshoot/dnsjava
/**
* Create a new empty header.
* @param id The message id
*/
public
Header(int id) {
init();
setID(id);
}
代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi
/**
* Create a new empty header.
* @param id The message id
*/
public
Header(int id) {
init();
setID(id);
}
代码示例来源:origin: org.apache.james/apache-jspf
private Message makeQuery(DNSRequest request, int id) throws TextParseException {
Name name = Name.fromString(request.getHostname(), Name.root);
int type;
switch (request.getRecordType()) {
case DNSRequest.A: type = Type.A; break;
case DNSRequest.AAAA: type = Type.AAAA; break;
case DNSRequest.MX: type = Type.MX; break;
case DNSRequest.PTR: type = Type.PTR; break;
case DNSRequest.SPF: type = Type.SPF; break;
case DNSRequest.TXT: type = Type.TXT; break;
default:
throw new UnsupportedOperationException("Unknown query type: "+request.getRecordType());
}
Record question = Record.newRecord(name, type, DClass.ANY);
Message query = Message.newQuery(question);
query.getHeader().setID(id);
return query;
}
}
代码示例来源:origin: org.apache.james.jspf/apache-jspf-resolver
private Message makeQuery(DNSRequest request, int id) throws TextParseException {
Name name = Name.fromString(request.getHostname(), Name.root);
int type;
switch (request.getRecordType()) {
case DNSRequest.A: type = Type.A; break;
case DNSRequest.AAAA: type = Type.AAAA; break;
case DNSRequest.MX: type = Type.MX; break;
case DNSRequest.PTR: type = Type.PTR; break;
case DNSRequest.SPF: type = Type.SPF; break;
case DNSRequest.TXT: type = Type.TXT; break;
default:
throw new UnsupportedOperationException("Unknown query type: "+request.getRecordType());
}
Record question = Record.newRecord(name, type, DClass.ANY);
Message query = Message.newQuery(question);
query.getHeader().setID(id);
return query;
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry
/**
* Create a query to forward to the primary DNS server (if configured).
* NOTE: Experimental
*
* @param query the inbound query.
* @return the query to forward to the primary server.
* @throws NameTooLongException
* @throws TextParseException if query creation fails.
*/
private Message createPrimaryQuery(Message query)
throws NameTooLongException, TextParseException {
Name name = query.getQuestion().getName();
if (name.labels() > 0 && name.labels() <= 2) {
// short relative or absolute name. this code may not be necessary -
// OS resolution utilities probably append the search paths defined
// in resolv.conf prior to the lookup
int id = query.getHeader().getID();
String queryName = name.getLabelString(0);
Name qualifiedName = Name.concatenate(Name.fromString(queryName),
Name.fromString(domainName));
LOG.info("Received query {}. Forwarding query {}", name, qualifiedName);
Record question = Record.newRecord(qualifiedName,
query.getQuestion().getType(),
query.getQuestion().getDClass());
query = Message.newQuery(question);
query.getHeader().setID(id);
}
return query;
}
代码示例来源:origin: posicks/mdnsjava
header.setID(0);
applyEDNS(message);
if (tsig != null)
内容来源于网络,如有侵权,请联系作者删除!