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

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


  public void roomLeave(IClient client, IScope room) {
    try {
      log.debug(String.format("roomLeave %s %s %s %s", client.getId(), room.getClients().size()
          , room.getContextPath(), room.getName()));

      Client currentClient = sessionManager.getClientByStreamId(client.getId(), null);

      // The Room Client can be null if the Client left the room by using
      // logicalRoomLeave
      if (currentClient != null) {
        log.debug("currentClient IS NOT NULL");
View Full Code Here


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

      log.debug(streamid + " is leaving");

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

      roomLeaveByScope(currentClient, current.getScope(), true);
    } catch (Exception err) {
      log.error("[logicalRoomLeave]", err);
    }
View Full Code Here

        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

  public Long getNewWhiteboardId() {
    try {

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

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

      return whiteBoardId;
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

  public Boolean deleteWhiteboard(Long whiteBoardId) {
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);
      Long room_id = currentClient.getRoom_id();

      WhiteboardObjectList whiteboardObjectList = this.whiteBoardObjectListManagerById
          .getWhiteBoardObjectListByRoomId(room_id);

      for (Iterator<Long> iter = whiteboardObjectList
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

  public WhiteboardObjectList getRoomItemsBy() {
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);
      Long room_id = currentClient.getRoom_id();

      log.debug("getRoomItems: " + room_id);
      WhiteboardObjectList whiteboardObjectList = this.whiteBoardObjectListManagerById
          .getWhiteBoardObjectListByRoomId(room_id);
View Full Code Here

  public Boolean setCanDraw(String SID, String publicSID, boolean canDraw) {
    try {

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

      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);

      if (AuthLevelUtil.checkUserLevel(user_level)) {

        if (currentClient.getIsMod()) {
          Client rcl = this.sessionManager
              .getClientByPublicSID(publicSID, false, null);

          if (rcl != null) {
            rcl.setCanDraw(canDraw);
            this.sessionManager.updateClientByStreamId(
                rcl.getStreamid(), rcl, false, null);

            HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>();
            newMessage.put(0, "updateDrawStatus");
            newMessage.put(1, rcl);
            this.scopeApplicationAdapter
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.