Package org.openmeetings.app.conference.session

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


      log.debug("*..*addModerator publicSID: " + publicSID);

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

      RoomClient currentClient = this.clientListManager
          .getClientByPublicSID(publicSID, false);

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

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

      List<RoomClient> currentMods = this.clientListManager
          .getCurrentModeratorByRoom(room_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) {
            RoomClient rcl = this.clientListManager
                .getClientByStreamId(conn.getClient().getId());
            if (rcl == null) {
              // continue;
            } else if (rcl.getIsScreenClient() != null
                && rcl.getIsScreenClient()) {
              // continue;
            } else {
              log.debug("Send Flag to Client: "
                  + rcl.getUsername());
              if (conn instanceof IServiceCapableConnection) {
                ((IServiceCapableConnection) conn).invoke(
                    "setNewModeratorByList",
                    new Object[] { currentMods }, this);
                log.debug("sending setNewModeratorByList to "
View Full Code Here


  }

  public void sendNotification(IConnection current, String clientFunction,
      Object[] obj) throws Exception {
    // Notify all clients of the same scope (room)
    RoomClient rc = this.clientListManager.getClientByStreamId(current
        .getClient().getId());
    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() != null
                && rcl.getIsScreenClient()) {
              // continue;
            } else {
              if (rcl.getRoom_id().equals(rc.getRoom_id())
                  && rcl.getRoom_id() != null) {
                ((IServiceCapableConnection) conn).invoke(
                    clientFunction, obj,
                    scopeApplicationAdapter);
                log.debug("sending " + clientFunction + " to "
                    + conn + " " + conn.getClient().getId());
View Full Code Here

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

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

            RoomClient currentClient = this.clientListManager
          .getClientByPublicSID(publicSID, false);

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

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

            // Put the mod-flag to true for this client
        this.clientListManager.updateClientByStreamId(
            currentClient.getStreamid(), currentClient);
       
      // 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) {
            RoomClient rcl = this.clientListManager
                .getClientByStreamId(conn.getClient().getId());
            if (rcl == null) {
              continue;
            } else if (rcl.getIsScreenClient() != null
                && rcl.getIsScreenClient()) {
              continue;
            } else if (rcl.getIsAVClient()) {
              continue;
            }
           
            log.debug("Send Flag to Client: "
                + rcl.getUsername());
            if (conn instanceof IServiceCapableConnection) {
              ((IServiceCapableConnection) conn).invoke(
                  "setNewBroadCastingFlag",
                  new Object[] { currentClient }, this);
              log.debug("sending setNewBroadCastingFlag to "
View Full Code Here

    int returnVal = 0;
    try {
      log.debug("PollService::vote: Enter");
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient rc = clientListManager.getClientByStreamId(streamid);

      if (rc == null) {
        log.error("RoomClient IS NULL for ClientID: "
            + current.getClient().getId());
        return -1;
      }
      long roomId = rc.getRoom_id();
      if (!pollManagement.hasPoll(roomId)) {
        log.error("POLL IS NULL for RoomId: " + rc.getRoom_id());
        return -1;
      }
      if (pollManagement.hasVoted(roomId, rc.getUser_id())) {
        log.debug("hasVoted: true");
        return -1;
      }
      // get Poll
      RoomPoll roomP = pollManagement.getPoll(roomId);

      log.debug("vote: " + pollvalue + " " + pollTypeId + " "
          + roomP.getPollQuestion());

      log.debug("hasVoted: false");
      RoomPollAnswers rpA = new RoomPollAnswers();
      if (roomP.getPollType().getIsNumericAnswer()) {
        log.debug("numeric");
        rpA.setPointList(pollvalue);
      } else {
        log.debug("boolean");
        // Is boolean Question
        rpA.setAnswer(new Boolean(pollvalue == 1));
      }
      rpA.setVotedUser(usermanagement.getUserById(rc.getUser_id()));
      rpA.setVoteDate(new Date());
      rpA.setRoomPoll(roomP);
      roomP.getRoomPollAnswerList().add(rpA);
      pollManagement.updatePoll(roomP);
      return 1;
View Full Code Here

      log.debug("*..*giveExclusiveAudio publicSID: " + publicSID);

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

      RoomClient currentClient = this.clientListManager
          .getClientByPublicSID(publicSID, false);

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

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

      // 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) {
            RoomClient rcl = this.clientListManager
                .getClientByStreamId(conn.getClient().getId());
            if (rcl == null) {
              // continue;
            } else if (rcl.getIsScreenClient() != null
                && rcl.getIsScreenClient()) {
              // continue;
            } else {
              if (rcl != currentClient) {
                rcl.setMicMuted(true);
                this.clientListManager.updateClientByStreamId(
                    rcl.getStreamid(), rcl);
              }
              log.debug("Send Flag to Client: "
                  + rcl.getUsername());
              if (conn instanceof IServiceCapableConnection) {
                ((IServiceCapableConnection) conn).invoke(
                    "receiveExclusiveAudioFlag",
                    new Object[] { currentClient }, this);
                log.debug("sending receiveExclusiveAudioFlag to "
View Full Code Here

  }

  public RoomPoll getPoll() {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient rc = this.clientListManager.getClientByStreamId(current
          .getClient().getId());

      // get Poll
      return pollManagement.getPoll(rc.getRoom_id());
    } catch (Exception err) {
      log.error("[getPoll]", err);
    }
    return null;
  }
View Full Code Here

  public int checkHasVoted() {
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      RoomClient rc = this.clientListManager
          .getClientByStreamId(streamid);

      long roomId = rc.getRoom_id();
      if (pollManagement.hasPoll(roomId)) {
        return pollManagement.hasVoted(roomId, rc.getUser_id()) ? -1 : 1;
      } else {
        return -2;
      }
    } catch (Exception err) {
      log.error("[checkHasVoted]", err);
View Full Code Here

  }

  public List<RoomPoll> getArchivedPollList() {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient rc = this.clientListManager.getClientByStreamId(current
          .getClient().getId());

      // get Poll
      return pollManagement.getArchivedPollList(rc.getRoom_id());
    } catch (Exception err) {
      log.error("[getArchivedPollList]", err);
    }
    return null;
  }
View Full Code Here

  public synchronized Long switchMicMuted(String publicSID, boolean mute) {
    try {
      log.debug("*..*switchMicMuted publicSID: " + publicSID);

      RoomClient currentClient = this.clientListManager
          .getClientByPublicSID(publicSID, false);
      if (currentClient == null) {
        return -1L;
      }

      currentClient.setMicMuted(mute);
      this.clientListManager.updateClientByStreamId(
          currentClient.getStreamid(), currentClient);

      HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>();
      newMessage.put(0, "updateMuteStatus");
      newMessage.put(1, currentClient);
      this.sendMessageWithClient(newMessage);
View Full Code Here

    return 0L;
  }

    public synchronized Boolean getMicMutedByPublicSID(String publicSID) {
        try {
      RoomClient currentClient = this.clientListManager.getClientByPublicSID(publicSID, false);
      if (currentClient == null) {
        return true;
      }

      //Put the mod-flag to true for this client
            Boolean muted = currentClient.getMicMuted();
            if (null == muted) {
                muted = true;
            }

            return muted;
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.