当前位置: 首页>>代码示例>>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;未经允许,请勿转载。