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

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


    }

    try {
      log.warn("loginUser: " + SID + " " + usernameOrEmail);

      Client currentClient;
      IConnection current = Red5.getConnectionLocal();

      if (current == null)
        return null;
     
      Object o;

      if (withLdap) {
        log.debug("Ldap Login");

        currentClient = sessionManager
            .getClientByStreamId(current.getClient().getId(), null);

        // LDAP Loggedin Users cannot use the permanent Login Flag

        LdapConfig ldapConfig = ldapConfigDao.get(ldapConfigId);

        String ldapLogin = usernameOrEmail;
        if (ldapConfig.getAddDomainToUserName() != null
            && ldapConfig.getAddDomainToUserName()) {
          ldapLogin = usernameOrEmail + "@" + ldapConfig.getDomain();
        }

        o = ldapLoginManagement.doLdapLogin(ldapLogin,
            Userpass, currentClient, current.getClient(), SID,
            ldapConfig.getConfigFileName());
      } else {

        currentClient = sessionManager.getClientByStreamId(current.getClient().getId(), null);

        o = userManager.loginUser(SID, usernameOrEmail, Userpass,
            currentClient, current.getClient(), storePermanent);
      }

      if (o == null)
        return null;

      if (!o.getClass().isAssignableFrom(User.class))
        return o;

      if (currentClient.getUser_id() != null
          && currentClient.getUser_id() > 0) {

        User u = (User) o;
        currentClient.setFirstname(u.getFirstname());
        currentClient.setLastname(u.getLastname());

        Collection<Set<IConnection>> conCollection = current.getScope()
            .getConnections();
        for (Set<IConnection> conset : conCollection) {
          for (IConnection cons : conset) {
            if (cons != null) {
              Client rcl = this.sessionManager
                  .getClientByStreamId(cons.getClient()
                      .getId(), null);
              if (rcl != null && rcl.getIsScreenClient() != null
                  && rcl.getIsScreenClient()) {
                // continue;
              } else {
                if (cons instanceof IServiceCapableConnection) {
                  if (!cons.equals(current)) {
                    // log.error("sending roomDisconnect to "
View Full Code Here


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

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

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

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

      if (loginReturn == null) {
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

              + ", "
              + userObject.getLastname());

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

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

          log.debug("userObject.getExternalUserId() -1- "
              + userObject.getExternalUserId());

          if (userObject.getExternalUserId() != null
              && userObject.getExternalUserId() != null &&
              !"".equals(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 jName_timeZone = 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(),
                      jName_timeZone,
                      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());
          }

          this.sessionManager.updateClientByStreamId(streamId,
              currentClient, false, null);
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 swfURL = "";
      if (conn.getConnectParams().get("swfUrl") != null) {
        swfURL = conn.getConnectParams().get("swfUrl").toString();
      }

      Client rcm = this.sessionManager.addClientListItem(streamId,
          conn.getScope().getName(), conn.getRemotePort(),
          conn.getRemoteAddress(), swfURL, isAVClient, null);
     
      SessionVariablesUtil.initClient(conn.getClient(), isAVClient, rcm.getPublicSID());

      // Log the User
      conferenceLogDao.addConferenceLog("ClientConnect",
          rcm.getUser_id(), streamId, null, rcm.getUserip(),
          rcm.getScope(), rcm.getExternalUserId(),
          rcm.getExternalUserType(), rcm.getMail(),
          rcm.getFirstname(), rcm.getLastname());
    } catch (Exception err) {
      log.error("roomJoin", err);
    }
    return true;
  }
View Full Code Here

  public synchronized Map<String, String> screenSharerAction(Map<String, Object> map) {
    try {
      log.debug("-----------  screenSharerAction");
      IConnection current = Red5.getConnectionLocal();

      Client rc = sessionManager.getClientByStreamId(current.getClient().getId(), null);

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

      if (rc != null) {
        boolean changed = false;
        if (Boolean.valueOf("" + map.get("stopStreaming")) && rc.isStartStreaming()) {
          changed = true;
          rc.setStartStreaming(false);
          //Send message to all users
          syncMessageToCurrentScope("stopScreenSharingMessage", rc, false);
         
          returnMap.put("result", "stopSharingOnly");
        }
        if (Boolean.valueOf("" + map.get("stopRecording")) && rc.getIsRecording()) {
          changed = true;
          rc.setStartRecording(false);
          rc.setIsRecording(false);
         
          returnMap.put("result", "stopRecordingOnly");
          //Send message to all users
          syncMessageToCurrentScope("stopRecordingMessage", rc, false);

          flvRecorderService.stopRecordAndSave(current.getScope(), rc, null);
        }
        if (Boolean.valueOf("" + map.get("stopPublishing")) && rc.isScreenPublishStarted()) {
          changed = true;
          rc.setScreenPublishStarted(false);
          returnMap.put("result", "stopPublishingOnly");
         
          //Send message to all users
          syncMessageToCurrentScope("stopPublishingMessage", rc, false);
        }
       
        if (changed) {
          sessionManager.updateClientByStreamId(rc.getStreamid(), rc, false, null);
         
          if (!rc.isStartStreaming() && !rc.isStartRecording() && !rc.isStreamPublishStarted()) {
            returnMap.put("result", "stopAll");
          }
        }
      }
      return returnMap;
View Full Code Here

      log.debug("checkScreenSharing -2- " + streamid);

      List<Client> screenSharerList = new LinkedList<Client>();

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

      for (Client rcl : sessionManager.getClientListByRoomAll(currentClient.getRoom_id())) {
        if (rcl.isStartStreaming()) {
          screenSharerList.add(rcl);
        }
      }
View Full Code Here

      log.debug("-----------  setConnectionAsSharingClient");
      IConnection current = Red5.getConnectionLocal();
      // IServiceCapableConnection service = (IServiceCapableConnection)
      // current;

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

      if (currentClient != null) {

        boolean startRecording = Boolean.valueOf("" + map.get(
            "startRecording"));
        boolean startStreaming = Boolean.valueOf("" + map.get(
            "startStreaming"));
        boolean startPublishing = Boolean.valueOf("" + map.get(
            "startPublishing")) && (0 == sessionManager.getPublishingCount(currentClient.getRoom_id()));

        currentClient.setRoom_id(Long.parseLong(current.getScope()
            .getName()));

        // Set this connection to be a RTMP-Java Client
        currentClient.setIsScreenClient(true);
       
        SessionVariablesUtil.setIsScreenClient(current.getClient());
       
        currentClient.setUser_id(Long.parseLong(map.get("user_id")
            .toString()));
        SessionVariablesUtil.setUserId(current.getClient(), Long.parseLong(map.get("user_id")
            .toString()));

        boolean alreadyStreaming = currentClient.isStartStreaming();
        if (startStreaming) {
          currentClient.setStartStreaming(true);
        }
        boolean alreadyRecording = currentClient.isStartRecording();
        if (startRecording) {
          currentClient.setStartRecording(true);
        }
        if (startPublishing) {
          currentClient.setStreamPublishStarted(true);
        }

        currentClient.setOrganization_id(Long.parseLong(map.get(
            "organization_id").toString()));

        this.sessionManager.updateClientByStreamId(current
            .getClient().getId(), currentClient, false, null);

        Map returnMap = new HashMap();
        returnMap.put("alreadyPublished", false);

        // if is already started screen sharing, then there is no need
        // to start it again
        if (currentClient.isScreenPublishStarted()) {
          returnMap.put("alreadyPublished", true);
        }

        currentClient.setVX(Integer.parseInt(map.get("screenX")
            .toString()));
        currentClient.setVY(Integer.parseInt(map.get("screenY")
            .toString()));
        currentClient.setVWidth(Integer.parseInt(map.get("screenWidth")
            .toString()));
        currentClient.setVHeight(Integer.parseInt(map.get(
            "screenHeight").toString()));

        log.debug("screen x,y,width,height " + currentClient.getVX()
            + " " + currentClient.getVY() + " "
            + currentClient.getVWidth() + " "
            + currentClient.getVHeight());

        log.debug("publishName :: " + map.get("publishName"));

        currentClient.setStreamPublishName(map.get("publishName")
            .toString());

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

        currentClient.setFirstname(currentScreenUser.getFirstname());
        currentClient.setLastname(currentScreenUser.getLastname());

        // This is duplicated, but its not sure that in the meantime
        // somebody requests this Client Object Info
        this.sessionManager.updateClientByStreamId(current
            .getClient().getId(), currentClient, false, null);
View Full Code Here

      Long user_level = getUserLevelByID(users_id);

      // admins only
      if (authLevelUtil.checkWebServiceLevel(user_level)) {

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

        if (rcl == null) {
          return true;
        }

        String scopeName = "hibernate";
        if (rcl.getRoom_id() != null) {
          scopeName = rcl.getRoom_id().toString();
        }
        IScope currentScope = scopeApplicationAdapter
            .getRoomScope(scopeName);

        HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
        messageObj.put(0, "kick");
        scopeApplicationAdapter.sendMessageById(messageObj,
            rcl.getStreamid(), currentScope);

        scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope, true);

        return true;
      }
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.