本文整理汇总了Java中org.jxmpp.jid.parts.Localpart类的典型用法代码示例。如果您正苦于以下问题:Java Localpart类的具体用法?Java Localpart怎么用?Java Localpart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Localpart类属于org.jxmpp.jid.parts包,在下文中一共展示了Localpart类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getConferenceId
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
private void getConferenceId(String defaultUsername, IQ reply, JSONObject requestJSON)
{
Element childElement = reply.setChildElement("response", "http://igniterealtime.org/protocol/ofmeet");
try {
String roomName = requestJSON.getString("room");
for (Conference conference : videobridge.getConferences())
{
Localpart room = conference.getName();
if (room != null && room.equals( Localpart.from(roomName) ))
{
JSONObject userJSON = new JSONObject();
userJSON.put("room", roomName);
userJSON.put("id", conference.getID());
userJSON.put("lastActivityTime", String.valueOf(conference.getLastActivityTime()));
userJSON.put("focus", conference.getFocus());
userJSON.put("expired", conference.isExpired() ? "yes" : "no");
childElement.setText(userJSON.toString());
break;
}
}
} catch (Exception e1) {
reply.setError(new PacketError(PacketError.Condition.not_allowed, PacketError.Type.modify, requestJSON.toString() + " " + e1));
return;
}
}
开发者ID:igniterealtime,项目名称:ofmeet-openfire-plugin,代码行数:32,代码来源:OfMeetIQHandler.java
示例2: bareFrom
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
/**
* Get a {@link BareJid} constructed from the optionally given {@link Localpart} and {@link Domainpart}.
*
* @param localpart a optional localpart.
* @param domain a domainpart.
* @return a bare JID constructed from the given parts.
*/
public static BareJid bareFrom(Localpart localpart, Domainpart domain) {
if (localpart != null) {
return new LocalAndDomainpartJid(localpart, domain);
} else {
return new DomainpartJid(domain);
}
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:15,代码来源:JidCreate.java
示例3: entityBareFromUnescapedTest
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
@Test
public void entityBareFromUnescapedTest() throws XmppStringprepException {
EntityBareJid entityBareJid = JidCreate.entityBareFromUnescaped("[email protected]@example.org/baz");
// Tricky question. Currently yields '[email protected]'. Domainparts are U-Labels, so this may be correct, even
// if it is not a valid DNS label/name.
Domainpart domainpart = entityBareJid.getDomain();
assertEquals(Domainpart.from("[email protected]"), domainpart);
Localpart localpart = entityBareJid.getLocalpart();
assertEquals(Localpart.from("foo"), localpart);
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:13,代码来源:JidCreateTest.java
示例4: entityFullFromComplexTest
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
@Test
public void entityFullFromComplexTest() throws XmppStringprepException {
EntityFullJid entityFullJid = JidCreate.entityFullFrom("[email protected]@example.org/[email protected]");
Domainpart domainpart = entityFullJid.getDomain();
assertEquals(Domainpart.from("[email protected]"), domainpart);
Localpart localpart = entityFullJid.getLocalpart();
assertEquals(Localpart.from("foo"), localpart);
Resourcepart resourcepart = entityFullJid.getResourcepart();
assertEquals(Resourcepart.from("[email protected]"), resourcepart);
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:14,代码来源:JidCreateTest.java
示例5: entityFullFromUnsecapedComplexTest
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
@Test
public void entityFullFromUnsecapedComplexTest() throws XmppStringprepException {
EntityFullJid entityFullJid = JidCreate.entityFullFromUnescaped("[email protected]@example.org/[email protected]");
Domainpart domainpart = entityFullJid.getDomain();
assertEquals(Domainpart.from("[email protected]"), domainpart);
Localpart localpart = entityFullJid.getLocalpart();
assertEquals(Localpart.from("foo"), localpart);
Resourcepart resourcepart = entityFullJid.getResourcepart();
assertEquals(Resourcepart.from("[email protected]"), resourcepart);
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:14,代码来源:JidCreateTest.java
示例6: registerAccount
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
public boolean registerAccount (Imps.ProviderSettings.QueryMap providerSettings, String username, String password, Map<String,String> params) throws Exception
{
initConnection(providerSettings, username);
if (mConnection != null && mConnection.isConnected() && mConnection.isSecureConnection()) {
org.jivesoftware.smackx.iqregister.AccountManager aMgr = org.jivesoftware.smackx.iqregister.AccountManager.getInstance(mConnection);
if (aMgr.supportsAccountCreation()) {
aMgr.createAccount(Localpart.from(username), password, params);
return true;
}
}
return false;
}
开发者ID:zom,项目名称:Zom-Android,代码行数:19,代码来源:XmppConnection.java
示例7: fromSmack
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
public static JID fromSmack(Jid jid) {
Localpart localpart = jid.getLocalpartOrNull();
return new JID(localpart != null ? localpart.toString() : "",
jid.getDomain().toString(),
jid.getResourceOrEmpty().toString());
}
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:7,代码来源:JID.java
示例8: getLocalpartOrNull
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
@Override
public Localpart getLocalpartOrNull() {
return null;
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:5,代码来源:DomainAndResourcepartJid.java
示例9: LocalAndDomainpartJid
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
LocalAndDomainpartJid(String localpart, String domain) throws XmppStringprepException {
domainBareJid = new DomainpartJid(domain);
this.localpart = Localpart.from(localpart);
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:5,代码来源:LocalAndDomainpartJid.java
示例10: getLocalpart
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
@Override
public final Localpart getLocalpart() {
return localpart;
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:5,代码来源:LocalAndDomainpartJid.java
示例11: getLocalpartOrNull
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
@Override
public Localpart getLocalpartOrNull() {
return getLocalpart();
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:5,代码来源:LocalAndDomainpartJid.java
示例12: getLocalpartOrNull
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
@Override
public abstract Localpart getLocalpartOrNull();
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:3,代码来源:AbstractJid.java
示例13: getLocalpartOrThrow
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
@Override
public final Localpart getLocalpartOrThrow() {
Localpart localpart = getLocalpartOrNull();
if (localpart == null) throwIse("has no localpart");
return localpart;
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:7,代码来源:AbstractJid.java
示例14: getLocalpartOrNull
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
@Override
public Localpart getLocalpartOrNull() {
return bareJid.getLocalpart();
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:5,代码来源:LocalDomainAndResourcepartJid.java
示例15: getLocalpart
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
@Override
public Localpart getLocalpart() {
return bareJid.getLocalpart();
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:5,代码来源:LocalDomainAndResourcepartJid.java
示例16: registerAccount
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
public void registerAccount(View view) {
final EntityBareJid jid = mSettings.getJid();
final String password = mSettings.getPassword();
if (jid == null) {
Toast.makeText(this, "Please enter a valid bare JID", Toast.LENGTH_SHORT).show();
return;
}
if (password.isEmpty()) {
Toast.makeText(this, "Please enter a password", Toast.LENGTH_SHORT).show();
return;
}
(new Thread() {
@Override
public void run() {
if (!ConnectivityManagerUtil.hasDataConnection(InfoAndSettings.this)) {
showToast("Data connection not available", Toast.LENGTH_SHORT);
return;
}
try {
final Localpart username = jid.getLocalpart();
final AbstractXMPPConnection connection = new XMPPTCPConnection(
mSettings.getConnectionConfiguration(InfoAndSettings.this));
showToast("Connecting to server", Toast.LENGTH_SHORT);
connection.connect();
AccountManager accountManager = AccountManager.getInstance(connection);
showToast("Connected, trying to create account", Toast.LENGTH_SHORT);
accountManager.createAccount(username, password);
connection.disconnect();
} catch (Exception e) {
LOG.i("registerAccount", e);
showToast("Error creating account: " + e, Toast.LENGTH_LONG);
return;
}
showToast("Account created", Toast.LENGTH_SHORT);
}
private final void showToast(final String text, final int duration) {
InfoAndSettings.this.runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(InfoAndSettings.this, text, duration).show();
}
});
}
}).start();
}
开发者ID:ProjectMAXS,项目名称:maxs,代码行数:50,代码来源:InfoAndSettings.java
示例17: getLocalpart
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
/**
* Return the {@link Localpart} of this JID.
*
* @return the localpart.
*/
public Localpart getLocalpart();
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:7,代码来源:EntityJid.java
示例18: getLocalpartOrNull
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
/**
* Get the localpart of this JID or null.
* <p>
* If the JID is of form {@code <[email protected]>} then this method returns 'localpart'. If the JID has no
* localpart, then <code>null</code> is returned.
* </p>
*
* @return the localpart of this JID or null.
*/
public Localpart getLocalpartOrNull();
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:11,代码来源:Jid.java
示例19: getLocalpartOrThrow
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
/**
* Get the localpart of this JID or throw an {@code IllegalStateException}.
* <p>
* If the JID is of form {@code <[email protected]>} then this method returns 'localpart'. If the JID has no
* localpart, then <code>null</code> is returned.
* </p>
*
* @return the localpart of this JID.
*/
public Localpart getLocalpartOrThrow();
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:11,代码来源:Jid.java
示例20: fullFrom
import org.jxmpp.jid.parts.Localpart; //导入依赖的package包/类
/**
* Get a {@link FullJid} constructed from the given parts.
*
* @param localpart a optional localpart.
* @param domainBareJid a domain bare JID.
* @param resource a resourcepart
* @return a full JID.
*/
public static FullJid fullFrom(Localpart localpart, DomainBareJid domainBareJid, Resourcepart resource) {
return fullFrom(localpart, domainBareJid.getDomain(), resource);
}
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:12,代码来源:JidCreate.java
注:本文中的org.jxmpp.jid.parts.Localpart类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论