Package jnode.main

Examples of jnode.main.SystemInfo


    if (ThreadPool.isBusy()) {
      busy("Too much connections");
      finish("From greet()");
    }
    addTimeout();
    SystemInfo info = MainHandler.getCurrentInstance().getInfo();
    ourAddress.addAll(info.getAddressList());
    frames.addLast(new BinkpFrame(BinkpCommand.M_NUL, "SYS "
        + info.getStationName()));
    frames.addLast(new BinkpFrame(BinkpCommand.M_NUL, "ZYZ "
        + info.getSysop()));
    frames.addLast(new BinkpFrame(BinkpCommand.M_NUL, "LOC "
        + info.getLocation()));
    frames.addLast(new BinkpFrame(BinkpCommand.M_NUL, "NDL "
        + info.getNDL()));
    frames.addLast(new BinkpFrame(BinkpCommand.M_NUL, "VER "
        + MainHandler.getVersion() + " binkp/1.1"));
    frames.addLast(new BinkpFrame(BinkpCommand.M_NUL, "TIME "
        + format.format(new Date())));
View Full Code Here


    }
  }

  private void doInstall() {
    logger.l1("[+] Creating database data");
    SystemInfo info = MainHandler.getCurrentInstance().getInfo();

    // robots
    Robot areafix = new Robot();
    areafix.setClassName(AreaFix.class.getCanonicalName());
    areafix.setRobot("areafix");
    ORMManager.get(Robot.class).save(areafix);
    Robot filefix = new Robot();
    filefix.setClassName(FileFix.class.getCanonicalName());
    filefix.setRobot("filefix");
    ORMManager.get(Robot.class).save(filefix);

    Robot scriptfix = new Robot();
    scriptfix.setClassName(ScriptFix.class.getCanonicalName());
    scriptfix.setRobot("scriptfix");
    ORMManager.get(Robot.class).save(scriptfix);

    logger.l1("[+] Robots created");

    // owner's point
    String ownAddr = FtnTools.getPrimaryFtnAddress().toString();
    if (!ownAddr.contains(".")) {
      ownAddr += ".1";
    }
    Link owner = ORMManager.get(Link.class).getFirstAnd("ftn_address", "=",
        ownAddr);
    if (owner == null) {
      owner = new Link();
      owner.setLinkName(info.getSysop());
      owner.setLinkAddress(ownAddr);
      owner.setProtocolHost("-");
      owner.setProtocolPort(0);
      owner.setPaketPassword(FtnTools.generate8d());
      owner.setProtocolPassword(owner.getPaketPassword());
      ORMManager.get(Link.class).save(owner);
      logger.l1("[+] owner point account created");
      logger.l1(String.format("\n\tFTN: %s\n\tAka: %s\n\tPassword: %s\n",
          owner.getLinkAddress(), owner.getLinkName(),
          owner.getPaketPassword()));
      long nice = 1;
      Rewrite rw = new Rewrite();
      rw.setType(Type.NETMAIL);
      rw.setLast(true);
      rw.setNice(nice++);
      rw.setOrig_from_addr("^"
          + ownAddr.replace(".", "\\.").replace("/", "\\/") + "$");
      rw.setNew_from_addr(FtnTools.getPrimaryFtnAddress().toString());
      ORMManager.get(Rewrite.class).save(rw);

      for (FtnAddress address : info.getAddressList()) {
        Rewrite rw2 = new Rewrite();
        rw2.setType(Type.NETMAIL);
        rw2.setLast(true);
        rw2.setNice(nice++);
        rw2.setOrig_to_addr("^"
View Full Code Here

  public Object handle(Request req, Response resp) {
    String index = HTML.getContents("index.html");
    if (index.length() > 0) {
      return index;
    }
    SystemInfo info = MainHandler.getCurrentInstance().getInfo();

    String text = String.format(
        FORMAT_TABLE,
        String.format(FORMAT_TR, "Имя узла", info.getStationName())
            + String.format(FORMAT_TR, "Расположение узла",
                info.getLocation())
            + String.format(FORMAT_TR, "Сисоп", info.getSysop())
            + String.format(FORMAT_TR, "FTN-адрес(а)",
                getAddrList(info.getAddressList()))
            + String.format(FORMAT_TR, "Версия софта",
                MainHandler.getVersion())
            + String.format(FORMAT_TR, "ОС", getOS()));
    return HTML.start(false).append(text).footer().get();
  }
View Full Code Here

TOP

Related Classes of jnode.main.SystemInfo

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.