Package org.red5.server.api

Examples of org.red5.server.api.IConnection


      }
     
      //Map whiteboardObj = (Map) whiteboardObjParam;
      
      // Check if this User is the Mod:
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
     
      if (currentClient == null) {
        return;
      }
     
      Long room_id = currentClient.getRoom_id()
       
      //log.debug("***** sendVars: " + whiteboardObj);
     
      //Store event in list
      String action = whiteboardObj.get(2).toString()
     
      if (action.equals("deleteMindMapNodes")) {
       
        //Simulate Single Delete Events for z-Index
        List actionObject = (List) whiteboardObj.get(3);
       
        List<List> itemObjects = (List) actionObject.get(3);
       
        Map whiteboardTempObj = new HashMap();
        whiteboardTempObj.put(2,"delete");
       
        for (List itemObject : itemObjects) {
         
          List<Object> tempActionObject = new LinkedList<Object>();
          tempActionObject.add("mindmapnode");
          tempActionObject.add(itemObject.get(0)); //z-Index -8
          tempActionObject.add(null); //simulate -7
          tempActionObject.add(null); //simulate -6
          tempActionObject.add(null); //simulate -5
          tempActionObject.add(null); //simulate -4
          tempActionObject.add(null); //simulate -3
          tempActionObject.add(null); //simulate -2
          tempActionObject.add(itemObject.get(1)); //Object-Name -1
         
          whiteboardTempObj.put(3, tempActionObject);
         
          WhiteboardManagement.getInstance().addWhiteBoardObjectById(room_id, whiteboardTempObj, whiteboardId);
         
        }
       
      } else {
       
        WhiteboardManagement.getInstance().addWhiteBoardObjectById(room_id, whiteboardObj, whiteboardId);
       
      }
     
     
     
      int numberOfUsers = 0;
     
      //This is no longer necessary
      //boolean ismod = currentClient.getIsMod();
     
      //log.debug("*..*ismod: " + ismod);
 
      //if (ismod) {
     
      Map<String,Object> sendObject = new HashMap<String,Object>();
      sendObject.put("id", whiteboardId);
      sendObject.put("param", whiteboardObjParam);
     
      Configuration conf = Configurationmanagement.getInstance().getConfKey(3, "show.whiteboard.draw.status");
      boolean showDrawStatus = conf != null && "1".equals(conf.getConf_value());

      //Notify all Clients of that Scope (Room)
      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());
View Full Code Here


 

  public synchronized int sendVarsModeratorGeneral(Object vars) {
    log.debug("*..*sendVars: " + vars);
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      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().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());
View Full Code Here

    return -1;
  }

  public synchronized int sendMessage(Object newMessage) {
    try {
      IConnection current = Red5.getConnectionLocal();
      //RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
       
      //Send to all Clients of that Scope(Room)
      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());
View Full Code Here

    return 1;
  }

  public synchronized int sendBrowserMessageToMembers(Object newMessage) {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
       
      List newMessageList = (List) newMessage;
     
      String action = newMessageList.get(0).toString();
     
      //"closeBrowserURL"
      //"initBrowser"
      //newBrowserURL
     
      BrowserStatus browserStatus = (BrowserStatus) current.getScope().getAttribute("browserStatus");
     
      if (browserStatus == null) {
        browserStatus = new BrowserStatus();
      }
     
      if (action.equals("initBrowser") || action.equals("newBrowserURL")) {
        browserStatus.setBrowserInited(true);
        browserStatus.setCurrentURL(newMessageList.get(1).toString());
      } else if (action.equals("closeBrowserURL")) {
        browserStatus.setBrowserInited(false);
      }
     
      current.getScope().setAttribute("browserStatus", browserStatus);
     
     
      //Send to all Clients of that Scope(Room)
      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());
View Full Code Here

    return 1;
  }
 
  public synchronized int sendMessageToMembers(Object newMessage) {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
       
      //Send to all Clients of that Scope(Room)
      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());
View Full Code Here

            Long user_level = Usermanagement.getInstance().getUserLevelByID(
                    users_id);
           
            if (AuthLevelmanagement.getInstance().checkUserLevel(user_level)) {
             
              IConnection current = Red5.getConnectionLocal();
          RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
         
          if (currentClient == null) {
            return;
          }
             
                String roomName = room_id.toString();
                String current_dir = ScopeApplicationAdapter.webAppPath
                        + File.separatorChar + "upload" + File.separatorChar;
                log.debug("### this is my working directory: " + current_dir);
               
                FileExplorerItem fileExplorerItem = FileExplorerItemDaoImpl.getInstance().getFileExplorerItemsById(fileExplorerItemId);

                ArrayList roomItems = LibraryWmlLoader.getInstance().loadWmlFile(current_dir,
                                    fileExplorerItem.getWmlFilePath());
               
                Map whiteboardObjClear = new HashMap();
                whiteboardObjClear.put(2, "clear");
                whiteboardObjClear.put(3, null);
         
          WhiteboardManagement.getInstance().addWhiteBoardObjectById(room_id, whiteboardObjClear, whiteboardId);
         
               
                for (int k=0;k<roomItems.size();k++) {
                 
                  ArrayList actionObject = (ArrayList) roomItems.get(k);
                 
                  Map whiteboardObj = new HashMap();
                  whiteboardObj.put(2, "draw");
                  whiteboardObj.put(3, actionObject);
             
              WhiteboardManagement.getInstance().addWhiteBoardObjectById(room_id, whiteboardObj, whiteboardId);
             
                }
               
               
                Map<String,Object> sendObject = new HashMap<String,Object>();
          sendObject.put("id", whiteboardId);
          sendObject.put("roomitems", roomItems);
         
          //Notify all Clients of that Scope (Room)
          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());
View Full Code Here

            Long user_level = Usermanagement.getInstance().getUserLevelByID(
                    users_id);

            if (AuthLevelmanagement.getInstance().checkUserLevel(user_level)) {

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

                RoomClient currentClient = this.clientListManager
                        .getClientByStreamId(streamid);

                Long room_id = currentClient.getRoom_id();
View Full Code Here

    return 1;
  }
 
  public synchronized int sendMessageWithClient(Object newMessage) {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      Long room_id = currentClient.getRoom_id()
       
     
      HashMap<String,Object> hsm = new HashMap<String,Object>();
      hsm.put("client", currentClient);
      hsm.put("message", newMessage);
     
      //broadcast to everybody in the Scope (Room)
      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());
View Full Code Here

   * @param clientId
   * @return
   */
  public synchronized int sendMessageById(Object newMessage, String clientId, IScope scope) {
    try {
      IConnection current = Red5.getConnectionLocal();
     
      log.debug("### sendMessageById ###"+clientId);
     
      HashMap<String,Object> hsm = new HashMap<String,Object>();
      hsm.put("message", newMessage);
View Full Code Here

    return 1;
  }

  public synchronized int sendMessageWithClientById(Object newMessage, String clientId) {
    try {
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
     
      log.debug("### sendMessageWithClientById ###"+clientId);
     
      HashMap<String,Object> hsm = new HashMap<String,Object>();
      hsm.put("client", currentClient);
      hsm.put("message", newMessage);
     
      //broadcast Message to specific user with id inside the same Scope
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
            if (rcl == null) {
View Full Code Here

TOP

Related Classes of org.red5.server.api.IConnection

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.