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


Java XMPPServer.getSessionManager方法代码示例

本文整理汇总了Java中org.jivesoftware.openfire.XMPPServer.getSessionManager方法的典型用法代码示例。如果您正苦于以下问题:Java XMPPServer.getSessionManager方法的具体用法?Java XMPPServer.getSessionManager怎么用?Java XMPPServer.getSessionManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jivesoftware.openfire.XMPPServer的用法示例。


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

示例1: logout

import org.jivesoftware.openfire.XMPPServer; //导入方法依赖的package包/类
/**
 * Disconnect an XMPP session of a user identified by an oauth token.
 * @param headers
 * @return
 */
@DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("logout")
public Response logout(@Context HttpHeaders headers) {
  TokenInfo tokenInfo = RestUtils.getAuthTokenInfo(headers);
  if (tokenInfo == null) {
    return RestUtils.getUnauthJAXRSResp();
  }
  
  JID from = RestUtils.createJID(tokenInfo);
  XMPPServer xmppSrv = XMPPServer.getInstance();
  SessionManager sessionMgr = xmppSrv.getSessionManager();
  ClientSession session = sessionMgr.getSession(from);
  if (session == null) {
    ErrorResponse response = new ErrorResponse(ErrorCode.USER_NOT_LOGIN,
        String.format("Session is not found: %s [%s]", from, tokenInfo.getUserName()));
    return RestUtils.getJAXRSResp(Response.Status.GONE, response);
  }
  // Terminate the session now.
  session.close();
  return RestUtils.getOKJAXRSResp();
}
 
开发者ID:magnetsystems,项目名称:message-server,代码行数:28,代码来源:UserResource.java

示例2: initialize

import org.jivesoftware.openfire.XMPPServer; //导入方法依赖的package包/类
@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);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:17,代码来源:PresenceUpdateHandler.java

示例3: initialize

import org.jivesoftware.openfire.XMPPServer; //导入方法依赖的package包/类
@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();
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:23,代码来源:MediaProxyService.java

示例4: initialize

import org.jivesoftware.openfire.XMPPServer; //导入方法依赖的package包/类
@Override
public void initialize(XMPPServer server) {
       super.initialize(server);
       this.server = server;
       serverName = server.getServerInfo().getXMPPDomain();
       router = server.getPacketRouter();
       routingTable = server.getRoutingTable();
       deliverer = server.getPacketDeliverer();
       sessionManager = server.getSessionManager();
       // Check if we need to configure MINA to use Direct or Heap Buffers
       // Note: It has been reported that heap buffers are 50% faster than direct buffers
       if (JiveGlobals.getBooleanProperty("xmpp.socket.heapBuffer", true)) {
           ByteBuffer.setUseDirectBuffers(false);
           ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
       }
   }
 
开发者ID:coodeer,项目名称:g3server,代码行数:17,代码来源:ConnectionManagerImpl.java

示例5: initialize

import org.jivesoftware.openfire.XMPPServer; //导入方法依赖的package包/类
@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);
   }
 
开发者ID:coodeer,项目名称:g3server,代码行数:17,代码来源:PresenceUpdateHandler.java

示例6: initialize

import org.jivesoftware.openfire.XMPPServer; //导入方法依赖的package包/类
@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();
   }
 
开发者ID:coodeer,项目名称:g3server,代码行数:23,代码来源:MediaProxyService.java

示例7: initialize

import org.jivesoftware.openfire.XMPPServer; //导入方法依赖的package包/类
@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();
   }
 
开发者ID:coodeer,项目名称:g3server,代码行数:16,代码来源:PresenceManagerImpl.java

示例8: initialize

import org.jivesoftware.openfire.XMPPServer; //导入方法依赖的package包/类
@Override
public void initialize(XMPPServer server) {
       super.initialize(server);
       serverName = server.getServerInfo().getXMPPDomain();
       router = server.getPacketRouter();
       routingTable = server.getRoutingTable();
       deliverer = server.getPacketDeliverer();
       sessionManager = server.getSessionManager();
       // Check if we need to configure MINA to use Direct or Heap Buffers
       // Note: It has been reported that heap buffers are 50% faster than direct buffers
       if (JiveGlobals.getBooleanProperty("xmpp.socket.heapBuffer", true)) {
           ByteBuffer.setUseDirectBuffers(false);
           ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
       }
   }
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:16,代码来源:ConnectionManagerImpl.java

示例9: initialize

import org.jivesoftware.openfire.XMPPServer; //导入方法依赖的package包/类
@Override
public void initialize(XMPPServer server) {
    super.initialize(server);
    deliverer = server.getPacketDeliverer();
    sessionManager = server.getSessionManager();
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:7,代码来源:IQHandler.java

示例10: initialize

import org.jivesoftware.openfire.XMPPServer; //导入方法依赖的package包/类
@Override
public void initialize(XMPPServer server) {
       super.initialize(server);
       deliverer = server.getPacketDeliverer();
       sessionManager = server.getSessionManager();
   }
 
开发者ID:coodeer,项目名称:g3server,代码行数:7,代码来源:IQHandler.java


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