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

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


    SearchableDataView<Client> dataView = new SearchableDataView<Client>("clientList", sdp) {
      private static final long serialVersionUID = 2863400959190625386L;

      @Override
      protected void populateItem(final Item<Client> item) {
        Client c = item.getModelObject();
        item.add(new Label("id", c.getStreamid()));
        item.add(new Label("login", c.getUsername()));
        item.add(new Label("since", c.getConnectedSince()));
        item.add(new Label("scope", c.getScope()));
        item.add(new Label("server", c.getServer() == null ? "no cluster" : c.getServer().getAddress())); //FIXME localization
        item.add(new ConfirmableAjaxLink("kick", 605) {
          private static final long serialVersionUID = 1860369399943234763L;

          @Override
          public void onClick(AjaxRequestTarget target) {
            Client c = item.getModelObject();
            getBean(IUserService.class).kickUserByStreamId(getSid(), c.getStreamid()
                , c.getServer() == null ? 0 : c.getServer().getId());
            target.add(container, details.setVisible(false));
          }
        }.setEnabled(!TRUE.equals(c.getIsScreenClient()) && !TRUE.equals(c.getIsAVClient())));
        item.add(new AjaxEventBehavior("onclick") {
          private static final long serialVersionUID = 9180559138402389613L;

          @Override
          protected void onEvent(AjaxRequestTarget target) {
            Field[] ff = Client.class.getDeclaredFields();
            RepeatingView lines = new RepeatingView("line");
            Client c = item.getModelObject();
            for (Field f : ff) {
              int mod = f.getModifiers();
              if (Modifier.isStatic(mod) || Modifier.isTransient(mod)) {
                continue;
              }
View Full Code Here


      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
 
      log.debug("getCurrentRoomClient -2- " + streamid);
 
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);
 
      Room room = roomDao.get(room_id);
 
      if (room.getAppointment() == false) {
        throw new IllegalStateException("Room has no appointment");
      }
   
      Appointment appointment = appointmentLogic
          .getAppointmentByRoom(room_id);

      Map<String, Object> returnMap = new HashMap<String, Object>();

      returnMap.put("appointment", appointment);

      User us = userManager.getUserById(currentClient.getUser_id());
      TimeZone timezone = timezoneUtil.getTimeZone(us);

      returnMap.put("appointment", appointment);

      returnMap.put(
View Full Code Here

      String streamid = current.getClient().getId();

      log.debug("getCurrentRoomClient -1- " + SID);
      log.debug("getCurrentRoomClient -2- " + streamid);

      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);
      return currentClient;
    } catch (Exception err) {
      log.error("[getCurrentRoomClient]", err);
    }
View Full Code Here

    Long userId = sessiondataDao.checkSession(wicketSID);
    User u = userId == null ? null : usersDao.get(userId);
    if (u != null) {
      IConnection current = Red5.getConnectionLocal();
      String streamId = current.getClient().getId();
      Client currentClient = sessionManager.getClientByStreamId(streamId, null);
     
      if (!u.getOrganisation_users().isEmpty()) {
        u.setSessionData(sessiondataDao.getSessionByHash(wicketSID));
        currentClient.setUser_id(u.getUser_id());
        currentClient.setRoom_id(wicketroomid);
        SessionVariablesUtil.setUserId(current.getClient(), u.getUser_id());
     
        currentClient.setUsername(u.getLogin());
        currentClient.setFirstname(u.getFirstname());
        currentClient.setLastname(u.getLastname());
        currentClient.setPicture_uri(u.getPictureuri());
        sessionManager.updateClientByStreamId(streamId, currentClient, false, null);
       
        scopeApplicationAdapter.syncMessageToCurrentScope("roomConnect", currentClient, false);
       
        return u;
View Full Code Here

      Long loginReturn = loginUserByRemote(soapLogin.getSessionHash());

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

      if (currentClient.getUser_id() != null) {
        sessiondataDao.updateUser(SID, currentClient.getUser_id());
      }

      currentClient.setAllowRecording(soapLogin.getAllowRecording());
      sessionManager.updateClientByStreamId(streamId, currentClient, false, null);

      if (loginReturn == null) {
        log.debug("loginReturn IS NULL for SID: " + soapLogin.getSessionHash());
View Full Code Here

  public Long setUserNickName(String firstname, String lastname, String email) {
    try {

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

      currentClient.setFirstname(firstname);
      currentClient.setLastname(lastname);
      currentClient.setMail(email);

      // Log the User
      conferenceLogDao.addConferenceLog(
          "nicknameEnter", currentClient.getUser_id(), streamId,
          null, currentClient.getUserip(), currentClient.getScope(),
          currentClient.getExternalUserId(),
          currentClient.getExternalUserType(),
          currentClient.getMail(), currentClient.getFirstname(),
          currentClient.getLastname());

      this.sessionManager.updateClientByStreamId(streamId,
          currentClient, false, null);

      return 1L;
View Full Code Here

          log.debug(userObject.toString());

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

          // Check if this User is simulated in the OpenMeetings
          // Database

          if (!Strings.isEmpty(userObject.getExternalUserId())) {
            // If so we need to check that we create this user in
            // OpenMeetings and update its record

            User user = userManager.getUserByExternalIdAndType(
                userObject.getExternalUserId(),
                userObject.getExternalUserType());

            if (user == null) {
              String iCalTz = configurationDao.getConfValue("default.timezone", String.class, "");

              long userId = userManager
                  .addUserWithExternalKey(1, 0, 0,
                      userObject.getFirstname(),
                      userObject.getUsername(),
                      userObject.getLastname(), 1L,
                      true, "", // password is empty by default
                      null, null, "",
                      userObject.getExternalUserId(),
                      userObject.getExternalUserType(),
                      true, userObject.getEmail(),
                      iCalTz,
                      userObject.getPictureUrl());

              currentClient.setUser_id(userId);
              SessionVariablesUtil.setUserId(current.getClient(), userId);
            } else {
              user.setPictureuri(userObject.getPictureUrl());

              userManager.updateUser(user);

              currentClient.setUser_id(user.getUser_id());
              SessionVariablesUtil.setUserId(current.getClient(), user.getUser_id());
            }
          }

          log.debug("userObject.getExternalUserId() -2- " + currentClient.getUser_id());

          currentClient.setUserObject(userObject.getUsername(), userObject.getFirstname(), userObject.getLastname());
          currentClient.setPicture_uri(userObject.getPictureUrl());
          currentClient.setMail(userObject.getEmail());

          log.debug("UPDATE USER BY STREAMID " + streamId);

          if (currentClient.getUser_id() != null) {
            sessiondataDao.updateUser(SID, currentClient.getUser_id());
          }

          sessionManager.updateClientByStreamId(streamId, currentClient, false, null);

          return new Long(1);
View Full Code Here

   */
  public Long logoutUser(String SID) {
    try {
      Long users_id = sessiondataDao.checkSession(SID);
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager
          .getClientByStreamId(current.getClient().getId(), null);
     
      scopeApplicationAdapter.roomLeaveByScope(currentClient,current.getScope(), false);
     
      currentClient.setUserObject(null, null, null, null);
     
      return userManager.logout(SID, users_id);
    } catch (Exception err) {
      log.error("[logoutUser]",err);
    }
View Full Code Here

      String port = request.getParameter("port");
      if (port == null) {
        throw new Exception("port is empty: ");
      }
      Client rc = sessionManager.getClientByPublicSID(publicSID, false, null);
      if (rc == null) {
        throw new Exception("Port is empty");
      }
      Long roomId = rc.getRoom_id();
      if (roomId == null) {
        throw new Exception("Client has no room " + rc);
      }
      boolean allowRecording = rc.getAllowRecording() && (0 == sessionManager.getRecordingCount(roomId));
      boolean allowPublishing = (0 == sessionManager.getPublishingCount(roomId));
     
      Context ctx = new VelocityContext();
      ctx.put("APP_NAME", configurationDao.getAppName());
      ctx.put("PUBLIC_SID", publicSID);
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  public int sendMessageWithClient(Object newMessage) {
    try {
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager.getClientByStreamId(current.getClient().getId(), null);
      Long room_id = currentClient.getRoom_id();     
      log.debug("room_id: " + room_id);
     
      if (room_id == null) {
        return 1; //TODO weird
      }
      Long user_level = userManager.getUserLevelByID(currentClient.getUser_id());
      Room room = roomManager.getRoomById(user_level, 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) + " ";
      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;     

      boolean needModeration = Boolean.valueOf("" + messageMap.get(9));
      List<HashMap<String, Object>> myChatList = myChats.get(room_id);
      if (myChatList == null) myChatList = new LinkedList<HashMap<String, Object>>();
     
      HashMap<String, Object> hsm = new HashMap<String, Object>();
      hsm.put("message", newMessage);
      String publicSID = "" + messageMap.get(6);
      if (!publicSID.equals(currentClient.getPublicSID())) {
        hsm.put("client", sessionManager.getClientByPublicSID("" + messageMap.get(6), false, null));
        //need to remove unconfirmed chat message if any
        for (int i = myChatList.size() - 1; i > -1; --i) {
          Client msgClient = (Client)myChatList.get(i).get("client");
          @SuppressWarnings("rawtypes")
          List msgList = (List)myChatList.get(i).get("message");
          if (publicSID.equals(msgClient.getPublicSID())
            && ("" + msgList.get(4)).equals(messageMap.get(4))
            && ("" + msgList.get(1)).equals(messageMap.get(1))
            && Boolean.valueOf("" + msgList.get(9))) {
            myChatList.remove(i);
            break;
          }
        }
       
      } else {
        // add server time
        messageMap.set(1, parseDateAsTimeString());
        hsm.put("client", currentClient);
      }

      if (myChatList.size() == chatRoomHistory) myChatList.remove(0);
      myChatList.add(hsm);
      myChats.put(room_id, myChatList);
      log.debug("SET CHATROOM: " + room_id);

      //broadcast to everybody in the room/domain
      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) {
              continue;
            }
            if (rcl.getIsAVClient()) {
              continue;
            }
            if (rcl.getIsScreenClient() != null && rcl.getIsScreenClient()) {
                continue;
              }
            if (needModeration && Boolean.TRUE != rcl.getIsMod() && Boolean.TRUE != rcl.getIsSuperModerator()) {
              continue;
            }
            ((IServiceCapableConnection) conn).invoke("sendVarsToMessageWithClient",new Object[] { hsm }, this);
             }
          }
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.