Package jnode.dto

Examples of jnode.dto.Link


      error("We weren't waiting for M_ADR");
    }
    for (String addr : arg.replace("^[ ]*", "").split(" ")) {
      try {
        FtnAddress a = new FtnAddress(addr);
        Link link = FtnTools.getLinkByFtnAddress(a);
        boolean nodelist = NodelistScanner.getInstance().isExists(a) != null;
        if (link != null || nodelist) {
          foreignAddress.add(a);
        }
      } catch (NumberFormatException e) {
        logger.l4("Invalid address " + addr);
      }
    }

    if (foreignAddress.isEmpty()) {
      error("No valid address specified");
      return;
    }
    Link link = FtnTools.getLinkByFtnAddress(foreignAddress);
    if (link != null) {
      String ourAka = FtnTools.getOptionString(link,
          LinkOption.STRING_OUR_AKA);
      if (ourAka != null) {
        try {
View Full Code Here


      Button button = new Button("Новый линк");
      button.addActionListener(new ActionListener() {
       
        @Override
        public void actionPerformed(ActionEvent e) {
          new LinkDialog(frmJnodeConfigurator, new Link());
         
        }
      });
      linksPanel.add(button);
    } catch (Exception e) {
View Full Code Here

    }
    for (Netmail netmail : expiredNetmail) {
     
      FtnMessage msg = FtnTools.netmailToFtnMessage(netmail);
      msg.setToAddr(new FtnAddress(netmail.getToFTN()));
      Link routeVia = FtnTools.getRoutingFallback(msg,
          netmail.getRouteVia());
      if (routeVia != null) {
        netmail.setRouteVia(routeVia);
        logger.l3("Netmail #" + netmail.getId() + " re-routed via "
            + routeVia.getLinkAddress());
      }
      netmail.setLastModified(new Date());
      ORMManager.get(Netmail.class).update(netmail);
    }
  }
View Full Code Here

    // 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++);
View Full Code Here

      } catch (NumberFormatException e) {
        FtnTools.writeReply(fmsg, ACCESS_DENIED, WRONG_ASLINK);
        return null;
      }
    }
    Link link = FtnTools.getLinkByFtnAddress(linkAddress);
    if (link == null) {
      FtnTools.writeReply(fmsg, ACCESS_DENIED,
          YOU_ARE_NOT_IN_LINKS_OF_ORIGIN);
      return null;
    }
View Full Code Here

  private static final Pattern REM = Pattern.compile("^%?\\-(\\S+)$",
      Pattern.CASE_INSENSITIVE);

  @Override
  public void execute(FtnMessage fmsg) throws Exception {
    Link link = getAndCheckLink(fmsg);
    if (link == null) {
      return;
    }

    StringBuilder reply = new StringBuilder();
View Full Code Here

   *
   * @param message
   * @return
   */
  public static Link getRouting(FtnMessage message) {
    Link routeVia;
    FtnAddress routeTo = message.getToAddr().clone();
    routeVia = getLinkByFtnAddress(routeTo);
    // check our point
    if (!isOurPoint(routeTo)) {
      routeTo.setPoint(0);
View Full Code Here

    return routeVia;
  }

  public static Link getRoutingFallback(FtnMessage message,
      Link previousRouteVia) {
    Link routeVia = null;
    FtnAddress routeTo = message.getToAddr().clone();
    if (isOurPoint(routeTo)) {
      return null;
    }
    // direct link can be down for us - use cross way
View Full Code Here

    message.setSubject(subject);
    message.setText(sb.toString());
    message.setNetmail(true);
    message.setAttribute(attr);
    processRewrite(message);
    Link routeVia = null;
    if (route) {
      routeVia = getRouting(message);
      if (routeVia == null) {
        logger.l2("Routing not found for " + to);
      }
View Full Code Here

    logger.l5("Using aka " + ret + " for " + link.getLinkAddress() + "");
    return ret;
  }

  public static String getOptionForAddr(FtnAddress toAddr, String name) {
    Link link = getLinkByFtnAddress(toAddr);
    if (link != null) {
      return getOption(link, name);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of jnode.dto.Link

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.