Package org.openmeetings.app.persistence.beans.recording

Examples of org.openmeetings.app.persistence.beans.recording.RoomClient


 
  public int vote(int pollvalue,int pollTypeId){
    int returnVal=0;
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient rc = this.clientListManager.getClientByStreamId(current.getClient().getId());
     
      if (rc==null){
        log.error("RoomClient IS NULL for ClientID: "+current.getClient().getId());
        return -1;
      }
      //get Poll
      RoomPoll roomP = pollList.get(rc.getRoom_id());
     
      if (roomP==null){
        log.error("POLL IS NULL for RoomId: "+rc.getRoom_id());
        return -1;
      }
     
      log.debug("vote: "+pollvalue+" "+pollTypeId+" "+roomP.getPollQuestion());
     
      //Check if this user has already voted
      if(this.hasVoted(roomP,rc.getStreamid())){
        log.debug("hasVoted: true");
        return -1;
      } else {
        log.debug("hasVoted: false");
        RoomPollAnswers rpA = new RoomPollAnswers();
View Full Code Here


    List<RoomPollAnswers> answerList = roomP.getRoomPollAnswerList();
    Iterator<RoomPollAnswers> iter = answerList.iterator();
    log.debug("hasVoted: "+streamid);
    while (iter.hasNext()){
      RoomPollAnswers rpA = iter.next();
      RoomClient rc = rpA.getVotedClients();
      if (rc.getStreamid().equals(streamid)){
        return true;
      }
    }
    return false;
  }
View Full Code Here

  }
 
  public RoomPoll getVotes(){
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient rc =this.clientListManager.getClientByStreamId(current.getClient().getId());
     
      //get Poll
      return pollList.get(rc.getRoom_id())
    } catch (Exception err) {
      log.error("[getVotes]",err);
    }
    return null;
  }
View Full Code Here

    IConnection current = Red5.getConnectionLocal();
    String streamid = current.getClient().getId();
   
    log.debug("getCurrentRoomClient -2- "+streamid);
   
    RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
   
    Rooms room = Roommanagement.getInstance().getRoomById(room_id);
   
    if(room.getAppointment() == false)
      return null;
   
    try{
      Appointment appointment = AppointmentLogic.getInstance().getAppointmentByRoom(room_id);
     
      Map returnMap = new HashMap();
     
      returnMap.put("appointment", appointment);
     
      Users us = Usermanagement.getInstance().getUserById(currentClient.getUser_id());
     
      String jNameTimeZone = null;
      if (us != null && us.getOmTimeZone() != null) {
        jNameTimeZone = us.getOmTimeZone().getJname();
      } else {
View Full Code Here

    try {
      //log.error("getRoomClientsListByRoomId: "+room_id);
      LinkedList<RoomClient> clients = new LinkedList<RoomClient>();
      HashMap<String,RoomClient> clientList =this.clientListManager.getClientListByRoom(room_id);
      for (Iterator<String> iter = clientList.keySet().iterator();iter.hasNext();) {
        RoomClient rcl = clientList.get(iter.next());
        //log.error("COMPARE: "+rcl.getRoom_id()+" || "+room_id);
        clients.add(rcl);
      }
      return clients;
    } catch (Exception err) {
View Full Code Here

      //log.debug("roomClientList :: Number of Users :: "+roomClientList.size()+" ::room_id:: "+room_id);

      HashMap<String,RoomClient> clientListRoom = this.clientListManager.getClientListByRoom(room_id);
      for (Iterator<String> iter=clientListRoom.keySet().iterator();iter.hasNext();) {
        String key = (String) iter.next();
        RoomClient rcl = this.clientListManager.getClientByStreamId(key);
        //log.debug("#+#+#+#+##+## logicalRoomEnter ClientList key: "+rcl.getRoom_id()+" "+room_id);
        //log.debug("set to ++ for client: "+rcl.getStreamid());
        //Add user to List
        roomClientList.put(key, rcl);
      }
View Full Code Here

  public synchronized RoomClient setUsername(Long userId, String username, String firstname, String lastname){
    try {
      log.debug("#*#*#*#*#*#*# setUsername userId: "+userId+" username: "+username+" firstname: "+firstname+" lastname: "+lastname);
      IConnection current = Red5.getConnectionLocal();     
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
      log.debug("[setUsername] id: "+currentClient.getStreamid());
     
      currentClient.setUsername(username);
      currentClient.setUser_id(userId);
      currentClient.setUserObject(userId, username, firstname, lastname);
     
      //Update Session Data
      log.debug("UDPATE SESSION "+currentClient.getPublicSID()+", "+userId);
     
      Sessionmanagement.getInstance().updateUser(currentClient.getPublicSID(), userId,false,null);
     
      //only fill this value from User-REcord
      //cause invited users have non
      //you cannot set the firstname,lastname from the UserRecord
      Users us = UsersDaoImpl.getInstance().getUser(userId);
      if (us!=null && us.getPictureuri()!=null){
        //set Picture-URI
        log.debug("###### SET PICTURE URI");
        currentClient.setPicture_uri(us.getPictureuri());
      }
      this.clientListManager.updateClientByStreamId(streamid, currentClient);
      return currentClient;
    } catch (Exception err){
      log.error("[setUsername]",err);
View Full Code Here

  }
 
  public List<HashMap<String,Object>> clearChat() {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      Long room_id = currentClient.getRoom_id();
     
      Long chatroom = room_id;
      log.debug("### GET CHATROOM: "+chatroom);
     
      List<HashMap<String,Object>> myChatList = myChats.get(chatroom);
      myChatList = new LinkedList<HashMap<String,Object>>();
     
      myChats.put(chatroom,myChatList);
     
      HashMap<String,Object> hsm = new HashMap<String,Object>();
     
      //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) {
     
                RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
                if (!rcl.getIsScreenClient()) {
                  log.debug("*..*idremote: " + rcl.getStreamid());
                  log.debug("*..*my idstreamid: " + currentClient.getStreamid());
                  ((IServiceCapableConnection) conn).invoke("clearChatContent",new Object[] { hsm }, this);
                }
              }
            }
View Full Code Here

          String picture_uri){
    try {
      log.debug("#*#*#*#*#*#*# setUsername userId: "+userId+" username: "+username+" firstname: "+firstname+" lastname: "+lastname);
      IConnection current = Red5.getConnectionLocal();     
      String streamid = current.getClient().getId();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
      log.debug("[setUsername] id: "+currentClient.getStreamid());
     
      currentClient.setUsername(username);
      currentClient.setUser_id(userId);
      currentClient.setPicture_uri(picture_uri);
      currentClient.setUserObject(userId, username, firstname, lastname);
     
      //Update Session Data
      log.debug("UDPATE SESSION "+SID+", "+userId);
      Sessionmanagement.getInstance().updateUserWithoutSession(SID, userId);
     
      Users user = Usermanagement.getInstance().getUserById(userId);
     
      if (user != null) {
        currentClient.setExternalUserId(user.getExternalUserId());
        currentClient.setExternalUserType(user.getExternalUserType());
      }
     
      //only fill this value from User-Record
      //cause invited users have non
      //you cannot set the firstname,lastname from the UserRecord
      Users us = UsersDaoImpl.getInstance().getUser(userId);
      if (us!=null && us.getPictureuri()!=null){
        //set Picture-URI
        log.debug("###### SET PICTURE URI");
        currentClient.setPicture_uri(us.getPictureuri());
      }
      this.clientListManager.updateClientByStreamId(streamid, currentClient);
      return currentClient;
    } catch (Exception err){
      log.error("[setUsername]",err);
View Full Code Here

  }
 
  public List<HashMap<String,Object>> getRoomChatHistory() {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      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

TOP

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