Package org.openmeetings.app.conference.session

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


      // 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")) {
        // Update Whiteboard Object
        List actionObject = (List) whiteboardObj.get(3);
        WhiteboardManagement.getInstance().updateWhiteboardObject(
            room_id, actionObject);
      } else if (action != null && action.equals("moveMap")) {
        // 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);
      }

      boolean showDrawStatus = getWhiteboardDrawStatus();

      // 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) {

              if (conn.getClient().getId()
                  .equals(current.getClient().getId())) {
                continue;
              }

              RoomClient rcl = this.clientListManager
                  .getSyncClientByStreamId(conn.getClient()
                      .getId());

              if (rcl == null) {
                continue;
              }

              if (!currentClient.getStreamid().equals(
                  rcl.getStreamid())) {
                ((IServiceCapableConnection) conn)
                    .invoke("sendVarsToWhiteboard",
                        new Object[] {
                            (showDrawStatus ? currentClient
                                : null),
View Full Code Here


        i++;
      }

      // 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);

      }

      // 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);

      boolean showDrawStatus = getWhiteboardDrawStatus();

      // 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) {
              if (conn.getClient().getId()
                  .equals(current.getClient().getId())) {
                continue;
              }

              RoomClient rcl = this.clientListManager
                  .getSyncClientByStreamId(conn.getClient()
                      .getId());

              if (rcl == null) {
                continue;
              }

              if (!currentClient.getStreamid().equals(
                  rcl.getStreamid())) {
                ((IServiceCapableConnection) conn).invoke(
                    "sendVarsToWhiteboardById",
                    new Object[] {
                        showDrawStatus ? currentClient
                            : null, sendObject },
View Full Code Here

  public synchronized int sendVarsModeratorGeneral(Object vars) {
    log.debug("*..*sendVars: " + vars);
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager
          .getClientByStreamId(current.getClient().getId());
      // Long room_id = currentClient.getRoom_id();

      log.debug("***** id: " + currentClient.getStreamid());

      boolean ismod = currentClient.getIsMod();

      if (ismod) {
        log.debug("CurrentScope :" + current.getScope().getName());
        // Send to all Clients of the same Scope
        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("*..*my idstreamid: " +
                  // currentClient.getStreamid());
                  if (!currentClient.getStreamid().equals(
                      rcl.getStreamid())) {
                    ((IServiceCapableConnection) conn)
                        .invoke("sendVarsToModeratorGeneral",
                            new Object[] { vars },
                            this);
                    // log.debug("sending sendVarsToModeratorGeneral to "
View Full Code Here

          .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) {
                // RoomClient can be null if there are network problems
                continue;
              } else if (rcl.getIsScreenClient() != null && rcl
                      .getIsScreenClient()) {
                // screen sharing clients do not receive events
                continue;
              } else if (rcl.getIsAVClient()) {
                // AVClients or potential AVClients do not receive events
                continue;
              } else if (current.getClient().getId().equals(
                    conn.getClient().getId()) && !sendSelf) {
                //Do not send back to self
View Full Code Here

   * @return
   */
  public synchronized int sendMessageWithClientWithSyncObject(Object newMessage, boolean sync) {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager
          .getClientByStreamId(current.getClient().getId());

      HashMap<String, Object> hsm = new HashMap<String, Object>();
      hsm.put("client", currentClient);
      hsm.put("message", newMessage);
View Full Code Here

      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("### sendMessageById 1 ###"+clientId);
                // log.debug("### sendMessageById 2 ###"+conn.getClient().getId());
                if (conn.getClient().getId().equals(clientId)) {
View Full Code Here

   */
  public synchronized int sendMessageWithClientById(Object newMessage,
      String clientId) {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager
          .getClientByStreamId(current.getClient().getId());

      log.debug("### sendMessageWithClientById ###" + clientId);

      HashMap<String, Object> hsm = new HashMap<String, Object>();
      hsm.put("client", currentClient);
      hsm.put("message", newMessage);

      // broadcast Message to specific user with id inside the same Scope
      Collection<Set<IConnection>> conCollection = current.getScope()
          .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) {
                // log.debug("### sendMessageWithClientById 1 ###"+clientId);
                // log.debug("### sendMessageWithClientById 2 ###"+conn.getClient().getId());
View Full Code Here

          .getScope(OpenmeetingsVariables.webAppRootKey);

      // log.debug("webAppKeyScope "+webAppKeyScope);

      // Get Room Id to send it to the correct Scope
      RoomClient currentClient = this.clientListManager
          .getClientByPublicSID(publicSID, false);

      if (currentClient == null) {
        throw new Exception(
            "Could not Find RoomClient on List publicSID: "
                + publicSID);
      }
      // default Scope Name
      String scopeName = "hibernate";
      if (currentClient.getRoom_id() != null) {
        scopeName = currentClient.getRoom_id().toString();
      }

      IScope scopeHibernate = webAppKeyScope.getScope(scopeName);

      // log.debug("scopeHibernate "+scopeHibernate);

      if (scopeHibernate != null) {
        // Notify the clients of the same scope (room) with user_id

        Collection<Set<IConnection>> conCollection = webAppKeyScope
            .getScope(scopeName).getConnections();
        for (Set<IConnection> conset : conCollection) {
          for (IConnection conn : conset) {
            if (conn != null) {
              RoomClient rcl = this.clientListManager
                  .getClientByStreamId(conn.getClient()
                      .getId());
              if (rcl != null) {
                if (rcl.getIsScreenClient() != null
                    && rcl.getIsScreenClient()) {
                  // continue;
                } else {
                  // log.debug("rcl "+rcl+" rcl.getUser_id(): "+rcl.getPublicSID()+" publicSID: "+publicSID+
                  // " IS EQUAL? "+rcl.getPublicSID().equals(publicSID));
                  if (rcl.getPublicSID().equals(publicSID)) {
                    // log.debug("IS EQUAL ");
                    ((IServiceCapableConnection) conn)
                        .invoke("newMessageByRoomAndDomain",
                            new Object[] { message },
                            this);
View Full Code Here

          .getScope(OpenmeetingsVariables.webAppRootKey);

      // log.debug("webAppKeyScope "+webAppKeyScope);

      // Get Room Id to send it to the correct Scope
      RoomClient currentClient = this.clientListManager
          .getClientByPublicSID(publicSID, false);

      if (currentClient == null) {
        currentClient = this.clientListManager
            .getClientByUserId(user_id);
      }

      Collection<Set<IConnection>> conCollection = null;

      if (currentClient == null) {
        // Must be from a previous session, search for user in current
        // scope
        IConnection current = Red5.getConnectionLocal();
        // Notify all Clients of that Scope (Room)
        conCollection = current.getScope().getConnections();
      } else {
        // default Scope Name
        String scopeName = "hibernate";
        if (currentClient.getRoom_id() != null) {
          scopeName = currentClient.getRoom_id().toString();
        }

        IScope scopeHibernate = webAppKeyScope.getScope(scopeName);

        if (scopeHibernate != null) {
          conCollection = webAppKeyScope.getScope(scopeName)
              .getConnections();
        }
      }

      // log.debug("scopeHibernate "+scopeHibernate);

      // Notify the clients of the same scope (room) with user_id

      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            RoomClient rcl = this.clientListManager
                .getClientByStreamId(conn.getClient().getId());
            if (rcl != null) {
              if (rcl.getIsScreenClient() != null
                  && rcl.getIsScreenClient()) {
                // continue;
              } else {
                // log.debug("rcl "+rcl+" rcl.getUser_id(): "+rcl.getPublicSID()+" publicSID: "+publicSID+
                // " IS EQUAL? "+rcl.getPublicSID().equals(publicSID));
                if (rcl.getPublicSID().equals(publicSID)) {
                  // log.debug("IS EQUAL ");
                  ((IServiceCapableConnection) conn).invoke(
                      "newMessageByRoomAndDomain",
                      new Object[] { message }, this);
                  log.debug("sendMessageWithClientByPublicSID RPC:newMessageByRoomAndDomain"
                      + message);
                } else if (user_id != 0
                    && rcl.getUser_id() != null
                    && rcl.getUser_id().equals(user_id)) {
                  ((IServiceCapableConnection) conn).invoke(
                      "newMessageByRoomAndDomain",
                      new Object[] { message }, this);
                  log.debug("sendMessageWithClientByPublicSID RPC:newMessageByRoomAndDomain"
                      + message);
View Full Code Here

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

        RoomClient rcl = MyUserList.get(key);

        String aux = rcl.getSwfurl();

        int init_pos = aux.indexOf("sid=") + 4;
        int end_pos = init_pos + 32;
        if (end_pos > aux.length())
          end_pos = aux.length();
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.