Package org.apache.openmeetings.persistence.beans.room

Examples of org.apache.openmeetings.persistence.beans.room.Client


    String returnValue = "";
    try {
      log.debug("createPoll: " + pollQuestion);

      IConnection currentcon = Red5.getConnectionLocal();
      Client rc = sessionManager.getClientByStreamId(currentcon
          .getClient().getId(), null);

      log.debug("rc: " + rc.getStreamid() + " " + rc.getUsername() + " "
          + rc.getIsMod());

      if (rc.getIsMod()) {
        // will move all existing polls to the archive
        pollManager.closePoll(rc.getRoom_id());
       
        sendNotification(currentcon, "newPoll",
            new Object[] { pollManager.createPoll(rc,
                pollName, pollQuestion, (long) pollTypeId) });
        returnValue = "200";
View Full Code Here


  public boolean closePoll() {
    try {
      log.debug("closePoll: ");

      IConnection currentcon = Red5.getConnectionLocal();
      Client rc = sessionManager.getClientByStreamId(currentcon
          .getClient().getId(), null);

      log.debug("rc: " + rc.getStreamid() + " " + rc.getUsername() + " "
          + rc.getIsMod());

      if (rc.getIsMod()) {
        // will move all existing polls to the archive
        return pollManager.closePoll(rc.getRoom_id());
      }

    } catch (Exception err) {
      log.error("[closePoll]", err);
    }
View Full Code Here

  public boolean deletePoll(Long poll_id) {
    try {
      log.debug("closePoll: ");

      IConnection currentcon = Red5.getConnectionLocal();
      Client rc = sessionManager.getClientByStreamId(currentcon
          .getClient().getId(), null);

      log.debug("rc: " + rc.getStreamid() + " " + rc.getUsername() + " "
          + rc.getIsMod());

      if (rc.getIsMod()) {
        // will move all existing polls to the archive
        return pollManager.deletePoll(poll_id);
      }

    } catch (Exception err) {
View Full Code Here

  }

  public void sendNotification(IConnection current, String clientFunction,
      Object[] obj) throws Exception {
    // Notify all clients of the same scope (room)
    Client rc = this.sessionManager.getClientByStreamId(current
        .getClient().getId(), null);
    Collection<Set<IConnection>> conCollection = current.getScope()
        .getConnections();
    for (Set<IConnection> conset : conCollection) {
      for (IConnection conn : conset) {
        if (conn != null) {
          if (conn instanceof IServiceCapableConnection) {
            Client rcl = this.sessionManager
                .getClientByStreamId(conn.getClient().getId(), null);
            if (rcl.getIsScreenClient() != null
                && rcl.getIsScreenClient()) {
              // continue;
            } else {
              if (rcl.getRoom_id() != null && rcl.getRoom_id().equals(rc.getRoom_id())) {
                ((IServiceCapableConnection) conn).invoke(
                    clientFunction, obj,
                    scopeApplicationAdapter);
                log.debug("sending " + clientFunction + " to "
                    + conn + " " + conn.getClient().getId());
View Full Code Here

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

      if (rc == null) {
        log.error("RoomClient IS NULL for ClientID: "
            + current.getClient().getId());
        return -1;
      }
      long roomId = rc.getRoom_id();
      if (!pollManager.hasPoll(roomId)) {
        log.error("POLL IS NULL for RoomId: " + rc.getRoom_id());
        return -1;
      }
      if (pollManager.hasVoted(roomId, rc.getUser_id())) {
        log.debug("hasVoted: true");
        return -1;
      }
      // get Poll
      RoomPoll roomP = pollManager.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(userManager.getUserById(rc.getUser_id()));
      rpA.setVoteDate(new Date());
      rpA.setRoomPoll(roomP);
      roomP.getRoomPollAnswerList().add(rpA);
      pollManager.updatePoll(roomP);
      return 1;
View Full Code Here

  }

  public RoomPoll getPoll() {
    try {
      IConnection current = Red5.getConnectionLocal();
      Client rc = this.sessionManager.getClientByStreamId(current
          .getClient().getId(), null);

      // get Poll
      return pollManager.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();
      Client rc = this.sessionManager
          .getClientByStreamId(streamid, null);

      long roomId = rc.getRoom_id();
      if (pollManager.hasPoll(roomId)) {
        return pollManager.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();
      Client rc = this.sessionManager.getClientByStreamId(current
          .getClient().getId(), null);

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

      Long user_level = userManager.getUserLevelByID(users_id);

      if (authLevelUtil.checkUserLevel(user_level)) {

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

        if (currentClient == null) {
          return;
        }

        FileExplorerItem fileExplorerItem = fileExplorerItemDao
            .getFileExplorerItemsById(fileExplorerItemId);

        ArrayList roomItems = libraryWmlLoader.loadWmlFile(fileExplorerItem.getWmlFilePath());

        Map whiteboardObjClear = new HashMap();
        whiteboardObjClear.put(2, "clear");
        whiteboardObjClear.put(3, null);

        whiteboardManagement.addWhiteBoardObjectById(
            room_id, whiteboardObjClear, whiteboardId);

        for (int k = 0; k < roomItems.size(); k++) {

          ArrayList actionObject = (ArrayList) roomItems.get(k);

          Map whiteboardObj = new HashMap();
          whiteboardObj.put(2, "draw");
          whiteboardObj.put(3, actionObject);

          whiteboardManagement.addWhiteBoardObjectById(
              room_id, whiteboardObj, whiteboardId);

        }

        Map<String, Object> sendObject = new HashMap<String, Object>();
        sendObject.put("id", whiteboardId);
        sendObject.put("roomitems", roomItems);

        // 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) {
                Client rcl = this.sessionManager
                    .getClientByStreamId(conn.getClient()
                        .getId(), null);
                if ((rcl == null)
                    || (rcl.getIsScreenClient() != null && rcl
                        .getIsScreenClient())) {
                  continue;
                } else {
                  ((IServiceCapableConnection) conn).invoke(
                      "loadWmlToWhiteboardById",
View Full Code Here

      if (authLevelUtil.checkUserLevel(user_level)) {

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

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

        Long room_id = currentClient.getRoom_id();

        if (room_id != null) {
          File outputFullFlvFile = new File(OmFileHelper.getStreamsHibernateDir()
            , "UPLOADFLV_" + flvFileExplorerId + ".flv");
View Full Code Here

TOP

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