本文整理汇总了Java中tigase.util.DNSResolver类的典型用法代码示例。如果您正苦于以下问题:Java DNSResolver类的具体用法?Java DNSResolver怎么用?Java DNSResolver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DNSResolver类属于tigase.util包,在下文中一共展示了DNSResolver类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefaults
import tigase.util.DNSResolver; //导入依赖的package包/类
/**
* Method description
*
*
* @param params
*
* @return
*/
@Override
public Map<String, Object> getDefaults(Map<String, Object> params) {
Map<String, Object> props = super.getDefaults(params);
if (params.get(GEN_VIRT_HOSTS) != null) {
HOSTNAMES_PROP_VAL = ((String) params.get(GEN_VIRT_HOSTS)).split(",");
} else {
HOSTNAMES_PROP_VAL = DNSResolver.getDefHostNames();
}
props.put(MESSAGE_FILTER_ENABLED_KEY, Boolean.TRUE);
props.put(PRESENCE_FILTER_ENABLED_KEY, Boolean.FALSE);
props.put(PING_EVERY_MINUTE_KEY, Boolean.FALSE);
String[] hostnames = new String[HOSTNAMES_PROP_VAL.length];
int i = 0;
for (String host : HOSTNAMES_PROP_VAL) {
hostnames[i++] = getName() + "." + host;
}
props.put(HOSTNAMES_PROP_KEY, hostnames);
// By default use the same repository as all other components:
String repo_class = (params.get(GEN_USER_DB) != null) ? (String) params.get(GEN_USER_DB) : DERBY_REPO_CLASS_PROP_VAL;
String repo_uri = (params.get(GEN_USER_DB_URI) != null) ? (String) params.get(GEN_USER_DB_URI)
: DERBY_REPO_URL_PROP_VAL;
props.put(MUC_REPO_CLASS_PROP_KEY, repo_class);
props.put(MUC_REPO_URL_PROP_KEY, repo_uri);
props.put(HistoryManagerFactory.DB_CLASS_KEY, repo_class);
props.put(HistoryManagerFactory.DB_URI_KEY, repo_uri);
String[] admins;
if (params.get(GEN_ADMINS) != null) {
admins = ((String) params.get(GEN_ADMINS)).split(",");
} else {
admins = new String[] { "[email protected]" + getDefHostName() };
}
props.put(ADMINS_KEY, admins);
props.put(LOG_DIR_KEY, new String("./logs/"));
props.put(MUC_ALLOW_CHAT_STATES_KEY, Boolean.FALSE);
props.put(MUC_LOCK_NEW_ROOM_KEY, Boolean.TRUE);
return props;
}