Esempio n. 1
0
  private void addToWaitList(String remoteUserName, String repeaterid, boolean immediately)
      throws Exception {
    log.info("addToWaitList " + remoteUserName + "," + repeaterid);
    WaitViewParamBean bean = new WaitViewParamBean();
    bean.setRemoteUserName(remoteUserName);
    bean.setRepeaterid(repeaterid);

    String vnccolor = ConfigUtil.getProperty("VncColors", "Full");
    Integer nport = ConfigUtil.getIntProperty("repeaterport");

    String[] parameters =
        new String[] {
          "HOST",
          "ID",
          "PORT",
          repeaterid,
          "PASSWORD",
          ConfigUtil.getProperty("screenSharePasswd"),
          "View only",
          "Yes",
          "Restricted colors",
          vnccolor,
          "REPEATERHOST",
          DataUtil.getValue(DataUtil.Key.RepeaterHost),
          "REPEATERPORT",
          nport.toString()
        };

    bean.setArgs(parameters);

    //
    //	services.getScreenShareService().addRepeaterID((String)DataUtil.getValue(DataUtil.Key.RepeaterHost), Integer.parseInt(repeaterid));
    //		Thread.sleep(3000);
    waitlist.offer(bean);
  }
Esempio n. 2
0
        @Override
        public void run() {
          WaitViewParamBean poll;
          while (true) {
            try {
              poll = waitlist.poll(1000, TimeUnit.MILLISECONDS);
              if (poll != null) {

                String[] args = poll.getArgs();
                String remoteUserName = poll.getRemoteUserName();
                String repeaterid = poll.getRepeaterid();

                services
                    .getScreenShareService()
                    .addRepeaterID(
                        (String) DataUtil.getValue(DataUtil.Key.RepeaterHost),
                        Integer.parseInt(repeaterid));
                //						Thread.sleep(2000);
                ShareFileServerUtil.getInstance()
                    .startScreenShareToOneClient(
                        DataUtil.getLoginInfo().getConfno(), remoteUserName, repeaterid, args);
              }
            } catch (Exception e) {
              log.error("looThread.run", e);
            }
          }
        }
Esempio n. 3
0
  public void createDesktopView(
      String ip, int port, String password, String remoteUserName, Map<String, Integer> repeaterids)
      throws Exception {
    Integer nport = port;
    String innat = ConfigUtil.getProperty("IsInNat", "true");
    String[] parameters =
        new String[] {
          "HOST",
          ip,
          "PORT",
          nport.toString(),
          "PASSWORD",
          password,
          "View only",
          "Yes",
          "Restricted colors",
          "Full"
        };
    if (!innat.equals("true")) {
      if (repeaterids != null && repeaterids.size() != 0) {

        Integer id = repeaterids.get(remoteUserName + "-" + DataUtil.getLoginInfo().getUsername());
        Collection<Integer> values = repeaterids.values();

        Set<String> keySet = repeaterids.keySet();
        for (String string : keySet) {
          log.info("repeaterids key:" + string + " value:" + repeaterids.get(string));
        }
        String vnccolor = ConfigUtil.getProperty("VncColors", "Full");
        if (id != null) {

          nport = ConfigUtil.getIntProperty("repeaterport");
          parameters =
              new String[] {
                "HOST",
                "ID",
                "PORT",
                id.toString(),
                "PASSWORD",
                password,
                "View only",
                "Yes",
                "Restricted colors",
                vnccolor,
                "REPEATERHOST",
                DataUtil.getValue(DataUtil.Key.RepeaterHost),
                "REPEATERPORT",
                nport.toString()
              };
          createDesktopViewFromParameters(parameters, remoteUserName, id.toString());
        }
        log.info(
            "createDesktopView "
                + remoteUserName
                + "-"
                + DataUtil.getLoginInfo().getUsername()
                + " id:"
                + id);
      }
    } else {
      createDesktopViewFromParameters(parameters, remoteUserName, "");
      log.info(
          "createDesktopView "
              + remoteUserName
              + "-"
              + DataUtil.getLoginInfo().getUsername()
              + " noid");
    }
  }