Examples of FtnNdlAddress


Examples of jnode.ndl.FtnNdlAddress

        }
        continue;
      }
      Matcher m = pBoss.matcher(line);
      if (m.matches()) {
        FtnNdlAddress boss = NodelistScanner.getInstance().isExists(
            new FtnAddress(m.group(1)));
        if (boss == null) {
          addError(linenum, line + " not found in nodelist", errors);
          bossnotfound = true;
        } else {
          if (multi || bosses.isEmpty()) {
            if (bosses.contains(boss)) {
              addError(linenum, line
                  + " already exists in pointlist", errors);
              bossnotfound = true;
            } else {
              bosses.add(boss);
              points.clear();
              bossnotfound = false;
            }
          } else {
            addError(linenum,
                "Not multi pointlist, next boss found", errors);
          }
          continue;
        }
      }
      m = pPoint.matcher(line);
      if (m.matches()) {
        if (bosses.isEmpty()) {
          addError(linenum,
              "Point string present, but no boss present before",
              errors);
        } else {
          Long point = Long.valueOf(m.group(1));
          if (points.contains(point)) {
            if (bossnotfound) {
              addError(
                  linenum,
                  "Point for boss, thats not found in nodelist",
                  errors);
            } else {
              addError(linenum,
                  "Point " + point + " already exists for "
                      + bosses.get(bosses.size() - 1),
                  errors);
            }
          } else {
            String flags = m.group(7);
            if (flags != null && checkflags(flags, linenum, errors)) {
              points.add(point);
              _points++;
            }
          }
        }
        continue;
      }
      addError(linenum, "Unknown line: " + line, errors);
    }
    boolean isReg = false;
    boolean isNet = false;
    if (multi && bosses.size() > 1) {
      // TODO
    }
    // create netmail :-)
    boolean success = (errors.length() == 0);
    String subject = (success) ? "Segment checked : OK"
        : "Segment checked: Errors";
    String text = "File: " + fileName + "\nDate: " + new Date().toString()
        + "\n" + "Lines: " + linenum + "\n" + "Flags: "
        + ((isReg) ? "regional" : (isNet) ? "net" : "local") + "\n"
        + "Boss lines: " + bosses.size() + "\n" + "Point lines: "
        + _points + "\n";
    if (!success)
      text += errors.toString();
    for (FtnNdlAddress boss : bosses) {
      FtnTools.writeNetmail(FtnTools.getPrimaryFtnAddress(),
          boss.clone(), nameFrom,
          boss.getLine().split(",")[4].replace('_', ' '), subject,
          text);
    }
    return success;
  }
View Full Code Here

Examples of jnode.ndl.FtnNdlAddress

    } else if (getLinkByFtnAddress(netmail.getToAddr()) != null) {
      validTo = true;
    } else if (getLinkByFtnAddress(netmail.getToAddr().cloneNode()) != null) {
      validTo = true;
    } else {
      FtnNdlAddress to = NodelistScanner.getInstance().isExists(
          netmail.getToAddr());
      if (to == null) {
        FtnTools.writeReply(
            netmail,
            "Destination not found",
            "Sorry, but destination of your netmail is not found in nodelist\nMessage rejected");
        logger.l3(String.format(
            "Netmail %s -> %s reject ( dest not found )", netmail
                .getFromAddr().toString(), netmail.getToAddr()
                .toString()));

      } else {
        validTo = true;
        if (to.getStatus().equals(Status.DOWN)) {
          FtnTools.writeReply(netmail, "Destination is DOWN",
              "Warning! Destination of your netmail is DOWN.");
          logger.l3(String.format(
              "Netmail %s -> %s reject ( dest is DOWN )", netmail
                  .getFromAddr().toString(), netmail
                  .getToAddr().toString()));
          validTo = true;
        } else if (to.getStatus().equals(Status.HOLD)) {
          FtnTools.writeReply(netmail, "Destination is HOLD",
              "Warning! Destination of your netmail is HOLD");
          logger.l4(String.format(
              "Netmail %s -> %s warn ( dest is Hold )", netmail
                  .getFromAddr().toString(), netmail
                  .getToAddr().toString()));

        }
      }
    }

    if (isOurPoint(netmail.getFromAddr())) {
      validFrom = true;
    } else if (getLinkByFtnAddress(netmail.getFromAddr()) != null) {
      validFrom = true;
    } else if (getLinkByFtnAddress(netmail.getFromAddr().cloneNode()) != null) {
      validTo = true;
    } else {
      FtnNdlAddress from = NodelistScanner.getInstance().isExists(
          netmail.getFromAddr());
      if (from == null) {
        logger.l3(String.format(
            "Netmail %s -> %s reject ( origin not found )", netmail
                .getFromAddr().toString(), netmail.getToAddr()
View Full Code Here

Examples of jnode.ndl.FtnNdlAddress

        try {
          FtnAddress ftn = new FtnAddress(addr);
          if (ftn.getPoint() != 0) {
            code = "POINT";
          } else {
            FtnNdlAddress ndl = NodelistScanner.getInstance()
                .isExists(ftn);
            boolean exists = (ndl != null);
            if (!exists) {
              code = "NODELIST";
            } else {
              String name = (ndl.getLine() != null) ? ndl
                  .getLine().split(",")[4].replace('_', ' ')
                  : addr;
              lr.setName(name);
              lr.setAddress(addr);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.