本文整理了Java中org.jivesoftware.openfire.XMPPServer.getSessionManager()
方法的一些代码示例,展示了XMPPServer.getSessionManager()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMPPServer.getSessionManager()
方法的具体详情如下:
包路径:org.jivesoftware.openfire.XMPPServer
类名称:XMPPServer
方法名:getSessionManager
[英]Returns the SessionManager
registered with this server. The SessionManager
was registered with the server as a module while starting up the server.
[中]返回在此服务器上注册的SessionManager
。启动服务器时,SessionManager
已作为模块注册到服务器。
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns the instance of <CODE>SessionManagerImpl</CODE> being used by the XMPPServer.
*
* @return the instance of <CODE>SessionManagerImpl</CODE> being used by the XMPPServer.
*/
public static SessionManager getInstance() {
return XMPPServer.getInstance().getSessionManager();
}
代码示例来源:origin: igniterealtime/Openfire
public SessionManager getSessionManager() {
return getXMPPServer().getSessionManager();
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
deliverer = server.getPacketDeliverer();
sessionManager = server.getSessionManager();
}
}
代码示例来源:origin: igniterealtime/Openfire
Session session = XMPPServer.getInstance().getSessionManager().getOutgoingServerSession(pair);
StringBuilder certs = new StringBuilder();
if (session != null) {
代码示例来源:origin: igniterealtime/Openfire
private ConnectionMultiplexerManager() {
sessionManager = XMPPServer.getInstance().getSessionManager();
// Start thread that will send heartbeats to Connection Managers every 30 seconds
// to keep connections open.
TimerTask heartbeatTask = new TimerTask() {
@Override
public void run() {
try {
for (ConnectionMultiplexerSession session : sessionManager.getConnectionMultiplexerSessions()) {
session.deliverRawText(" ");
}
}
catch(Exception e) {
Log.error(e.getMessage(), e);
}
}
};
TaskEngine.getInstance().schedule(heartbeatTask, 30*JiveConstants.SECOND, 30*JiveConstants.SECOND);
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void serverStopping() {
for (ClientSession session : XMPPServer.getInstance().getSessionManager().getSessions()) {
if (!session.isAnonymousUser()) {
try {
writeToDatabase(session.getUsername(), null, new Date());
} catch (UserNotFoundException e) {
Log.error(e.getMessage(), e);
}
}
}
}
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Logs the status of the session.
*/
private void logSessionStatus() {
final DomainPair pair = new DomainPair(XMPPServer.getInstance().getServerInfo().getXMPPDomain(), domain);
OutgoingServerSession session = XMPPServer.getInstance().getSessionManager().getOutgoingServerSession(pair);
if (session != null) {
int connectionStatus = session.getStatus();
switch(connectionStatus) {
case Session.STATUS_CONNECTED:
Log.info("Session is connected.");
break;
case Session.STATUS_CLOSED:
Log.info("Session is closed.");
break;
case Session.STATUS_AUTHENTICATED:
Log.info("Session is authenticated.");
break;
}
} else {
Log.info("Failed to establish server to server session.");
}
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void destroy()
{
// terminate any active websocket sessions
SessionManager sm = XMPPServer.getInstance().getSessionManager();
for (ClientSession session : sm.getSessions()) {
if (session instanceof LocalSession) {
Object ws = ((LocalSession) session).getSessionData("ws");
if (ws != null && (Boolean) ws) {
Log.debug( "Closing session as websocket servlet is being destroyed: {}", session );
session.close();
}
}
}
super.destroy();
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
messageStrategy = server.getOfflineMessageStrategy();
routingTable = server.getRoutingTable();
sessionManager = server.getSessionManager();
multicastRouter = server.getMulticastRouter();
userManager = server.getUserManager();
serverName = server.getServerInfo().getXMPPDomain();
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
TaskEngine.getInstance().scheduleAtFixedRate(new TimeoutTask(), 5000, 5000);
serverName = server.getServerInfo().getXMPPDomain();
routingTable = server.getRoutingTable();
multicastRouter = server.getMulticastRouter();
iqHandlers.addAll(server.getIQHandlers());
sessionManager = server.getSessionManager();
userManager = server.getUserManager();
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
sessionManager = server.getSessionManager();
// In some cases, the domain name of the server may not be the actual address of the machine
// (ie, when using DNS SRV records). In that case, the "mediaproxy.externalip" property should be
// set to the IP address of the actual server where the media proxy is listening.
String ipAddress = JiveGlobals.getProperty("mediaproxy.externalip", server.getServerInfo().getXMPPDomain());
mediaProxy = new MediaProxy(ipAddress);
String defaultName = "rtpbridge";
serviceName = JiveGlobals.getProperty("mediaproxy.serviceName", defaultName);
serviceName = serviceName.equals("") ? defaultName : serviceName;
echoPort = JiveGlobals.getIntProperty("mediaproxy.echoPort", echoPort);
routingTable = server.getRoutingTable();
router = server.getPacketRouter();
initMediaProxy();
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
serverName = server.getServerInfo().getXMPPDomain();
routingTable = server.getRoutingTable();
updateHandler = server.getPresenceUpdateHandler();
subscribeHandler = server.getPresenceSubscribeHandler();
presenceManager = server.getPresenceManager();
multicastRouter = server.getMulticastRouter();
sessionManager = server.getSessionManager();
entityCapsManager = EntityCapabilitiesManager.getInstance();
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
this.server = server;
offlinePresenceCache = CacheFactory.createCache("Offline Presence Cache");
lastActivityCache = CacheFactory.createCache("Last Activity Cache");
deliverer = server.getPacketDeliverer();
sessionManager = server.getSessionManager();
userManager = server.getUserManager();
presenceUpdateHandler = server.getPresenceUpdateHandler();
rosterManager = server.getRosterManager();
routingTable = server.getRoutingTable();
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
localServer = server;
rosterManager = server.getRosterManager();
presenceManager = server.getPresenceManager();
deliverer = server.getPacketDeliverer();
messageStore = server.getOfflineMessageStore();
sessionManager = server.getSessionManager();
userManager = server.getUserManager();
routingTable = server.getRoutingTable();
directedPresencesCache = CacheFactory.createCache(PRESENCE_CACHE_NAME);
// TODO Add as route listener (to remove direct presences info for removed routes). Mainly for c2s sessions which is uncommon.
// Listen to cluster events
ClusterManager.addListener(this);
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
/**
* Returns the instance of <CODE>SessionManagerImpl</CODE> being used by the XMPPServer.
*
* @return the instance of <CODE>SessionManagerImpl</CODE> being used by the XMPPServer.
*/
public static SessionManager getInstance() {
return XMPPServer.getInstance().getSessionManager();
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
deliverer = server.getPacketDeliverer();
sessionManager = server.getSessionManager();
}
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
TaskEngine.getInstance().scheduleAtFixedRate(new TimeoutTask(), 5000, 5000);
serverName = server.getServerInfo().getXMPPDomain();
routingTable = server.getRoutingTable();
multicastRouter = server.getMulticastRouter();
iqHandlers.addAll(server.getIQHandlers());
sessionManager = server.getSessionManager();
userManager = server.getUserManager();
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
messageStrategy = server.getOfflineMessageStrategy();
routingTable = server.getRoutingTable();
sessionManager = server.getSessionManager();
multicastRouter = server.getMulticastRouter();
userManager = server.getUserManager();
serverName = server.getServerInfo().getXMPPDomain();
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
@Override
public void initialize(XMPPServer server) {
super.initialize(server);
serverName = server.getServerInfo().getXMPPDomain();
routingTable = server.getRoutingTable();
updateHandler = server.getPresenceUpdateHandler();
subscribeHandler = server.getPresenceSubscribeHandler();
presenceManager = server.getPresenceManager();
multicastRouter = server.getMulticastRouter();
sessionManager = server.getSessionManager();
entityCapsManager = EntityCapabilitiesManager.getInstance();
}
代码示例来源:origin: net.gltd.gtms/gtmsutil
public void disconnectXmppSessionAndDestroyGtmsSession(JID jid) throws SessionNotFoundException {
T session = getSessionManager().getSession(jid);
GtmsSystemRegistration registration = session.getRegistration();
Session xmppSession = XMPPServer.getInstance().getSessionManager().getSession(new JID(session.getJID().toBareJID() + registration.getProfile()));
if (xmppSession != null) {
xmppSession.close();
} else {
destroySession(session);
}
}
内容来源于网络,如有侵权,请联系作者删除!