本文整理匯總了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);
}
}