当前位置: 首页>>代码示例>>Java>>正文


Java XmppClient类代码示例

本文整理汇总了Java中rocks.xmpp.core.session.XmppClient的典型用法代码示例。如果您正苦于以下问题:Java XmppClient类的具体用法?Java XmppClient怎么用?Java XmppClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XmppClient类属于rocks.xmpp.core.session包,在下文中一共展示了XmppClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendMessage

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public boolean sendMessage(String message) {
	XmppClient client = api.getXMPPClient();
	
	if(client.isConnected()) {
		Message xmppMsg = new Message(contact.getJid(), Message.Type.CHAT, message);
		client.sendMessage(xmppMsg);
		return true;
	}
	
	return false;
}
 
开发者ID:Wirlie,项目名称:League-of-Legends-Chat-Library-XMPP,代码行数:12,代码来源:Friend.java

示例2: accept

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public void accept() {
	if(processed) {
		throw new IllegalStateException("This request already was accepted/rejected!");
	}
	
	processed = true;
	
	XmppClient client = api.getXMPPClient();
	PresenceManager presenceManager = client.getManager(PresenceManager.class);
	presenceManager.approveSubscription(from.getXMPPJid());
	
	api.removeRequest(this);
}
 
开发者ID:Wirlie,项目名称:League-of-Legends-Chat-Library-XMPP,代码行数:14,代码来源:FriendRequest.java

示例3: deny

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public void deny() {
	if(processed) {
		throw new IllegalStateException("This request already was accepted/rejected!");
	}
	
	processed = true;
	
	XmppClient client = api.getXMPPClient();
	PresenceManager presenceManager = client.getManager(PresenceManager.class);
	presenceManager.denySubscription(from.getXMPPJid());
	
	api.removeRequest(this);
}
 
开发者ID:Wirlie,项目名称:League-of-Legends-Chat-Library-XMPP,代码行数:14,代码来源:FriendRequest.java

示例4: getXmppDetails

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public XmppDetails getXmppDetails(XmppAuthRequest authRequest) throws Exception {
    //Authentication and BOSH pre-binding
    BoshConnectionConfiguration boshConfiguration = BoshConnectionConfiguration.builder()
            .hostname(xmppHost)
            .port(Integer.valueOf(xmppPort))
            .path(httpBind)
            .wait(Integer.valueOf(waitTime))
            .build();

    XmppClient xmppClient = new XmppClient(xmppHost, boshConfiguration);

    try {
        xmppClient.connect(new Jid(authRequest.getJid()));
        xmppClient.login(authRequest.getJid(), authRequest.getPassword());

        rocks.xmpp.extensions.httpbind.BoshConnection boshConnection =
                (rocks.xmpp.extensions.httpbind.BoshConnection) xmppClient.getActiveConnection();

        String sessionId = boshConnection.getSessionId();

        // Detaches the BOSH session, without terminating it.
        long rid = boshConnection.detach();

        XmppDetails details = new XmppDetails();
        details.setJid(authRequest.getJid());
        details.setSid(sessionId);
        details.setRid(rid);
        return details;
    } catch (Exception e) {
        LOG.error("Error", e);
    }
    return null;
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:34,代码来源:XmppAuthenticationProvider.java

示例5: create

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public static AbstractTestSuite create(Class <? extends AbstractTestSuite> clazz, Jid jid, String password) throws AbstractTestSuite.TestSuiteCreationException {
    XmppSessionConfiguration configuration = XmppSessionConfiguration.builder()
            .extensions(Extension.of(ClientStateIndication.class))
            .initialPresence(null)
            .build();
    final XmppClient client = XmppClient.create(jid.getDomain(),configuration);
    try {
        AbstractTestSuite testSuite = clazz.getDeclaredConstructor(XmppClient.class, Jid.class, String.class).newInstance(client, jid, password);
        return testSuite;
    } catch (Exception e) {
        e.printStackTrace();
        throw new AbstractTestSuite.TestSuiteCreationException();
    }
}
 
开发者ID:iNPUTmice,项目名称:ComplianceTester,代码行数:15,代码来源:TestSuiteFactory.java

示例6: create

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public static AbstractTest create(Class <? extends AbstractTest> clazz, XmppClient client) throws TestCreationException {
    if (client == null) {
        throw new TestCreationException();
    }
    try {
        AbstractTest test = clazz.getDeclaredConstructor(XmppClient.class).newInstance(client);
        return test;
    } catch (Exception e) {
        e.printStackTrace();
        throw new TestCreationException();
    }
}
 
开发者ID:iNPUTmice,项目名称:ComplianceTester,代码行数:13,代码来源:TestFactory.java

示例7: getXMPPClient

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public XmppClient getXMPPClient() {
	return xmppClient;
}
 
开发者ID:Wirlie,项目名称:League-of-Legends-Chat-Library-XMPP,代码行数:4,代码来源:LoLXMPPAPI.java

示例8: Conversations

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public Conversations(XmppClient client, Jid jid, String password) {
    super(client, jid, password);
}
 
开发者ID:iNPUTmice,项目名称:ComplianceTester,代码行数:4,代码来源:Conversations.java

示例9: AdvancedServerIM

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public AdvancedServerIM(XmppClient client, Jid jid, String password) {
    super(client, jid, password);
}
 
开发者ID:iNPUTmice,项目名称:ComplianceTester,代码行数:4,代码来源:AdvancedServerIM.java

示例10: AdvancedServerCore

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public AdvancedServerCore(XmppClient client, Jid jid, String password) {
    super(client, jid, password);
}
 
开发者ID:iNPUTmice,项目名称:ComplianceTester,代码行数:4,代码来源:AdvancedServerCore.java

示例11: AbstractTestSuite

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public AbstractTestSuite(XmppClient client, Jid jid, String password) {
    mXmppClient = client;
    mJid = jid;
    mPassword = password;
}
 
开发者ID:iNPUTmice,项目名称:ComplianceTester,代码行数:6,代码来源:AbstractTestSuite.java

示例12: AdvancedServerMobile

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public AdvancedServerMobile(XmppClient client, Jid jid, String password) {
    super(client, jid, password);
}
 
开发者ID:iNPUTmice,项目名称:ComplianceTester,代码行数:4,代码来源:AdvancedServerMobile.java

示例13: MAM

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public MAM(XmppClient client) {
    super(client);
}
 
开发者ID:iNPUTmice,项目名称:ComplianceTester,代码行数:4,代码来源:MAM.java

示例14: AbstractStreamFeatureTest

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public AbstractStreamFeatureTest(XmppClient client) {
    super(client);
}
 
开发者ID:iNPUTmice,项目名称:ComplianceTester,代码行数:4,代码来源:AbstractStreamFeatureTest.java

示例15: AbstractTest

import rocks.xmpp.core.session.XmppClient; //导入依赖的package包/类
public AbstractTest(XmppClient client) {
    this.client = client;
}
 
开发者ID:iNPUTmice,项目名称:ComplianceTester,代码行数:4,代码来源:AbstractTest.java


注:本文中的rocks.xmpp.core.session.XmppClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。