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


Java Xmlns类代码示例

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


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

示例1: pushContactToServer

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void pushContactToServer(final Contact contact) {
	contact.resetOption(Contact.Options.DIRTY_DELETE);
	contact.setOption(Contact.Options.DIRTY_PUSH);
	final Account account = contact.getAccount();
	if (account.getStatus() == Account.State.ONLINE) {
		final boolean ask = contact.getOption(Contact.Options.ASKING);
		final boolean sendUpdates = contact
				.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)
				&& contact.getOption(Contact.Options.PREEMPTIVE_GRANT);
		final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
		iq.query(Xmlns.ROSTER).addChild(contact.asElement());
		account.getXmppConnection().sendIqPacket(iq, mDefaultIqHandler);
		if (sendUpdates) {
			sendPresencePacket(account,
					mPresenceGenerator.sendPresenceUpdatesTo(contact));
		}
		if (ask) {
			sendPresencePacket(account,
					mPresenceGenerator.requestPresenceUpdatesFrom(contact));
		}
	}
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:23,代码来源:XmppConnectionService.java

示例2: pushContactToServer

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void pushContactToServer(final Contact contact) {
	contact.resetOption(Contact.Options.DIRTY_DELETE);
	contact.setOption(Contact.Options.DIRTY_PUSH);
	final Account account = contact.getAccount();
	if (account.getStatus() == Account.State.ONLINE) {
		final boolean ask = contact.getOption(Contact.Options.ASKING);
		final boolean sendUpdates = contact
			.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)
			&& contact.getOption(Contact.Options.PREEMPTIVE_GRANT);
		final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
		iq.query(Xmlns.ROSTER).addChild(contact.asElement());
		account.getXmppConnection().sendIqPacket(iq, null);
		if (sendUpdates) {
			sendPresencePacket(account,
					mPresenceGenerator.sendPresenceUpdatesTo(contact));
		}
		if (ask) {
			sendPresencePacket(account,
					mPresenceGenerator.requestPresenceUpdatesFrom(contact));
		}
	}
}
 
开发者ID:juanignaciomolina,项目名称:txtr,代码行数:23,代码来源:XmppConnectionService.java

示例3: generateSetPassword

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public IqPacket generateSetPassword(final Account account, final String newPassword) {
	final IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
	packet.setTo(account.getServer());
	final Element query = packet.addChild("query", Xmlns.REGISTER);
	final Jid jid = account.getJid();
	query.addChild("username").setContent(jid.getLocalpart());
	query.addChild("password").setContent(newPassword);
	return packet;
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:10,代码来源:IqGenerator.java

示例4: requestHttpUploadSlot

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public IqPacket requestHttpUploadSlot(Jid host, DownloadableFile file, String mime) {
	IqPacket packet = new IqPacket(IqPacket.TYPE.GET);
	packet.setTo(host);
	Element request = packet.addChild("request",Xmlns.HTTP_UPLOAD);
	request.addChild("filename").setContent(file.getName());
	request.addChild("size").setContent(String.valueOf(file.getExpectedSize()));
	if (mime != null) {
		request.addChild("content-type").setContent(mime);
	}
	return packet;
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:12,代码来源:IqGenerator.java

示例5: fetchRosterFromServer

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void fetchRosterFromServer(final Account account) {
	final IqPacket iqPacket = new IqPacket(IqPacket.TYPE.GET);
	if (!"".equals(account.getRosterVersion())) {
		Log.d(Config.LOGTAG, account.getJid().toBareJid()
				+ ": fetching roster version " + account.getRosterVersion());
	} else {
		Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": fetching roster");
	}
	iqPacket.query(Xmlns.ROSTER).setAttribute("ver", account.getRosterVersion());
	sendIqPacket(account, iqPacket, mIqParser);
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:12,代码来源:XmppConnectionService.java

示例6: deleteContactOnServer

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void deleteContactOnServer(Contact contact) {
	contact.resetOption(Contact.Options.PREEMPTIVE_GRANT);
	contact.resetOption(Contact.Options.DIRTY_PUSH);
	contact.setOption(Contact.Options.DIRTY_DELETE);
	Account account = contact.getAccount();
	if (account.getStatus() == Account.State.ONLINE) {
		IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
		Element item = iq.query(Xmlns.ROSTER).addChild("item");
		item.setAttribute("jid", contact.getJid().toString());
		item.setAttribute("subscription", "remove");
		account.getXmppConnection().sendIqPacket(iq, mDefaultIqHandler);
	}
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:14,代码来源:XmppConnectionService.java

示例7: fetchRosterFromServer

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void fetchRosterFromServer(final Account account) {
	final IqPacket iqPacket = new IqPacket(IqPacket.TYPE.GET);
	if (!"".equals(account.getRosterVersion())) {
		Log.d(Config.LOGTAG, account.getJid().toBareJid()
				+ ": fetching roster version " + account.getRosterVersion());
	} else {
		Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": fetching roster");
	}
	iqPacket.query(Xmlns.ROSTER).setAttribute("ver",
			account.getRosterVersion());
	account.getXmppConnection().sendIqPacket(iqPacket, mIqParser);
}
 
开发者ID:juanignaciomolina,项目名称:txtr,代码行数:13,代码来源:XmppConnectionService.java

示例8: deleteContactOnServer

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void deleteContactOnServer(Contact contact) {
	contact.resetOption(Contact.Options.PREEMPTIVE_GRANT);
	contact.resetOption(Contact.Options.DIRTY_PUSH);
	contact.setOption(Contact.Options.DIRTY_DELETE);
	Account account = contact.getAccount();
	if (account.getStatus() == Account.State.ONLINE) {
		IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
		Element item = iq.query(Xmlns.ROSTER).addChild("item");
		item.setAttribute("jid", contact.getJid().toString());
		item.setAttribute("subscription", "remove");
		account.getXmppConnection().sendIqPacket(iq, null);
	}
}
 
开发者ID:juanignaciomolina,项目名称:txtr,代码行数:14,代码来源:XmppConnectionService.java

示例9: generateGetBlockList

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public IqPacket generateGetBlockList() {
	final IqPacket iq = new IqPacket(IqPacket.TYPE.GET);
	iq.addChild("blocklist", Xmlns.BLOCKING);

	return iq;
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:7,代码来源:IqGenerator.java

示例10: generateSetBlockRequest

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public IqPacket generateSetBlockRequest(final Jid jid) {
	final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
	final Element block = iq.addChild("block", Xmlns.BLOCKING);
	block.addChild("item").setAttribute("jid", jid.toBareJid().toString());
	return iq;
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:7,代码来源:IqGenerator.java

示例11: generateSetUnblockRequest

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public IqPacket generateSetUnblockRequest(final Jid jid) {
	final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
	final Element block = iq.addChild("unblock", Xmlns.BLOCKING);
	block.addChild("item").setAttribute("jid", jid.toBareJid().toString());
	return iq;
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:7,代码来源:IqGenerator.java

示例12: blocking

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public boolean blocking() {
	return hasDiscoFeature(account.getServer(), Xmlns.BLOCKING);
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:4,代码来源:XmppConnection.java

示例13: register

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public boolean register() {
	return hasDiscoFeature(account.getServer(), Xmlns.REGISTER);
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:4,代码来源:XmppConnection.java

示例14: httpUpload

import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public boolean httpUpload() {
	return !Config.DISABLE_HTTP_UPLOAD && findDiscoItemsByFeature(Xmlns.HTTP_UPLOAD).size() > 0;
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:4,代码来源:XmppConnection.java


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