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


Java AndFilter.addFilter方法代碼示例

本文整理匯總了Java中org.jivesoftware.smack.filter.AndFilter.addFilter方法的典型用法代碼示例。如果您正苦於以下問題:Java AndFilter.addFilter方法的具體用法?Java AndFilter.addFilter怎麽用?Java AndFilter.addFilter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jivesoftware.smack.filter.AndFilter的用法示例。


在下文中一共展示了AndFilter.addFilter方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: prepareOnlineMode

import org.jivesoftware.smack.filter.AndFilter; //導入方法依賴的package包/類
/**
 * Called when the mode provided by the connection is changed to online or the user sets the mode to online.
 * If Handler is in onlinemode some preparations are done like checking and perhaps retrieving the spaces service adress.
 */
private void prepareOnlineMode(){
	if (getMode() == Mode.ONLINE){
		if (domain == null){
			domain = userInfo.getDomain();
		}
		if (connectionHandler.getNetworkInformation().getSpacesServiceJID() != null) {
			this.connection.removePacketListener(packetListener);
			AndFilter andFilter = new AndFilter();
			OrFilter orFilter = new OrFilter();
			orFilter.addFilter(new IQTypeFilter(IQ.Type.ERROR));
			orFilter.addFilter(new IQTypeFilter(IQ.Type.RESULT));
			andFilter.addFilter(orFilter);
			andFilter.addFilter(new FromContainsFilter(connectionHandler.getNetworkInformation().getSpacesServiceJID()));
			this.connection.addPacketListener(packetListener, andFilter);
		}
	}
}
 
開發者ID:MirrorIP,項目名稱:msf-spaces-sdk-android,代碼行數:22,代碼來源:SpaceHandler.java

示例2: abstractListFilterToStringTest

import org.jivesoftware.smack.filter.AndFilter; //導入方法依賴的package包/類
@Test
public void abstractListFilterToStringTest() {
    AndFilter andFilter = new AndFilter();
    andFilter.addFilter(new StanzaIdFilter("foo"));
    andFilter.addFilter(new ThreadFilter("42"));
    andFilter.addFilter(MessageWithBodiesFilter.INSTANCE);

    final String res =andFilter.toString();
    assertEquals("AndFilter: (StanzaIdFilter: id=foo, ThreadFilter: thread=42, MessageWithBodiesFilter)", res);
}
 
開發者ID:TTalkIM,項目名稱:Smack,代碼行數:11,代碼來源:FilterToStringTest.java

示例3: changeConnectionHandler

import org.jivesoftware.smack.filter.AndFilter; //導入方法依賴的package包/類
/**
 * Setter for the XMPPConnection. Use this only when you create a new connection object.
 * @param connectionHandler The XMPPConnection object this instance of a SpaceHandler should use.
 * @throws SpaceManagementException Thrown when there's no response from the server.
 */
public void changeConnectionHandler(ConnectionHandler connectionHandler) throws SpaceManagementException {
	this.connectionHandler = connectionHandler;
	this.connection = this.connectionHandler.getXMPPConnection();

	if (connectionHandler.getNetworkInformation().getSpacesServiceJID() != null){
		AndFilter andFilter = new AndFilter();
		OrFilter orFilter = new OrFilter();
		orFilter.addFilter(new IQTypeFilter(IQ.Type.ERROR));
		orFilter.addFilter(new IQTypeFilter(IQ.Type.RESULT));
		andFilter.addFilter(orFilter);
		andFilter.addFilter(new FromContainsFilter(connectionHandler.getNetworkInformation().getSpacesServiceJID()));
		this.connection.addPacketListener(packetListener, andFilter);
	}
}
 
開發者ID:MirrorIP,項目名稱:msf-spaces-sdk-android,代碼行數:20,代碼來源:SpaceHandler.java


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