本文整理汇总了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);
}
}
}
示例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);
}
示例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);
}
}