Package org.apache.openmeetings.db.entity.room

Examples of org.apache.openmeetings.db.entity.room.Client


        for (Set<IConnection> conset : currentScope.getConnections()) {
        for (IConnection cons : conset) {
          if (cons != null && cons instanceof IServiceCapableConnection) {
            log.debug("sending roomDisconnect to {}  client id {}", cons, cons.getClient().getId());

            Client rcl = sessionManager.getClientByStreamId(cons.getClient().getId(), null);

            /*
             * Check if the Client does still exist on the
             * list
             */
            if (rcl == null) {
              log.debug("For this StreamId: " + cons.getClient().getId() + " There is no Client in the List anymore");
              continue;
            }
           
            /*
             * Do not send back to sender, but actually
             * all other clients should receive this
             * message swagner 01.10.2009
             */
            if (!currentClient.getStreamid().equals(rcl.getStreamid())) {
              // add Notification if another user isrecording
              log.debug("###########[roomLeave]");
              if (rcl.getIsRecording()) {
                log.debug("*** roomLeave Any Client is Recording - stop that");
                flvRecorderService.stopRecordingShowForClient(cons, currentClient);
              }
             
              //If the user was a avclient, we do not broadcast a message about that to everybody
              if (currentClient.getIsAVClient()) {
                continue;
              }
             
              boolean isScreen = rcl.getIsScreenClient() != null && rcl.getIsScreenClient();
              if (isScreen && currentClient.getPublicSID().equals(rcl.getStreamPublishName())) {
                //going to terminate screen sharing started by this client
                ((IServiceCapableConnection) cons).invoke("stopStream", new Object[] { },this);
                continue;
              } else if (isScreen) {
                // screen sharing clients do not receive events
                continue;
              } else if (rcl.getIsAVClient()) {
                // AVClients or potential AVClients do not receive events
                continue;
              }
             
              // Send to all connected users
View Full Code Here


  public synchronized void streamPublishStart(IBroadcastStream stream) {
    try {
      log.debug("-----------  streamPublishStart");
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);

      //We make a second object the has the reference to the object
      //that we will use to send to all participents
      Client clientObjectSendToSync = currentClient;
     
      // Notify all the clients that the stream had been started
      log.debug("start streamPublishStart broadcast start: "
          + stream.getPublishedName() + " CONN " + current);

      // In case its a screen sharing we start a new Video for that
      if (currentClient.getIsScreenClient()) {

        currentClient.setScreenPublishStarted(true);

        this.sessionManager.updateClientByStreamId(current
            .getClient().getId(), currentClient, false, null);
      }
      //If its an audio/video client then send the session object with the full
      //data to everybody
      else if (currentClient.getIsAVClient()) {
        clientObjectSendToSync = this.sessionManager.getClientByPublicSID(
                      currentClient.getPublicSID(), false, null);
      }
     
      log.debug("newStream SEND: "+currentClient);

      // Notify all users of the same Scope
      // We need to iterate through the streams to catch if anybody is recording
      for (Set<IConnection> conset : current.getScope().getConnections()) {
      for (IConnection conn : conset) {
        if (conn != null) {
          if (conn instanceof IServiceCapableConnection) {
           
            Client rcl = this.sessionManager
                .getClientByStreamId(conn.getClient()
                    .getId(), null);
           
            if (rcl == null) {
              log.debug("RCL IS NULL newStream SEND");
              continue;
            }
           
            log.debug("check send to "+rcl);
           
            if (rcl.getPublicSID() == "") {
              log.debug("publicSID IS NULL newStream SEND");
              continue;
            }
            if (rcl.getIsRecording()) {
              log.debug("RCL getIsRecording newStream SEND");
              flvRecorderService.addRecordingByStreamId(current, streamid, currentClient, rcl.getFlvRecordingId());
            }
            if (rcl.getIsAVClient()) {
              log.debug("RCL getIsAVClient newStream SEND");
              continue;
            }
            if (rcl.getIsScreenClient() == null || rcl.getIsScreenClient()) {
              log.debug("RCL getIsScreenClient newStream SEND");
              continue;
            }
           
            if (rcl.getPublicSID().equals(currentClient.getPublicSID())) {
              log.debug("RCL publicSID is equal newStream SEND");
              continue;
            }
           
            log.debug("RCL SEND is equal newStream SEND "+rcl.getPublicSID()+" || "+rcl.getUserport());
             
            ((IServiceCapableConnection) conn).invoke("newStream", new Object[] { clientObjectSendToSync }, this);

          }
        }
View Full Code Here

    // Notify all the clients that the stream had been closed
    log.debug("start streamBroadcastClose broadcast close: "
        + stream.getPublishedName());
    try {
      IConnection current = Red5.getConnectionLocal();
      Client rcl = sessionManager.getClientByStreamId(current.getClient().getId(), null);
      sendClientBroadcastNotifications(stream, "closeStream", rcl);
    } catch (Exception e) {
      log.error("[streamBroadcastClose]", e);
    }
  }
View Full Code Here

  private synchronized void sendClientBroadcastNotifications(IBroadcastStream stream, String clientFunction, Client rc) {
    try {
      // Store the local so that we do not send notification to ourself back
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = sessionManager.getClientByStreamId(streamid, null);

      if (currentClient == null) {

        // In case the client has already left(kicked) this message
        // might be thrown later then the RoomLeave
        // event and the currentClient is already gone
        // The second Use-Case where the currentClient is maybe null is
        // if we remove the client because its a Zombie/Ghost

        return;

      }
      // Notify all the clients that the stream had been started
      log.debug("sendClientBroadcastNotifications: " + stream.getPublishedName());
      log.debug("sendClientBroadcastNotifications : " + currentClient + " " + currentClient.getStreamid());

      // Notify all clients of the same scope (room)
      for (Set<IConnection> conset : current.getScope().getConnections()) {
      for (IConnection conn : conset) {
        if (conn != null) {
          if (conn instanceof IServiceCapableConnection) {
            if (conn.equals(current)) {
              // there is a Bug in the current implementation
              // of the appDisconnect
              if (clientFunction.equals("closeStream")) {
                Client rcl = sessionManager.getClientByStreamId(conn.getClient().getId(), null);
                if (clientFunction.equals("closeStream") && rcl.getIsRecording()) {
                  log.debug("*** stopRecordingShowForClient Any Client is Recording - stop that");
                  // StreamService.stopRecordingShowForClient(conn,
                  // currentClient,
                  // rcl.getRoomRecordingName(), false);
                  flvRecorderService.stopRecordingShowForClient(conn, currentClient);
                }
                // Don't notify current client
                current.ping();
              }
              continue;
            } else {
              Client rcl = sessionManager.getClientByStreamId(conn.getClient().getId(), null);
              if (rcl != null) {
                if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                  // continue;
                } else {
                  log.debug("is this users still alive? :" + rcl);
                  IServiceCapableConnection iStream = (IServiceCapableConnection) conn;
                  iStream.invoke(clientFunction, new Object[] { rc }, this);
                }

                log.debug("sending notification to " + conn + " ID: ");

                // if this close stream event then stop the
                // recording of this stream
                if (clientFunction.equals("closeStream") && rcl.getIsRecording()) {
                  log.debug("***  +++++++ ######## sendClientBroadcastNotifications Any Client is Recording - stop that");
                  flvRecorderService.stopRecordingShowForClient(conn, currentClient);
                }
              }
            }
View Full Code Here

      // get all stream and stop recording them
      for (Set<IConnection> conset : scope.getConnections()) {
      for (IConnection conn : conset) {
        if (conn != null) {
          if (conn instanceof IServiceCapableConnection) {
            Client rcl = sessionManager.getClientByStreamId(conn.getClient().getId(), null);

            if (rcl == null) {
              continue;
            }
            log.debug("is this users still alive? stop it :" + rcl);

            if (rcl.getIsScreenClient()) {
              if (rcl.getFlvRecordingId() != null && rcl.isScreenPublishStarted()) {
                // Stop FLV Recording
                stopRecordingShow(conn, rcl.getStreamPublishName(), rcl.getFlvRecordingMetaDataId());

                // Update Meta Data
                metaDataDao.updateFlvRecordingMetaDataEndDate(rcl.getFlvRecordingMetaDataId(), new Date());
              }
            } else if (rcl.getIsAVClient()
                && (rcl.getAvsettings().equals("av") || rcl.getAvsettings().equals("a") || rcl.getAvsettings().equals("v"))) {

              stopRecordingShow(conn, String.valueOf(rcl.getBroadCastID()).toString(), rcl.getFlvRecordingMetaDataId());

              // Update Meta Data
              metaDataDao.updateFlvRecordingMetaDataEndDate(rcl.getFlvRecordingMetaDataId(), new Date());
            }
          }
        }
      }
      }
View Full Code Here

   */
  public synchronized Long addModerator(String publicSID) {
    try {
      log.debug("-----------  addModerator: " + publicSID);

      Client currentClient = this.sessionManager
          .getClientByPublicSID(publicSID, false, null);

      if (currentClient == null) {
        return -1L;
      }
      Long room_id = currentClient.getRoom_id();

      currentClient.setIsMod(true);
      // Put the mod-flag to true for this client
      this.sessionManager.updateClientByStreamId(
          currentClient.getStreamid(), currentClient, false, null);

      List<Client> currentMods = this.sessionManager
          .getCurrentModeratorByRoom(room_id);
     
      //Send message to all users
View Full Code Here

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();

      log.debug("getCurrentRoomClient -2- " + streamid);

      Client currentClient = sessionManager.getClientByStreamId(streamid, null);

      log.debug("getCurrentRoomClient -#########################- " + currentClient.getRoom_id());

      for (Client rcl : sessionManager.getClientListByRoomAll(currentClient.getRoom_id())) {
        if (rcl.getIsRecording()) {
          return rcl;
        }
      }
View Full Code Here

  public void setNewCursorPosition(Object item) {
    try {

      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);

      @SuppressWarnings("rawtypes")
      Map cursor = (Map) item;
      cursor.put("streamPublishName",
          currentClient.getStreamPublishName());

      // Notify all users of the same Scope
      for (Set<IConnection> conset : current.getScope().getConnections()) {
      for (IConnection conn : conset) {
        if (conn != null) {
View Full Code Here

      log.debug("-----------  removeModerator: " + publicSID);

      IConnection current = Red5.getConnectionLocal();
      // String streamid = current.getClient().getId();

      Client currentClient = this.sessionManager
          .getClientByPublicSID(publicSID, false, null);

      if (currentClient == null) {
        return -1L;
      }
      Long room_id = currentClient.getRoom_id();

      currentClient.setIsMod(false);
      // Put the mod-flag to true for this client
      this.sessionManager.updateClientByStreamId(
          currentClient.getStreamid(), currentClient, false, null);

      List<Client> currentMods = this.sessionManager
          .getCurrentModeratorByRoom(room_id);

      // Notify all clients of the same scope (room)
View Full Code Here

      log.debug("-----------  setBroadCastingFlag: " + publicSID);

      IConnection current = Red5.getConnectionLocal();
      // String streamid = current.getClient().getId();

            Client currentClient = sessionManager.getClientByPublicSID(publicSID, false, null);

      if (currentClient == null) {
        return -1L;
      }

      currentClient.setIsBroadcasting(value);
      currentClient.setInterviewPodId(interviewPodId);

            // Put the mod-flag to true for this client
        sessionManager.updateClientByStreamId(currentClient.getStreamid(), currentClient, false, null);
       
      // Notify all clients of the same scope (room)
      for (Set<IConnection> conset : current.getScope().getConnections()) {
      for (IConnection conn : conset) {
        if (conn != null) {
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.db.entity.room.Client

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.