Package org.openmeetings.app.conference.session

Examples of org.openmeetings.app.conference.session.RoomClient


        for (Iterator<String> iter = MyUserList.keySet().iterator(); iter
            .hasNext();) {
          String key = iter.next();

          RoomClient rcl = MyUserList.get(key);

          if (rcl == null) {
            return true;
          }
          String scopeName = "hibernate";
          if (rcl.getRoom_id() != null) {
            scopeName = rcl.getRoom_id().toString();
          }
          IScope currentScope = scopeApplicationAdapter
              .getRoomScope(scopeName);
          scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope, true);

          HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
          messageObj.put(0, "kick");
          scopeApplicationAdapter.sendMessageById(messageObj,
              rcl.getStreamid(), currentScope);

        }

        return true;
      }
View Full Code Here


      Long user_level = getUserLevelByID(users_id);

      // admins only
      if (authLevelManagement.checkAdminLevel(user_level)) {

        RoomClient rcl = clientListManager
            .getClientByPublicSID(publicSID, false);

        if (rcl == null) {
          return true;
        }

        String scopeName = "hibernate";
        if (rcl.getRoom_id() != null) {
          scopeName = rcl.getRoom_id().toString();
        }
        IScope currentScope = scopeApplicationAdapter
            .getRoomScope(scopeName);

        HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
        messageObj.put(0, "kick");
        scopeApplicationAdapter.sendMessageById(messageObj,
            rcl.getStreamid(), currentScope);

        scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope, true);

        return true;
      }
View Full Code Here

   */
  @SuppressWarnings({ "rawtypes", "unchecked" })
  public int sendMessageWithClient(Object newMessage) {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      Long room_id = currentClient.getRoom_id();
     
      log.debug("room_id: "+room_id);
      log.debug("currentClient.getIsChatNotification(): "+currentClient.getIsChatNotification());
      if (currentClient.getIsChatNotification()){
        room_id = currentClient.getChatUserRoomId();
      }
     
      //log.error(newMessage.getClass().getName());
      ArrayList messageMap = (ArrayList) newMessage;
      //adding delimiter space, cause otherwise an emoticon in the last string would not be found
      String messageText = messageMap.get(4).toString()+" ";
      //log.error("messageText"+messageText);
      //add server time
      messageMap.set(1,parseDateAsTimeString());
      LinkedList<String[]> parsedStringObjects = ChatString.getInstance().parseChatString(messageText);
      //log.error("parsedStringObjects"+parsedStringObjects.size());
      log.debug("size:"+messageMap.size());
      messageMap.add(parsedStringObjects);
      newMessage = messageMap;     
     
      HashMap<String,Object> hsm = new HashMap<String,Object>();
      hsm.put("client", currentClient);
      hsm.put("message", newMessage);
     
      List<HashMap<String,Object>> myChatList = myChats.get(room_id);
      if (myChatList==null) myChatList = new LinkedList<HashMap<String,Object>>();
     
      if (myChatList.size()==chatRoomHistory) myChatList.remove(0);
      myChatList.add(hsm);
      myChats.put(room_id,myChatList);
     
      log.debug("SET CHATROOM: "+room_id);
     
      //broadcast to everybody in the room/domain
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
          for (IConnection conn : conset) {
            if (conn != null) {
              if (conn instanceof IServiceCapableConnection) {
               
                RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
               
                if (rcl == null) {
                  continue;
                }
                if (rcl.getIsAVClient()) {
                  continue;
                }
                if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                  continue;
                }
               
                log.debug("*..*idremote room_id: " + room_id);
                log.debug("*..*my idstreamid room_id: " + rcl.getRoom_id());
                if (room_id!=null && room_id.equals(rcl.getRoom_id())) {
                  ((IServiceCapableConnection) conn).invoke("sendVarsToMessageWithClient",new Object[] { hsm }, this);
                  log.debug("sending sendVarsToMessageWithClient to " + conn);
                } else if (rcl.getIsChatNotification()) {
                  if (room_id.equals(rcl.getChatUserRoomId()) && room_id != null) {
                    ((IServiceCapableConnection) conn).invoke("sendVarsToMessageWithClient",new Object[] { hsm }, this);
                  }
                }
               
               }
View Full Code Here

  }
 
  public List<HashMap<String,Object>> clearChat() {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      Long room_id = currentClient.getRoom_id();
     
      Long chatroom = room_id;
      log.debug("### GET CHATROOM: "+chatroom);
     
      List<HashMap<String,Object>> myChatList = myChats.get(chatroom);
View Full Code Here

  }
 
  public List<HashMap<String,Object>> getRoomChatHistory() {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      Long room_id = currentClient.getRoom_id();
     
      Long chatroom = room_id;
      log.debug("GET CHATROOM: "+chatroom);
     
      List<HashMap<String,Object>> myChatList = myChats.get(chatroom);
View Full Code Here

   * @return
   */
  public Long addClientToChatNotification(Long room_id){
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());         
      String streamid = currentClient.getStreamid();
     
      currentClient.setIsChatNotification(true);
      currentClient.setChatUserRoomId(room_id);
     
      this.clientListManager.updateClientByStreamId(streamid, currentClient);
    } catch (Exception err) {
      log.error("[addClientToCahtNotification]",err);
    }
View Full Code Here

   * @return
   */
  public Long removeClientFromChatNotification(){
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());         
      String streamid = currentClient.getStreamid();
     
      currentClient.setIsChatNotification(false);
      currentClient.setChatUserRoomId(null);
     
      this.clientListManager.updateClientByStreamId(streamid, currentClient);
    } catch (Exception err) {
      log.error("[addClientToCahtNotification]",err);
    }
View Full Code Here

   */
  @SuppressWarnings({ "rawtypes", "unchecked" })
  public int sendMessageToOverallChat(Object newMessage) {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
     
      //log.error(newMessage.getClass().getName());
      ArrayList messageMap = (ArrayList) newMessage;
      //adding delimiter space, cause otherwise an emoticon in the last string would not be found
      String messageText = messageMap.get(4).toString()+" ";
View Full Code Here

   */
  public WhiteboardObject getRoomItems() {
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager
          .getClientByStreamId(streamid);
      Long room_id = currentClient.getRoom_id();

      log.debug("getRoomItems: " + room_id);

      return this.whiteBoardObjectListManager
          .getWhiteBoardObjectRoomId(room_id);
View Full Code Here

  public Long getNewWhiteboardId() {
    try {

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager
          .getClientByStreamId(streamid);
      Long room_id = currentClient.getRoom_id();

      Long whiteBoardId = this.whiteBoardObjectListManagerById
          .getNewWhiteboardId(room_id);

      return whiteBoardId;
View Full Code Here

TOP

Related Classes of org.openmeetings.app.conference.session.RoomClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.