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


Java ClusterManager.isClusteringStarted方法代码示例

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


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

示例1: addSession

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
/**
 * Add a new session to be managed. The session has been authenticated and resource
 * binding has been done.
 *
 * @param session the session that was authenticated.
 */
public void addSession(LocalClientSession session) {
    // Add session to the routing table (routing table will know session is not available yet)
    routingTable.addClientRoute(session.getAddress(), session);
    // Remove the pre-Authenticated session but remember to use the temporary ID as the key
    localSessionManager.getPreAuthenticatedSessions().remove(session.getStreamID().toString());
    SessionEventDispatcher.EventType event = session.getAuthToken().isAnonymous() ?
            SessionEventDispatcher.EventType.anonymous_session_created :
            SessionEventDispatcher.EventType.session_created;
    // Fire session created event.
    SessionEventDispatcher.dispatchEvent(session, event);
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        sessionInfoCache.put(session.getAddress().toString(), new ClientSessionInfo(session));
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:22,代码来源:SessionManager.java

示例2: addSession

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
/**
 * Add a new session to be managed. The session has been authenticated and resource
 * binding has been done.
 *
 * @param session the session that was authenticated.
 */
public void addSession(LocalClientSession session) {
    // Remove the pre-Authenticated session but remember to use the temporary ID as the key
    localSessionManager.getPreAuthenticatedSessions().remove(session.getStreamID().toString());
    // Add session to the routing table (routing table will know session is not available yet)
    routingTable.addClientRoute(session.getAddress(), session);
    SessionEventDispatcher.EventType event = session.getAuthToken().isAnonymous() ?
            SessionEventDispatcher.EventType.anonymous_session_created :
            SessionEventDispatcher.EventType.session_created;
    // Fire session created event.
    SessionEventDispatcher.dispatchEvent(session, event);
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        sessionInfoCache.put(session.getAddress().toString(), new ClientSessionInfo(session));
    }
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:22,代码来源:SessionManager.java

示例3: run

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
@Override
public void run() {
    if (ClusterManager.isClusteringStarted() && !ClusterManager.isSeniorClusterMember()) {
        // Do nothing if we are in a cluster and this JVM is not the senior cluster member
        return;
    }
    try {
        localMUCRoomManager.cleanupRooms(getCleanupDate());
    }
    catch (Throwable e) {
        Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:14,代码来源:MultiUserChatServiceImpl.java

示例4: setActiveList

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
/**
 * Sets the Privacy list that overrides the default privacy list. This list affects
 * only this session and only for the duration of the session.
 *
 * @param activeList the Privacy list that overrides the default privacy list.
 */
@Override
public void setActiveList(PrivacyList activeList) {
    this.activeList = activeList != null ? activeList.getName() : null;
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        Cache<String,ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
        cache.put(getAddress().toString(), new ClientSessionInfo(this));
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:16,代码来源:LocalClientSession.java

示例5: setDefaultList

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
/**
 * Sets the default Privacy list used for the session's user. This list is
 * processed if there is no active list set for the session.
 *
 * @param defaultList the default Privacy list used for the session's user.
 */
@Override
public void setDefaultList(PrivacyList defaultList) {
    // Do nothing if nothing has changed
    if ((this.defaultList == null && defaultList == null) ||
            (defaultList != null && defaultList.getName().equals(this.defaultList))) {
        return;
    }
    this.defaultList = defaultList != null ? defaultList.getName() : null;
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        Cache<String,ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
        cache.put(getAddress().toString(), new ClientSessionInfo(this));
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:LocalClientSession.java

示例6: setPresence

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
/**
 * Set the presence of this session
 *
 * @param presence The presence for the session
 */
@Override
public void setPresence(Presence presence) {
    Presence oldPresence = this.presence;
    this.presence = presence;
    if (oldPresence.isAvailable() && !this.presence.isAvailable()) {
        // The client is no longer available
        sessionManager.sessionUnavailable(this);
        // Mark that the session is no longer initialized. This means that if the user sends
        // an available presence again the session will be initialized again thus receiving
        // offline messages and offline presence subscription requests
        setInitialized(false);
        // Notify listeners that the session is no longer available
        PresenceEventDispatcher.unavailableSession(this, presence);
    }
    else if (!oldPresence.isAvailable() && this.presence.isAvailable()) {
        // The client is available
        sessionManager.sessionAvailable(this, presence);
        wasAvailable = true;
        // Notify listeners that the session is now available
        PresenceEventDispatcher.availableSession(this, presence);
    }
    else if (this.presence.isAvailable() && oldPresence.getPriority() != this.presence.getPriority())
    {
        // The client has changed the priority of his presence
        sessionManager.changePriority(this, oldPresence.getPriority());
        // Notify listeners that the priority of the session/resource has changed
        PresenceEventDispatcher.presenceChanged(this, presence);
    }
    else if (this.presence.isAvailable()) {
        // Notify listeners that the show or status value of the presence has changed
        PresenceEventDispatcher.presenceChanged(this, presence);
    }
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        Cache<String,ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
        cache.put(getAddress().toString(), new ClientSessionInfo(this));
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:44,代码来源:LocalClientSession.java

示例7: run

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
@Override
public void run() {
          if (ClusterManager.isClusteringStarted() && !ClusterManager.isSeniorClusterMember()) {
              // Do nothing if we are in a cluster and this JVM is not the senior cluster member
              return;
          }
          try {
              cleanupRooms();
          }
          catch (Throwable e) {
              Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
          }
      }
 
开发者ID:coodeer,项目名称:g3server,代码行数:14,代码来源:MultiUserChatServiceImpl.java

示例8: setActiveList

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
/**
 * Sets the Privacy list that overrides the default privacy list. This list affects
 * only this session and only for the duration of the session.
 *
 * @param activeList the Privacy list that overrides the default privacy list.
 */
public void setActiveList(PrivacyList activeList) {
    this.activeList = activeList != null ? activeList.getName() : null;
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        Cache<String,ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
        cache.put(getAddress().toString(), new ClientSessionInfo(this));
    }
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:15,代码来源:LocalClientSession.java

示例9: setDefaultList

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
/**
 * Sets the default Privacy list used for the session's user. This list is
 * processed if there is no active list set for the session.
 *
 * @param defaultList the default Privacy list used for the session's user.
 */
public void setDefaultList(PrivacyList defaultList) {
    // Do nothing if nothing has changed
    if ((this.defaultList == null && defaultList == null) ||
            (defaultList != null && defaultList.getName().equals(this.defaultList))) {
        return;
    }
    this.defaultList = defaultList != null ? defaultList.getName() : null;
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        Cache<String,ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
        cache.put(getAddress().toString(), new ClientSessionInfo(this));
    }
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:20,代码来源:LocalClientSession.java

示例10: setPresence

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
/**
 * Set the presence of this session
 *
 * @param presence The presence for the session
 */
public void setPresence(Presence presence) {
    Presence oldPresence = this.presence;
    this.presence = presence;
    if (oldPresence.isAvailable() && !this.presence.isAvailable()) {
        // The client is no longer available
        sessionManager.sessionUnavailable(this);
        // Mark that the session is no longer initialized. This means that if the user sends
        // an available presence again the session will be initialized again thus receiving
        // offline messages and offline presence subscription requests
        setInitialized(false);
        // Notify listeners that the session is no longer available
        PresenceEventDispatcher.unavailableSession(this, presence);
    }
    else if (!oldPresence.isAvailable() && this.presence.isAvailable()) {
        // The client is available
        sessionManager.sessionAvailable(this);
        wasAvailable = true;
        // Notify listeners that the session is now available
        PresenceEventDispatcher.availableSession(this, presence);
    }
    else if (this.presence.isAvailable() && oldPresence.getPriority() != this.presence.getPriority())
    {
        // The client has changed the priority of his presence
        sessionManager.changePriority(this, oldPresence.getPriority());
        // Notify listeners that the priority of the session/resource has changed
        PresenceEventDispatcher.presenceChanged(this, presence);
    }
    else if (this.presence.isAvailable()) {
        // Notify listeners that the show or status value of the presence has changed
        PresenceEventDispatcher.presenceChanged(this, presence);
    }
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        Cache<String,ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
        cache.put(getAddress().toString(), new ClientSessionInfo(this));
    }
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:43,代码来源:LocalClientSession.java

示例11: setPresence

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
/**
 * Set the presence of this session
 *
 * @param presence The presence for the session
 */
public void setPresence(Presence presence) {
    Presence oldPresence = this.presence;
    this.presence = presence;
    if (oldPresence.isAvailable() && !this.presence.isAvailable()) {
        // The client is no longer available
        sessionManager.sessionUnavailable(this);
        // Mark that the session is no longer initialized. This means that if the user sends
        // an available presence again the session will be initialized again thus receiving
        // offline messages and offline presence subscription requests
        setInitialized(false);
        // Notify listeners that the session is no longer available
        PresenceEventDispatcher.unavailableSession(this, presence);
    }
    else if (!oldPresence.isAvailable() && this.presence.isAvailable()) {
        // The client is available
        sessionManager.sessionAvailable(this, presence);
        wasAvailable = true;
        // Notify listeners that the session is now available
        PresenceEventDispatcher.availableSession(this, presence);
    }
    else if (this.presence.isAvailable() && oldPresence.getPriority() != this.presence.getPriority())
    {
        // The client has changed the priority of his presence
        sessionManager.changePriority(this, oldPresence.getPriority());
        // Notify listeners that the priority of the session/resource has changed
        PresenceEventDispatcher.presenceChanged(this, presence);
    }
    else if (this.presence.isAvailable()) {
        // Notify listeners that the show or status value of the presence has changed
        PresenceEventDispatcher.presenceChanged(this, presence);
    }
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        Cache<String,ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
        cache.put(getAddress().toString(), new ClientSessionInfo(this));
    }
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:43,代码来源:LocalClientSession.java

示例12: setOfflineFloodStopped

import org.jivesoftware.openfire.cluster.ClusterManager; //导入方法依赖的package包/类
/**
 * Sets if the user requested to not receive offline messages when sending
 * an available presence. The user may send a disco request with node
 * "http://jabber.org/protocol/offline" so that no offline messages are sent to the
 * user when he becomes online. If the user is connected from many resources then
 * if one of the sessions stopped the flooding then no session should flood the user.
 *
 * @param offlineFloodStopped if the user requested to not receive offline messages when
 *        sending an available presence.
 */
public void setOfflineFloodStopped(boolean offlineFloodStopped) {
    this.offlineFloodStopped = offlineFloodStopped;
    if (ClusterManager.isClusteringStarted()) {
        // Track information about the session and share it with other cluster nodes
        Cache<String,ClientSessionInfo> cache = SessionManager.getInstance().getSessionInfoCache();
        cache.put(getAddress().toString(), new ClientSessionInfo(this));
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:19,代码来源:LocalClientSession.java


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