本文整理汇总了Java中org.jivesoftware.smackx.bytestreams.BytestreamListener类的典型用法代码示例。如果您正苦于以下问题:Java BytestreamListener类的具体用法?Java BytestreamListener怎么用?Java BytestreamListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BytestreamListener类属于org.jivesoftware.smackx.bytestreams包,在下文中一共展示了BytestreamListener类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: processRequest
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
private void processRequest(Stanza packet) throws NotConnectedException {
Open ibbRequest = (Open) packet;
// validate that block size is within allowed range
if (ibbRequest.getBlockSize() > this.manager.getMaximumBlockSize()) {
this.manager.replyResourceConstraintPacket(ibbRequest);
return;
}
StreamNegotiator.signal(ibbRequest.getFrom() + '\t' + ibbRequest.getSessionID(), ibbRequest);
// ignore request if in ignore list
if (this.manager.getIgnoredBytestreamRequests().remove(ibbRequest.getSessionID()))
return;
// build bytestream request from packet
InBandBytestreamRequest request = new InBandBytestreamRequest(this.manager, ibbRequest);
// notify listeners for bytestream initiation from a specific user
BytestreamListener userListener = this.manager.getUserListener(ibbRequest.getFrom());
if (userListener != null) {
userListener.incomingBytestreamRequest(request);
}
else if (!this.manager.getAllRequestListeners().isEmpty()) {
/*
* if there is no user specific listener inform listeners for all initiation requests
*/
for (BytestreamListener listener : this.manager.getAllRequestListeners()) {
listener.incomingBytestreamRequest(request);
}
}
else {
/*
* if there is no listener for this initiation request, reply with reject message
*/
this.manager.replyRejectPacket(ibbRequest);
}
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:41,代码来源:InitiationListener.java
示例2: processRequest
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
private void processRequest(Stanza packet) throws NotConnectedException {
Bytestream byteStreamRequest = (Bytestream) packet;
StreamNegotiator.signal(byteStreamRequest.getFrom() + '\t' + byteStreamRequest.getSessionID(), byteStreamRequest);
// ignore request if in ignore list
if (this.manager.getIgnoredBytestreamRequests().remove(byteStreamRequest.getSessionID())) {
return;
}
// build bytestream request from packet
Socks5BytestreamRequest request = new Socks5BytestreamRequest(this.manager,
byteStreamRequest);
// notify listeners for bytestream initiation from a specific user
BytestreamListener userListener = this.manager.getUserListener(byteStreamRequest.getFrom());
if (userListener != null) {
userListener.incomingBytestreamRequest(request);
}
else if (!this.manager.getAllRequestListeners().isEmpty()) {
/*
* if there is no user specific listener inform listeners for all initiation requests
*/
for (BytestreamListener listener : this.manager.getAllRequestListeners()) {
listener.incomingBytestreamRequest(request);
}
}
else {
/*
* if there is no listener for this initiation request, reply with reject message
*/
this.manager.replyRejectPacket(byteStreamRequest);
}
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:37,代码来源:InitiationListener.java
示例3: processRequest
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
private void processRequest(Packet packet) {
Open ibbRequest = (Open) packet;
// validate that block size is within allowed range
if (ibbRequest.getBlockSize() > this.manager.getMaximumBlockSize()) {
this.manager.replyResourceConstraintPacket(ibbRequest);
return;
}
// ignore request if in ignore list
if (this.manager.getIgnoredBytestreamRequests().remove(ibbRequest.getSessionID()))
return;
// build bytestream request from packet
InBandBytestreamRequest request = new InBandBytestreamRequest(this.manager, ibbRequest);
// notify listeners for bytestream initiation from a specific user
BytestreamListener userListener = this.manager.getUserListener(ibbRequest.getFrom());
if (userListener != null) {
userListener.incomingBytestreamRequest(request);
}
else if (!this.manager.getAllRequestListeners().isEmpty()) {
/*
* if there is no user specific listener inform listeners for all initiation requests
*/
for (BytestreamListener listener : this.manager.getAllRequestListeners()) {
listener.incomingBytestreamRequest(request);
}
}
else {
/*
* if there is no listener for this initiation request, reply with reject message
*/
this.manager.replyRejectPacket(ibbRequest);
}
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:39,代码来源:InitiationListener.java
示例4: processRequest
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
private void processRequest(Packet packet) {
Bytestream byteStreamRequest = (Bytestream) packet;
// ignore request if in ignore list
if (this.manager.getIgnoredBytestreamRequests().remove(byteStreamRequest.getSessionID())) {
return;
}
// build bytestream request from packet
Socks5BytestreamRequest request = new Socks5BytestreamRequest(this.manager,
byteStreamRequest);
// notify listeners for bytestream initiation from a specific user
BytestreamListener userListener = this.manager.getUserListener(byteStreamRequest.getFrom());
if (userListener != null) {
userListener.incomingBytestreamRequest(request);
}
else if (!this.manager.getAllRequestListeners().isEmpty()) {
/*
* if there is no user specific listener inform listeners for all initiation requests
*/
for (BytestreamListener listener : this.manager.getAllRequestListeners()) {
listener.incomingBytestreamRequest(request);
}
}
else {
/*
* if there is no listener for this initiation request, reply with reject message
*/
this.manager.replyRejectPacket(byteStreamRequest);
}
}
开发者ID:ice-coffee,项目名称:EIM,代码行数:35,代码来源:InitiationListener.java
示例5: processRequest
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
private void processRequest(Packet packet) {
Bytestream byteStreamRequest = (Bytestream) packet;
// ignore request if in ignore list
if (this.manager.getIgnoredBytestreamRequests().remove(
byteStreamRequest.getSessionID())) {
return;
}
// build bytestream request from packet
Socks5BytestreamRequest request = new Socks5BytestreamRequest(
this.manager, byteStreamRequest);
// notify listeners for bytestream initiation from a specific user
BytestreamListener userListener = this.manager
.getUserListener(byteStreamRequest.getFrom());
if (userListener != null) {
userListener.incomingBytestreamRequest(request);
} else if (!this.manager.getAllRequestListeners().isEmpty()) {
/*
* if there is no user specific listener inform listeners for all
* initiation requests
*/
for (BytestreamListener listener : this.manager
.getAllRequestListeners()) {
listener.incomingBytestreamRequest(request);
}
} else {
/*
* if there is no listener for this initiation request, reply with
* reject message
*/
this.manager.replyRejectPacket(byteStreamRequest);
}
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:38,代码来源:InitiationListener.java
示例6: processRequest
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
private void processRequest(Packet packet) {
Open ibbRequest = (Open) packet;
// validate that block size is within allowed range
if (ibbRequest.getBlockSize() > this.manager.getMaximumBlockSize()) {
this.manager.replyResourceConstraintPacket(ibbRequest);
return;
}
// ignore request if in ignore list
if (this.manager.getIgnoredBytestreamRequests().remove(
ibbRequest.getSessionID()))
return;
// build bytestream request from packet
InBandBytestreamRequest request = new InBandBytestreamRequest(
this.manager, ibbRequest);
// notify listeners for bytestream initiation from a specific user
BytestreamListener userListener = this.manager
.getUserListener(ibbRequest.getFrom());
if (userListener != null) {
userListener.incomingBytestreamRequest(request);
} else if (!this.manager.getAllRequestListeners().isEmpty()) {
/*
* if there is no user specific listener inform listeners for all
* initiation requests
*/
for (BytestreamListener listener : this.manager
.getAllRequestListeners()) {
listener.incomingBytestreamRequest(request);
}
} else {
/*
* if there is no listener for this initiation request, reply with
* reject message
*/
this.manager.replyRejectPacket(ibbRequest);
}
}
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:43,代码来源:InitiationListener.java
示例7: addIncomingBytestreamListener
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
/**
* Adds InBandBytestreamListener that is called for every incoming in-band bytestream request
* unless there is a user specific InBandBytestreamListener registered.
* <p>
* If no listeners are registered all In-Band Bytestream request are rejected with a
* <not-acceptable/> error.
* <p>
* Note that the registered {@link InBandBytestreamListener} will NOT be notified on incoming
* Socks5 bytestream requests sent in the context of <a
* href="http://xmpp.org/extensions/xep-0096.html">XEP-0096</a> file transfer. (See
* {@link FileTransferManager})
*
* @param listener the listener to register
*/
public void addIncomingBytestreamListener(BytestreamListener listener) {
this.allRequestListeners.add(listener);
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:18,代码来源:InBandBytestreamManager.java
示例8: removeIncomingBytestreamListener
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
/**
* Removes the given listener from the list of listeners for all incoming In-Band Bytestream
* requests.
*
* @param listener the listener to remove
*/
public void removeIncomingBytestreamListener(BytestreamListener listener) {
this.allRequestListeners.remove(listener);
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:10,代码来源:InBandBytestreamManager.java
示例9: getUserListener
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
/**
* Returns the {@link InBandBytestreamListener} that should be informed if a In-Band Bytestream
* request from the given initiator JID is received.
*
* @param initiator the initiator's JID
* @return the listener
*/
protected BytestreamListener getUserListener(String initiator) {
return this.userListeners.get(initiator);
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:11,代码来源:InBandBytestreamManager.java
示例10: getAllRequestListeners
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
/**
* Returns a list of {@link InBandBytestreamListener} that are informed if there are no
* listeners for a specific initiator.
*
* @return list of listeners
*/
protected List<BytestreamListener> getAllRequestListeners() {
return this.allRequestListeners;
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:10,代码来源:InBandBytestreamManager.java
示例11: addIncomingBytestreamListener
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
/**
* Adds BytestreamListener that is called for every incoming SOCKS5 Bytestream request unless
* there is a user specific BytestreamListener registered.
* <p>
* If no listeners are registered all SOCKS5 Bytestream request are rejected with a
* <not-acceptable/> error.
* <p>
* Note that the registered {@link BytestreamListener} will NOT be notified on incoming Socks5
* bytestream requests sent in the context of <a
* href="http://xmpp.org/extensions/xep-0096.html">XEP-0096</a> file transfer. (See
* {@link FileTransferManager})
*
* @param listener the listener to register
*/
public void addIncomingBytestreamListener(BytestreamListener listener) {
this.allRequestListeners.add(listener);
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:18,代码来源:Socks5BytestreamManager.java
示例12: removeIncomingBytestreamListener
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
/**
* Removes the given listener from the list of listeners for all incoming SOCKS5 Bytestream
* requests.
*
* @param listener the listener to remove
*/
public void removeIncomingBytestreamListener(BytestreamListener listener) {
this.allRequestListeners.remove(listener);
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:10,代码来源:Socks5BytestreamManager.java
示例13: getUserListener
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
/**
* Returns the {@link BytestreamListener} that should be informed if a SOCKS5 Bytestream request
* from the given initiator JID is received.
*
* @param initiator the initiator's JID
* @return the listener
*/
protected BytestreamListener getUserListener(String initiator) {
return this.userListeners.get(initiator);
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:11,代码来源:Socks5BytestreamManager.java
示例14: getAllRequestListeners
import org.jivesoftware.smackx.bytestreams.BytestreamListener; //导入依赖的package包/类
/**
* Returns a list of {@link BytestreamListener} that are informed if there are no listeners for
* a specific initiator.
*
* @return list of listeners
*/
protected List<BytestreamListener> getAllRequestListeners() {
return this.allRequestListeners;
}
开发者ID:TTalkIM,项目名称:Smack,代码行数:10,代码来源:Socks5BytestreamManager.java
注:本文中的org.jivesoftware.smackx.bytestreams.BytestreamListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论