本文整理了Java中org.jivesoftware.openfire.XMPPServer.getIQRouter()
方法的一些代码示例,展示了XMPPServer.getIQRouter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMPPServer.getIQRouter()
方法的具体详情如下:
包路径:org.jivesoftware.openfire.XMPPServer
类名称:XMPPServer
方法名:getIQRouter
[英]Returns the IQRouter
registered with this server. The IQRouter
was registered with the server as a module while starting up the server.
[中]返回在此服务器上注册的IQRouter
。启动服务器时,IQRouter
已作为模块注册到服务器。
代码示例来源:origin: igniterealtime/Openfire
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
this.server = server;
this.packetRouter = server.getPacketRouter();
this.iqRouter = server.getIQRouter();
}
代码示例来源:origin: igniterealtime/Openfire
private void configureStream() {
StringBuilder sb = new StringBuilder(250);
sb.append("<stream:features xmlns:stream='http://etherx.jabber.org/streams'>");
if (saslStatus == null) {
// Include available SASL Mechanisms
sb.append(SASLAuthentication.getSASLMechanisms(xmppSession));
if (XMPPServer.getInstance().getIQRouter().supports("jabber:iq:auth")) {
sb.append("<auth xmlns='http://jabber.org/features/iq-auth'/>");
}
} else if (saslStatus.equals(Status.authenticated)) {
// Include Stream features
sb.append(String.format("<bind xmlns='%s'/>", "urn:ietf:params:xml:ns:xmpp-bind"));
sb.append(String.format("<session xmlns='%s'><optional/></session>", "urn:ietf:params:xml:ns:xmpp-session"));
if (StreamManager.isStreamManagementActive()) {
sb.append(String.format("<sm xmlns='%s'/>", StreamManager.NAMESPACE_V3));
}
}
// Add XEP-0115 entity capabilities for the server, so that peer can skip service discovery.
final String ver = EntityCapabilitiesManager.getLocalDomainVerHash();
if ( ver != null ) {
sb.append( String.format( "<c xmlns=\"http://jabber.org/protocol/caps\" hash=\"sha-1\" node=\"%s\" ver=\"%s\"/>", EntityCapabilitiesManager.OPENFIRE_IDENTIFIER_NODE, ver ) );
}
sb.append("</stream:features>");
deliver(sb.toString());
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
iqRouter = server.getIQRouter();
messageRouter = server.getMessageRouter();
presenceRouter = server.getPresenceRouter();
}
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public IQ query(Component component, IQ packet, long timeout) throws ComponentException {
final LinkedBlockingQueue<IQ> answer = new LinkedBlockingQueue<>(8);
XMPPServer.getInstance().getIQRouter().addIQResultListener(packet.getID(), new IQResultListener() {
@Override
public void receivedAnswer(IQ packet) {
answer.offer(packet);
}
@Override
public void answerTimeout(String packetId) {
Log.warn("An answer to a previously sent IQ stanza was never received. Packet id: " + packetId);
}
});
sendPacket(component, packet);
IQ reply = null;
try {
reply = answer.poll(timeout, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
// Ignore
}
return reply;
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void query(Component component, IQ packet, IQResultListener listener) throws ComponentException {
XMPPServer.getInstance().getIQRouter().addIQResultListener(packet.getID(), listener);
sendPacket(component, packet);
}
代码示例来源:origin: igniterealtime/Openfire
if ( XMPPServer.getInstance().getIQRouter().supports( "jabber:iq:auth" ) ) {
sb.append("<auth xmlns=\"http://jabber.org/features/iq-auth\"/>");
代码示例来源:origin: igniterealtime/Openfire
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
this.server = server;
serverName = server.getServerInfo().getXMPPDomain();
iqRouter = server.getIQRouter();
messageRouter = server.getMessageRouter();
presenceRouter = server.getPresenceRouter();
presenceUpdateHandler = server.getPresenceUpdateHandler();
// Listen to cluster events
ClusterManager.addListener(this);
}
代码示例来源:origin: igniterealtime/Openfire
XMPPServer.getInstance().getIQRouter().route( pingRequest );
代码示例来源:origin: igniterealtime/Openfire
verAttributes.put(packetId, caps);
final IQRouter iqRouter = XMPPServer.getInstance().getIQRouter();
iqRouter.addIQResultListener(packetId, this);
iqRouter.route(iq);
代码示例来源:origin: igniterealtime/Openfire
server.getIQRouter().addIQResultListener(iq.getID(), this);
synchronized ((user.toBareJID() + MUTEX_SUFFIX).intern()) {
server.getIQRouter().route(iq);
代码示例来源:origin: igniterealtime/Openfire
if (XMPPServer.getInstance().getIQRouter().supports("jabber:iq:auth")) {
child.addElement("auth", "http://jabber.org/features/iq-auth");
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
this.server = server;
this.packetRouter = server.getPacketRouter();
this.iqRouter = server.getIQRouter();
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
private void configureStream() {
StringBuilder sb = new StringBuilder(250);
sb.append("<stream:features xmlns:stream='http://etherx.jabber.org/streams'>");
if (saslStatus == null) {
// Include available SASL Mechanisms
sb.append(SASLAuthentication.getSASLMechanisms(xmppSession));
if (XMPPServer.getInstance().getIQRouter().supports("jabber:iq:auth")) {
sb.append("<auth xmlns='http://jabber.org/features/iq-auth'/>");
}
} else if (saslStatus.equals(Status.authenticated)) {
// Include Stream features
sb.append(String.format("<bind xmlns='%s'/>", "urn:ietf:params:xml:ns:xmpp-bind"));
sb.append(String.format("<session xmlns='%s'><optional/></session>", "urn:ietf:params:xml:ns:xmpp-session"));
if (isStreamManagementAvailable()) {
sb.append(String.format("<sm xmlns='%s'/>", StreamManager.NAMESPACE_V3));
}
}
sb.append("</stream:features>");
deliver(sb.toString());
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
iqRouter = server.getIQRouter();
messageRouter = server.getMessageRouter();
presenceRouter = server.getPresenceRouter();
}
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
@Override
public IQ query(Component component, IQ packet, long timeout) throws ComponentException {
final LinkedBlockingQueue<IQ> answer = new LinkedBlockingQueue<>(8);
XMPPServer.getInstance().getIQRouter().addIQResultListener(packet.getID(), new IQResultListener() {
@Override
public void receivedAnswer(IQ packet) {
answer.offer(packet);
}
@Override
public void answerTimeout(String packetId) {
Log.warn("An answer to a previously sent IQ stanza was never received. Packet id: " + packetId);
}
});
sendPacket(component, packet);
IQ reply = null;
try {
reply = answer.poll(timeout, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
// Ignore
}
return reply;
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
@Override
public void query(Component component, IQ packet, IQResultListener listener) throws ComponentException {
XMPPServer.getInstance().getIQRouter().addIQResultListener(packet.getID(), listener);
sendPacket(component, packet);
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
if ( XMPPServer.getInstance().getIQRouter().supports( "jabber:iq:auth" ) ) {
sb.append("<auth xmlns=\"http://jabber.org/features/iq-auth\"/>");
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
this.server = server;
serverName = server.getServerInfo().getXMPPDomain();
iqRouter = server.getIQRouter();
messageRouter = server.getMessageRouter();
presenceRouter = server.getPresenceRouter();
presenceUpdateHandler = server.getPresenceUpdateHandler();
// Listen to cluster events
ClusterManager.addListener(this);
}
代码示例来源:origin: igniterealtime/Openfire-Meetings
public void sessionDestroyed(Session session)
{
Log.debug("OfMeet Plugin - sessionDestroyed "+ session.getAddress().toString() + "\n" + ((ClientSession) session).getPresence().toXML());
boolean skypeAvailable = XMPPServer.getInstance().getPluginManager().getPlugin("ofskype") != null;
if (OfMeetAzure.skypeids.containsKey(session.getAddress().getNode()))
{
String sipuri = OfMeetAzure.skypeids.remove(session.getAddress().getNode());
IQ iq = new IQ(IQ.Type.set);
iq.setFrom(session.getAddress());
iq.setTo(XMPPServer.getInstance().getServerInfo().getXMPPDomain());
Element child = iq.setChildElement("request", "http://igniterealtime.org/protocol/ofskype");
child.setText("{'action':'stop_skype_user', 'sipuri':'" + sipuri + "'}");
XMPPServer.getInstance().getIQRouter().route(iq);
Log.info("OfMeet Plugin - closing skype session " + sipuri);
}
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
if (XMPPServer.getInstance().getIQRouter().supports("jabber:iq:auth")) {
child.addElement("auth", "http://jabber.org/features/iq-auth");
内容来源于网络,如有侵权,请联系作者删除!