Examples of FtnAddress


Examples of jnode.ftn.types.FtnAddress

      String host = req.queryParams("host");
      String port = req.queryParams("port");
      if (addr != null && host != null && port != null) {
        LinkRequest lr = new LinkRequest();
        try {
          FtnAddress ftn = new FtnAddress(addr);
          if (ftn.getPoint() != 0) {
            code = "POINT";
          } else {
            FtnNdlAddress ndl = NodelistScanner.getInstance()
                .isExists(ftn);
            boolean exists = (ndl != null);
View Full Code Here

Examples of jnode.ftn.types.FtnAddress

        "New linkage", "New link with " + link.getLinkAddress()
            + " completed");

    FtnTools.writeNetmail(
        FtnTools.getPrimaryFtnAddress(),
        new FtnAddress(link.getLinkAddress()),
        MainHandler.getCurrentInstance().getInfo().getStationName(),
        link.getLinkName(),
        "You are welcome",
        "You are now have linkage with our node.\n"
            + "Please, follow the Fidonet rules and keep your connection stable\n");
View Full Code Here

Examples of jnode.ftn.types.FtnAddress

        "New linkage request",
        "New link request from " + lr.getAddress() + " accepted");

    FtnTools.writeNetmail(
        FtnTools.getPrimaryFtnAddress(),
        new FtnAddress(lr.getAddress()),
        MainHandler.getCurrentInstance().getInfo().getStationName(),
        lr.getName(),
        "Link instructions",
        "Somebody have just started a linkage proccess from your address.\n"
            + "If this was you, visit "+req.url()+"/confirmlink.html on our site and fill fields as described below:\n"
View Full Code Here

Examples of jnode.ftn.types.FtnAddress

    String email = req.queryParams("email");

    PointRequest pr = new PointRequest();
    // check node
    try {
      FtnAddress a = new FtnAddress(node);
      if (!MainHandler.getCurrentInstance().getInfo().getAddressList()
          .contains(a)) {
        code = "NOTNODE";
      }
    } catch (NumberFormatException e) {
      code = "NOTNODE";
    }
    if (code == null) {
      try {
        FtnAddress a = new FtnAddress(node + "." + point);
        if (null != FtnTools.getLinkByFtnAddress(a)) {
          code = "EXISTS";
        }
        pr.setAddr(a.toString());
      } catch (NumberFormatException e) {
        code = "NOTPOINT";
      }
    }
    if (code == null) {
View Full Code Here

Examples of jnode.ftn.types.FtnAddress

  public void testNodelist() {
    NodelistIndex idx = NodelistScanner.getInstance().createIndex(
        NodelistIndexTest.class.getResourceAsStream("nodelist"),
        new Date().getTime());
   
    FtnAddress a = new FtnAddress("2:5020/848");
    FtnNdlAddress ndl = idx.exists(a);
    int binkpPort = ndl.getBinkpPort();
    String hostname = ndl.getInetHost();
   
    TestCase.assertNotNull(ndl);
    TestCase.assertNotNull(idx);
    TestCase.assertEquals(24554, binkpPort);
    TestCase.assertEquals("fidonode.in", hostname);
   
    a = new FtnAddress("2:5020/2141");
    ndl = idx.exists(a);
    binkpPort = ndl.getBinkpPort();
    hostname = ndl.getInetHost();
   
    TestCase.assertNotNull(ndl);
View Full Code Here

Examples of jnode.ftn.types.FtnAddress

    @Test
    public void testStore() throws Exception {
        ConnectionStatData data = new ConnectionStatData(path);

        data.store(new FtnAddress("2:5020/828.17"), e1);
        data.store(new FtnAddress("2:5020/828.18"), e2);

        List<ConnectionStatData.ConnectionStatDataElement> loaded = data.load();

        check(loaded);
View Full Code Here

Examples of jnode.ftn.types.FtnAddress

    @Test
    public void testStore2() throws Exception {
        ConnectionStatData data = new ConnectionStatData(path);

        data.store(new FtnAddress("2:5020/828.17"), e1);
        e2.linkStr = null;
        data.store(null, e2);

        List<ConnectionStatData.ConnectionStatDataElement> loaded = data.load();
View Full Code Here

Examples of jnode.ftn.types.FtnAddress

        List<ConnectionStatData.ConnectionStatDataElement> d = new ArrayList<>();
        d.add(e1);
        d.add(e2);

        int pos = data.findPos(new FtnAddress("2:5020/828.17"), d);
        TestCase.assertEquals(0, pos);
        pos = data.findPos(new FtnAddress("2:5020/828.18"), d);
        TestCase.assertEquals(1, pos);
        pos = data.findPos(new FtnAddress("2:5020/828.19"), d);
        TestCase.assertEquals(-1, pos);

    }
View Full Code Here

Examples of jnode.ftn.types.FtnAddress

      } catch (RuntimeException e) {
        code = "ERROR";
      }
    } else {
      try {
        FtnAddress ftn = new FtnAddress(_ftn);
        Link l = null;
        if (!_id.equals("0")) {
          Long id = Long.valueOf(_id);
          l = ORMManager.get(Link.class).getById(id);
        }
        if (l == null) {
          l = new Link();
        }
        l.setLinkAddress(ftn.toString());
        l.setLinkName(name);
        l.setPaketPassword(pktpass);
        l.setProtocolPassword(pass);
        l.setProtocolAddress(address);
        ORMManager.get(Link.class).saveOrUpdate(l);
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.