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

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


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

        if (serverId == 0) {

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

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

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

          this.scopeApplicationAdapter.roomLeaveByScope(rcl,
              currentScope, true);

          return true;

        } else {

          Server server = serverDao.get(serverId);
          Client rcl = sessionManager.getClientByStreamId(
              streamid, server);
          slaveHTTPConnectionManager.kickSlaveUser(server, rcl.getPublicSID());
         
          // true means only the REST call is performed, it is no
          // confirmation that the user is really kicked from the
          // slave
          return true;
View Full Code Here


      Long userId, String username, String firstname, String lastname) {
    try {
      log.debug("-----------  setUsernameAndSession");
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
      Client currentClient = this.sessionManager
          .getClientByStreamId(streamid, null);

      currentClient.setUsername(username);
      currentClient.setUser_id(userId);
      SessionVariablesUtil.setUserId(current.getClient(), userId);
      currentClient.setUserObject(userId, username, firstname, lastname);

      // Update Session Data
      log.debug("UDPATE SESSION " + SID + ", " + userId);
      sessiondataDao.updateUserWithoutSession(SID, userId);

      User user = userManager.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
      User us = usersDao.get(userId);
      if (us != null && us.getPictureuri() != null) {
        // set Picture-URI
        currentClient.setPicture_uri(us.getPictureuri());
      }
      this.sessionManager.updateClientByStreamId(streamid,
          currentClient, false, null);
      return currentClient;
    } catch (Exception err) {
View Full Code Here

      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);
      // users only
      if (authLevelUtil.checkUserLevel(user_level)) {

        Client rcl = this.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 = this.scopeApplicationAdapter
            .getRoomScope(scopeName);

        HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
        messageObj.put(0, "kick");

        this.scopeApplicationAdapter.sendMessageById(messageObj,
            rcl.getStreamid(), currentScope);

        this.scopeApplicationAdapter.roomLeaveByScope(rcl,
            currentScope, true);

        return true;
View Full Code Here

  }

  public synchronized List<Client> getCurrentModeratorList() {
    try {
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager
          .getClientByStreamId(current.getClient().getId(), null);
      Long room_id = currentClient.getRoom_id();
      return this.sessionManager.getCurrentModeratorByRoom(room_id);
    } catch (Exception err) {
      log.error("[getCurrentModerator]", err);
    }
    return null;
View Full Code Here

        i++;
      }

      // Check if this User is the Mod:
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager
          .getClientByStreamId(current.getClient().getId(), null);

      if (currentClient == null) {
        return;
      }

      Long room_id = currentClient.getRoom_id();

      // log.debug("***** sendVars: " + whiteboardObj);

      // Store event in list
      String action = whiteboardObj.get(2).toString();
View Full Code Here

  public synchronized int sendVarsModeratorGeneral(Object vars) {
    log.debug("*..*sendVars: " + vars);
    try {
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager
          .getClientByStreamId(current.getClient().getId(), null);
      // Long room_id = currentClient.getRoom_id();

      log.debug("***** id: " + currentClient.getStreamid());

      boolean ismod = currentClient.getIsMod();

      if (ismod) {
        log.debug("CurrentScope :" + current.getScope().getName());
        // Send to all Clients of the same Scope
        Collection<Set<IConnection>> conCollection = current.getScope()
View Full Code Here

   * @return 1 in case of success, -1 otherwise
   */
  public synchronized int sendMessageWithClientWithSyncObject(Object newMessage, boolean sync) {
    try {
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager
          .getClientByStreamId(current.getClient().getId(), null);

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

   */
  public synchronized int sendMessageWithClientById(Object newMessage,
      String clientId) {
    try {
      IConnection current = Red5.getConnectionLocal();
      Client currentClient = this.sessionManager
          .getClientByStreamId(current.getClient().getId(), null);

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

 
  public synchronized void sendUploadCompletMessageByPublicSID(UploadCompleteMessage message, String publicSID) {
    try {
      //if the upload is locally, just proceed to the normal function
      //Search for RoomClient on current server (serverId == null means it will look on the master for the RoomClient)
      Client currentClient = this.sessionManager
                .getClientByPublicSID(publicSID, false, null);
     
      if (currentClient != null) {
        sendMessageWithClientByPublicSID(message, publicSID);
      } else {
View Full Code Here

          .getScope(OpenmeetingsVariables.webAppRootKey);

      // log.debug("webAppKeyScope "+webAppKeyScope);

      // Get Room Id to send it to the correct Scope
      Client currentClient = this.sessionManager
          .getClientByPublicSID(publicSID, false, null);

      if (currentClient == null) {
        throw new Exception(
            "Could not Find RoomClient on List publicSID: "
                + publicSID);
      }
      // default Scope Name
      String scopeName = "hibernate";
      if (currentClient.getRoom_id() != null) {
        scopeName = currentClient.getRoom_id().toString();
      }

      IScope scopeHibernate = webAppKeyScope.getScope(scopeName);

      // log.debug("scopeHibernate "+scopeHibernate);
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.