• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java GetNewMemberRoomsRequest类的典型用法和代码示例

java 2次浏览

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

GetNewMemberRoomsRequest类属于org.jivesoftware.openfire.muc.cluster包,在下文中一共展示了GetNewMemberRoomsRequest类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: joinedCluster

点赞 3

import org.jivesoftware.openfire.muc.cluster.GetNewMemberRoomsRequest; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void joinedCluster(byte[] nodeID) {
    Object result = CacheFactory.doSynchronousClusterTask(new GetNewMemberRoomsRequest(), nodeID);
    if (result instanceof List<?>) {
        List<RoomInfo> rooms = (List<RoomInfo>) result;
        for (RoomInfo roomInfo : rooms) {
            LocalMUCRoom remoteRoom = roomInfo.getRoom();
            MultiUserChatServiceImpl service = (MultiUserChatServiceImpl)remoteRoom.getMUCService();
            LocalMUCRoom localRoom = service.getLocalChatRoom(remoteRoom.getName());
            if (localRoom == null) {
                // Create local room with remote information
                localRoom = remoteRoom;
                service.chatRoomAdded(localRoom);
            }
            // Add remote occupants to local room
            for (OccupantAddedEvent event : roomInfo.getOccupants()) {
                event.setSendPresence(true);
                event.run();
            }
        }
    }
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:24,
代码来源:MultiUserChatManager.java

示例2: joinedCluster

点赞 3

import org.jivesoftware.openfire.muc.cluster.GetNewMemberRoomsRequest; //导入依赖的package包/类
public void joinedCluster(byte[] nodeID) {
    @SuppressWarnings("unchecked")
    List<RoomInfo> result =
            (List<RoomInfo>) CacheFactory.doSynchronousClusterTask(new GetNewMemberRoomsRequest(), nodeID);
    if (result != null) {
        for (RoomInfo roomInfo : result) {
            LocalMUCRoom remoteRoom = roomInfo.getRoom();
            MultiUserChatServiceImpl service = (MultiUserChatServiceImpl)remoteRoom.getMUCService();
            LocalMUCRoom localRoom = service.getLocalChatRoom(remoteRoom.getName());
            if (localRoom == null) {
                // Create local room with remote information
                localRoom = remoteRoom;
                service.chatRoomAdded(localRoom);
            }
            // Add remote occupants to local room
            for (OccupantAddedEvent event : roomInfo.getOccupants()) {
                event.setSendPresence(true);
                event.run();
            }
        }
    }
}
 

开发者ID:coodeer,
项目名称:g3server,
代码行数:23,
代码来源:MultiUserChatManager.java

示例3: joinedCluster

点赞 3

import org.jivesoftware.openfire.muc.cluster.GetNewMemberRoomsRequest; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void joinedCluster(byte[] nodeID) {
    Object result = CacheFactory.doSynchronousClusterTask(new GetNewMemberRoomsRequest(), nodeID);
    if (result instanceof List<?>) {
        List<RoomInfo> rooms = (List<RoomInfo>) result;
        for (RoomInfo roomInfo : rooms) {
            LocalMUCRoom remoteRoom = roomInfo.getRoom();
            MultiUserChatServiceImpl service = (MultiUserChatServiceImpl)remoteRoom.getMUCService();
            LocalMUCRoom localRoom = service.getLocalChatRoom(remoteRoom.getName());
            if (localRoom == null) {
                // Create local room with remote information
                localRoom = remoteRoom;
                service.chatRoomAdded(localRoom);
            }
            // Add remote occupants to local room
            for (OccupantAddedEvent event : roomInfo.getOccupants()) {
                event.setSendPresence(true);
                event.run();
            }
        }
    }
}
 

开发者ID:idwanglu2010,
项目名称:openfire,
代码行数:23,
代码来源:MultiUserChatManager.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)