Package org.openmeetings.app.persistence.beans.recording

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient


   * @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

          String username, String firstname, String lastname){
    try {
      log.debug("#*#*#*#*#*#*# setUsername userId: "+userId+" username: "+username+" firstname: "+firstname+" lastname: "+lastname);
      IConnection current = Red5.getConnectionLocal();     
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
      log.debug("[setUsername] id: "+currentClient.getStreamid());
     
      currentClient.setUsername(username);
      currentClient.setUser_id(userId);
      currentClient.setUserObject(userId, username, firstname, lastname);
     
      //Update Session Data
      log.debug("UDPATE SESSION "+SID+", "+userId);
      Sessionmanagement.getInstance().updateUserWithoutSession(SID, userId);
     
      Users user = Usermanagement.getInstance().getUserById(userId);
     
      if (user != null) {
        currentClient.setExternalUserId(user.getExternalUserId());
        currentClient.setExternalUserType(user.getExternalUserType());
      }
     
      //only fill this value from User-Record
      //cause invited users have non
      //you cannot set the firstname,lastname from the UserRecord
      Users us = UsersDaoImpl.getInstance().getUser(userId);
      if (us!=null && us.getPictureuri()!=null){
        //set Picture-URI
        log.debug("###### SET PICTURE URI");
        currentClient.setPicture_uri(us.getPictureuri());
      }
      this.clientListManager.updateClientByStreamId(streamid, currentClient);
      return currentClient;
    } catch (Exception err){
      log.error("[setUsername]",err);
View Full Code Here

   * @return
   */
  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()+" ";
      //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(overallChatRoomName);
      if (myChatList==null) myChatList = new LinkedList<HashMap<String,Object>>();
     
      if (myChatList.size()==chatRoomHistory) myChatList.remove(0);
      myChatList.add(hsm);
      myChats.put(overallChatRoomName,myChatList);
     
      log.debug("SET CHATROOM: "+overallChatRoomName);
     
      //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.getIsScreenClient()) {
                  log.debug("*..*idremote: " + rcl.getStreamid());
                  log.debug("*..*my idstreamid: " + currentClient.getStreamid());
                  ((IServiceCapableConnection) conn).invoke("sendVarsToOverallChat",new Object[] { hsm }, this);
                }
              }
            }
View Full Code Here

      LinkedList<RoomClient> guestList = new LinkedList<RoomClient>();
      LinkedList<RoomClient> overallList = new LinkedList<RoomClient>();
     
      HashMap<String, RoomClient> cList = this.clientListManager.getClientList();
      for (Iterator<String> iter = cList.keySet().iterator();iter.hasNext();) {
        RoomClient rcl = cList.get(iter.next());
        if (rcl.getUser_id()==null || rcl.getUser_id()<=0) {
          guestList.add(rcl);
        } else {
          overallList.add(rcl);
        }
      }
View Full Code Here

   */
  public synchronized int setAudienceModus(String colorObj, int userPos){
    try {
      IConnection current = Red5.getConnectionLocal();
     
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      log.debug("xmlcrm setUserObjectOneFour: "+currentClient.getUsername());
      currentClient.setUsercolor(colorObj);
      currentClient.setUserpos(userPos);
      Long room_id = currentClient.getRoom_id()
           
      //Notify all clients of the same scope (room)
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
              if (conn.equals(current)){
                continue;
              } else {       
                RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
                if (rcl == null) {
                  //continue;
                } else if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                    //continue;
                  } else {
                  //log.debug("*** setAudienceModus Found Client to " + conn);
                  //log.debug("*** setAudienceModus Found Client to " + conn.getClient());
                  if (conn instanceof IServiceCapableConnection) {
View Full Code Here

       
        Collection<Set<IConnection>> conCollection = webAppKeyScope.getScope(room_id.toString()).getConnections();
        for (Set<IConnection> conset : conCollection) {
          for (IConnection conn : conset) {
            if (conn != null) {
              RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
              if (rcl == null) {
                //continue;
              } else if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                  //continue;
                } else {
                if (conn instanceof IServiceCapableConnection) {
                  //RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
                  ((IServiceCapableConnection) conn).invoke("newMessageByRoomAndDomain",new Object[] { message }, this);
View Full Code Here

  public synchronized List<RoomClient> getCurrentModeratorList(){
    try {
      log.debug("*..*getCurrentModerator id: ");
     
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      Long room_id = currentClient.getRoom_id();   
     
      //log.debug("Who is this moderator? "+currentMod);
     
      return this.clientListManager.getCurrentModeratorByRoom(room_id);
    } catch (Exception err){
View Full Code Here

     
      //Map whiteboardObj = (Map) whiteboardObjParam;
      
      // Check if this User is the Mod:
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
     
      if (currentClient == null) {
        return;
      }
     
      Long room_id = currentClient.getRoom_id()
       
      String action = whiteboardObj.get(2).toString()
     
     
      //log.debug("***** sendVars: " + actionObject.get(0));
     
      if (action != null && action.equals("whiteboardObj")) {
        //log.debug("***** sendVars: " + actionObject.get(1));
        //log.debug("***** sendVars: " + actionObject.get(2));
        //Update Whiteboard Object
        List actionObject = (List) whiteboardObj.get(3);
        WhiteboardManagement.getInstance().updateWhiteboardObject(room_id, actionObject);
      } else if (action != null && action.equals("moveMap")) {
        //log.debug("***** sendVars: " + actionObject.get(1));
        //log.debug("***** sendVars: " + actionObject.get(2));
        //Update Whiteboard Object
        List actionObject = (List) whiteboardObj.get(3);
        WhiteboardManagement.getInstance().updateWhiteboardObjectPos(room_id, actionObject);
      } else {
        //Store event in list
        WhiteboardManagement.getInstance().addWhiteBoardObject(room_id, whiteboardObj);
      }
      int numberOfUsers = 0;
     
      //This is no longer necessary
      //boolean ismod = currentClient.getIsMod();
     
      //log.debug("*..*ismod: " + ismod);
 
      //if (ismod) {
     
      Configuration conf = Configurationmanagement.getInstance().getConfKey(3, "show.whiteboard.draw.status");
      boolean showDrawStatus = conf != null && "1".equals(conf.getConf_value());

      //Notify all Clients of that Scope (Room)
      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;
              } else if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                  continue;
                } else {
                //log.debug("*..*idremote: " + rcl.getStreamid());
                //log.debug("*..* sendVars room_id IS EQUAL: " + currentClient.getStreamid() + " asd " + rcl.getStreamid() + " IS eq? " +currentClient.getStreamid().equals(rcl.getStreamid()));
                if (!currentClient.getStreamid().equals(rcl.getStreamid())) {
                  ((IServiceCapableConnection) conn).invoke("sendVarsToWhiteboard", new Object[] { showDrawStatus ? currentClient : null, whiteboardObj },this);
                  //log.debug("sending sendVarsToWhiteboard to " + conn + " rcl " + rcl);
                  numberOfUsers++;
                }
              }
View Full Code Here

     
      //Map whiteboardObj = (Map) whiteboardObjParam;
      
      // Check if this User is the Mod:
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
     
      if (currentClient == null) {
        return;
      }
     
      Long room_id = currentClient.getRoom_id()
       
      //log.debug("***** sendVars: " + whiteboardObj);
     
      //Store event in list
      String action = whiteboardObj.get(2).toString()
     
      if (action.equals("deleteMindMapNodes")) {
       
        //Simulate Single Delete Events for z-Index
        List actionObject = (List) whiteboardObj.get(3);
       
        List<List> itemObjects = (List) actionObject.get(3);
       
        Map whiteboardTempObj = new HashMap();
        whiteboardTempObj.put(2,"delete");
       
        for (List itemObject : itemObjects) {
         
          List<Object> tempActionObject = new LinkedList<Object>();
          tempActionObject.add("mindmapnode");
          tempActionObject.add(itemObject.get(0)); //z-Index -8
          tempActionObject.add(null); //simulate -7
          tempActionObject.add(null); //simulate -6
          tempActionObject.add(null); //simulate -5
          tempActionObject.add(null); //simulate -4
          tempActionObject.add(null); //simulate -3
          tempActionObject.add(null); //simulate -2
          tempActionObject.add(itemObject.get(1)); //Object-Name -1
         
          whiteboardTempObj.put(3, tempActionObject);
         
          WhiteboardManagement.getInstance().addWhiteBoardObjectById(room_id, whiteboardTempObj, whiteboardId);
         
        }
       
      } else {
       
        WhiteboardManagement.getInstance().addWhiteBoardObjectById(room_id, whiteboardObj, whiteboardId);
       
      }
     
     
     
      int numberOfUsers = 0;
     
      //This is no longer necessary
      //boolean ismod = currentClient.getIsMod();
     
      //log.debug("*..*ismod: " + ismod);
 
      //if (ismod) {
     
      Map<String,Object> sendObject = new HashMap<String,Object>();
      sendObject.put("id", whiteboardId);
      sendObject.put("param", whiteboardObjParam);
     
      Configuration conf = Configurationmanagement.getInstance().getConfKey(3, "show.whiteboard.draw.status");
      boolean showDrawStatus = conf != null && "1".equals(conf.getConf_value());

      //Notify all Clients of that Scope (Room)
      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) || (rcl.getIsScreenClient() != null && rcl.getIsScreenClient())) {
                  continue;
                } else {
                //log.debug("*..*idremote: " + rcl.getStreamid());
                //log.debug("*..* sendVars room_id IS EQUAL: " + currentClient.getStreamid() + " asd " + rcl.getStreamid() + " IS eq? " +currentClient.getStreamid().equals(rcl.getStreamid()));
                if (!currentClient.getStreamid().equals(rcl.getStreamid())) {
                  ((IServiceCapableConnection) conn).invoke("sendVarsToWhiteboardById", new Object[] { showDrawStatus ? currentClient : null, sendObject },this);
                  //log.debug("sending sendVarsToWhiteboard to " + conn + " rcl " + rcl);
                  numberOfUsers++;
                }
              }
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.recording.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.