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


Java ClientSession.incrementConflictCount方法代码示例

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


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

示例1: run

import org.jivesoftware.openfire.session.ClientSession; //导入方法依赖的package包/类
public void run() {
    if (getSession() == null || getSession().isClosed()) {
        logger.error("Session not found for JID: " + address);
        return;
    }
    super.run();

    ClientSession session = (ClientSession) getSession();
    if (session instanceof RemoteClientSession) {
        // The session is being hosted by other cluster node so log this unexpected case
        Cache<String, ClientRoute> usersCache = CacheFactory.createCache(RoutingTableImpl.C2S_CACHE_NAME);
        ClientRoute route = usersCache.get(address.toString());
        NodeID nodeID = route.getNodeID();

        logger.warn("Found remote session instead of local session. JID: " + address + " found in Node: " +
                nodeID.toByteArray() + " and local node is: " + XMPPServer.getInstance().getNodeID().toByteArray());
    }
    if (operation == Operation.isInitialized) {
        if (session instanceof RemoteClientSession) {
            // Something is wrong since the session shoud be local instead of remote
            // Assume some default value
            result = true;
        }
        else {
            result = session.isInitialized();
        }
    }
    else if (operation == Operation.incrementConflictCount) {
        if (session instanceof RemoteClientSession) {
            // Something is wrong since the session shoud be local instead of remote
            // Assume some default value
            result = 2;
        }
        else {
            result = session.incrementConflictCount();
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:39,代码来源:ClientSessionTask.java

示例2: run

import org.jivesoftware.openfire.session.ClientSession; //导入方法依赖的package包/类
public void run() {
    super.run();

    ClientSession session = (ClientSession) getSession();
    if (session instanceof RemoteClientSession) {
        // The session is being hosted by other cluster node so log this unexpected case
        Cache<String, ClientRoute> usersCache = CacheFactory.createCache(RoutingTableImpl.C2S_CACHE_NAME);
        ClientRoute route = usersCache.get(address.toString());
        NodeID nodeID = route.getNodeID();

        Log.warn("Found remote session instead of local session. JID: " + address + " found in Node: " +
                nodeID.toByteArray() + " and local node is: " + XMPPServer.getInstance().getNodeID().toByteArray());
    }
    if (operation == Operation.isInitialized) {
        if (session instanceof RemoteClientSession) {
            // Something is wrong since the session shoud be local instead of remote
            // Assume some default value
            result = true;
        }
        else {
            result = session.isInitialized();
        }
    }
    else if (operation == Operation.incrementConflictCount) {
        if (session instanceof RemoteClientSession) {
            // Something is wrong since the session shoud be local instead of remote
            // Assume some default value
            result = 2;
        }
        else {
            result = session.incrementConflictCount();
        }
    }
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:35,代码来源:ClientSessionTask.java

示例3: run

import org.jivesoftware.openfire.session.ClientSession; //导入方法依赖的package包/类
public void run() {
	if (getSession() == null || getSession().isClosed()) {
		logger.error("Session not found for JID: " + address);
		return;
	}
    super.run();

    ClientSession session = (ClientSession) getSession();
    if (session instanceof RemoteClientSession) {
        // The session is being hosted by other cluster node so log this unexpected case
        Cache<String, ClientRoute> usersCache = CacheFactory.createCache(RoutingTableImpl.C2S_CACHE_NAME);
        ClientRoute route = usersCache.get(address.toString());
        NodeID nodeID = route.getNodeID();

        logger.warn("Found remote session instead of local session. JID: " + address + " found in Node: " +
                nodeID.toByteArray() + " and local node is: " + XMPPServer.getInstance().getNodeID().toByteArray());
    }
    if (operation == Operation.isInitialized) {
        if (session instanceof RemoteClientSession) {
            // Something is wrong since the session shoud be local instead of remote
            // Assume some default value
            result = true;
        }
        else {
            result = session.isInitialized();
        }
    }
    else if (operation == Operation.incrementConflictCount) {
        if (session instanceof RemoteClientSession) {
            // Something is wrong since the session shoud be local instead of remote
            // Assume some default value
            result = 2;
        }
        else {
            result = session.incrementConflictCount();
        }
    }
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:39,代码来源:ClientSessionTask.java


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