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

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


   */
  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


  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
      Collection<Set<IConnection>> conCollection = current.getScope()
          .getConnections();
      for (Set<IConnection> conset : conCollection) {
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

  //FIXME copy/past need to be removed
  @SuppressWarnings("unchecked")
  public int sendMessageWithClientByPublicSID(Object newMessage, String publicSID) {
    try {
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager.getClientByStreamId(current.getClient().getId(), null);
      Long room_id = currentClient.getRoom_id();
      Long user_level = userManager.getUserLevelByID(currentClient.getUser_id());
      Room room = roomManager.getRoomById(user_level, room_id);
      log.debug("room_id: " + room_id);

      @SuppressWarnings("rawtypes")
      ArrayList messageMap = (ArrayList) newMessage;
      // adding delimiter space, cause otherwise an emoticon in the last
      // string would not be found
      String messageText = messageMap.get(4).toString() + " ";
      // add server time
      messageMap.set(1, parseDateAsTimeString());
      LinkedList<String[]> parsedStringObjects = ChatString.parseChatString(messageText, emoticonsManager.getEmotfilesList(), room.getAllowFontStyles());
      // log.error("parsedStringObjects"+parsedStringObjects.size());
      log.debug("size:" + messageMap.size());
      messageMap.add(parsedStringObjects);
      newMessage = messageMap;

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

      // broadcast to everybody in the room/domain
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
                IClient client = conn.getClient();
              if (SessionVariablesUtil.isScreenClient(client)) {
                // screen sharing clients do not receive events
                continue;
              } else if (SessionVariablesUtil.isAVClient(client)) {
                // AVClients or potential AVClients do not receive events
                continue;
              }

              if (SessionVariablesUtil.getPublicSID(client).equals(publicSID)
                  || SessionVariablesUtil.getPublicSID(client).equals(
                      currentClient.getPublicSID())) {
                ((IServiceCapableConnection) conn).invoke(
                  "sendVarsToMessageWithClient",
                    new Object[] { hsm }, this);
              }
            }
View Full Code Here

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

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

            Client currentClient = this.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
        this.sessionManager.updateClientByStreamId(
            currentClient.getStreamid(), currentClient, false, null);
       
      // Notify all clients of the same scope (room)
      Collection<Set<IConnection>> conCollection = current.getScope()
          .getConnections();
      for (Set<IConnection> conset : conCollection) {
View Full Code Here

  }

  public List<HashMap<String,Object>> clearChat() {
    try {
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager.getClientByStreamId(current.getClient().getId(), null);
      Long room_id = currentClient.getRoom_id();
     
      Long chatroom = room_id;
      log.debug("### GET CHATROOM: "+chatroom);
     
      List<HashMap<String,Object>> myChatList = myChats.get(chatroom);
View Full Code Here

  }
 
  public List<HashMap<String,Object>> getRoomChatHistory() {
    try {
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager.getClientByStreamId(current.getClient().getId(), null);
      Long room_id = currentClient.getRoom_id();
     
      log.debug("GET CHATROOM: " + room_id);
     
      List<HashMap<String,Object>> myChatList = myChats.get(room_id);
      if (myChatList==null) myChatList = new LinkedList<HashMap<String,Object>>();
     
      if (Boolean.TRUE != currentClient.getIsMod() && Boolean.TRUE != currentClient.getIsSuperModerator()) {
        //current user is not moderator, chat history need to be filtered
        List<HashMap<String,Object>> tmpChatList = new LinkedList<HashMap<String,Object>>(myChatList);
        for (int i = tmpChatList.size() - 1; i > -1; --i) {
          @SuppressWarnings("rawtypes")
          List msgList = (List)tmpChatList.get(i).get("message");
View Full Code Here

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

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

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

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

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

      // 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) {
            Client rcl = this.sessionManager
                .getClientByStreamId(conn.getClient().getId(), null);
            if (rcl == null) {
              // continue;
            } else if (rcl.getIsScreenClient() != null
                && rcl.getIsScreenClient()) {
              // continue;
            } else {
              if (rcl != currentClient) {
                rcl.setMicMuted(true);
                this.sessionManager.updateClientByStreamId(
                    rcl.getStreamid(), rcl, false, null);
              }
              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

   */
  @SuppressWarnings({ "rawtypes", "unchecked" })
  public int sendMessageToOverallChat(Object newMessage) {
    try {
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager.getClientByStreamId(current.getClient().getId(), null);
     
      //log.error(newMessage.getClass().getName());
      ArrayList messageMap = (ArrayList) newMessage;
      //adding delimiter space, cause otherwise an emoticon in the last string would not be found
      String messageText = messageMap.get(4).toString()+" ";
View Full Code Here

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

      Client currentClient = sessionManager.getClientByPublicSID(publicSID, false, null);
      if (currentClient == null) {
        return -1L;
      }

      currentClient.setMicMuted(mute);
      sessionManager.updateClientByStreamId(currentClient.getStreamid(), currentClient, false, null);

      HashMap<Integer, Object> newMessage = new HashMap<Integer, Object>();
      newMessage.put(0, "updateMuteStatus");
      newMessage.put(1, currentClient);
      sendMessageWithClient(newMessage);
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.