當前位置: 首頁>>代碼示例>>Java>>正文


Java DNSResolver類代碼示例

本文整理匯總了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;
}
 
開發者ID:Smartupz,項目名稱:tigase-muc,代碼行數:58,代碼來源:MUCComponent.java


注:本文中的tigase.util.DNSResolver類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。