本文整理汇总了Java中org.jivesoftware.smack.filter.IQTypeFilter类的典型用法代码示例。如果您正苦于以下问题:Java IQTypeFilter类的具体用法?Java IQTypeFilter怎么用?Java IQTypeFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IQTypeFilter类属于org.jivesoftware.smack.filter包,在下文中一共展示了IQTypeFilter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: prepareOnlineMode
import org.jivesoftware.smack.filter.IQTypeFilter; //导入依赖的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: testPreventDiscoInfo
import org.jivesoftware.smack.filter.IQTypeFilter; //导入依赖的package包/类
/**
* Test if entity caps actually prevent a disco info request and reply
*
* @throws XMPPException
*
*/
public void testPreventDiscoInfo() throws XMPPException {
con0.addPacketSendingListener(new PacketListener() {
@Override
public void processPacket(Packet packet) {
discoInfoSend = true;
}
}, new AndFilter(new StanzaTypeFilter(DiscoverInfo.class), new IQTypeFilter(IQ.Type.get)));
// add a bogus feature so that con1 ver won't match con0's
sdm1.addFeature(DISCOVER_TEST_FEATURE);
dropCapsCache();
// discover that
DiscoverInfo info = sdm0.discoverInfo(con1.getUser());
// that discovery should cause a disco#info
assertTrue(discoInfoSend);
assertTrue(info.containsFeature(DISCOVER_TEST_FEATURE));
discoInfoSend = false;
// discover that
info = sdm0.discoverInfo(con1.getUser());
// that discovery shouldn't cause a disco#info
assertFalse(discoInfoSend);
assertTrue(info.containsFeature(DISCOVER_TEST_FEATURE));
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:34,代码来源:EntityCapsTest.java
示例3: initListeners
import org.jivesoftware.smack.filter.IQTypeFilter; //导入依赖的package包/类
private void initListeners() {
listeners = new ArrayList<FileTransferListener>();
connection.addPacketListener(new PacketListener() {
public void processPacket(Packet packet) {
fireNewRequest((StreamInitiation) packet);
}
}, new AndFilter(new PacketTypeFilter(StreamInitiation.class),
new IQTypeFilter(IQ.Type.SET)));
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:11,代码来源:FileTransferManager.java
示例4: changeConnectionHandler
import org.jivesoftware.smack.filter.IQTypeFilter; //导入依赖的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
示例5: testPreventDiscoInfo
import org.jivesoftware.smack.filter.IQTypeFilter; //导入依赖的package包/类
/**
* Test if entity caps actually prevent a disco info request and reply
*
* @throws XMPPException
*
*/
public void testPreventDiscoInfo() throws XMPPException {
con0.addPacketSendingListener(new PacketListener() {
@Override
public void processPacket(Packet packet) {
discoInfoSend = true;
}
}, new AndFilter(new PacketTypeFilter(DiscoverInfo.class), new IQTypeFilter(IQ.Type.GET)));
// add a bogus feature so that con1 ver won't match con0's
sdm1.addFeature(DISCOVER_TEST_FEATURE);
dropCapsCache();
// discover that
DiscoverInfo info = sdm0.discoverInfo(con1.getUser());
// that discovery should cause a disco#info
assertTrue(discoInfoSend);
assertTrue(info.containsFeature(DISCOVER_TEST_FEATURE));
discoInfoSend = false;
// discover that
info = sdm0.discoverInfo(con1.getUser());
// that discovery shouldn't cause a disco#info
assertFalse(discoInfoSend);
assertTrue(info.containsFeature(DISCOVER_TEST_FEATURE));
}
开发者ID:bejayoharen,项目名称:java-bells,代码行数:34,代码来源:EntityCapsTest.java
注:本文中的org.jivesoftware.smack.filter.IQTypeFilter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论