Examples of SRVRecord


Examples of org.xbill.DNS.SRVRecord

    for (int j = 0; j < length; j++) {
      final Record record = queryResult[j];
      if(record instanceof NSRecord) {
        final NSRecord nsRecord = (NSRecord) record;
        final Name target = nsRecord.getTarget();
        result.add(new SRVRecord(name, DClass.IN, nsRecord.getTTL(), 0, 0, SimpleResolver.DEFAULT_PORT, target));
      }
    }
   
    //query for primary ns in SOA record (may overwrite/be equal to one of the ns records)
    query = new Lookup(zone, Type.SOA);
    query.setResolver(resolver);
    queryResult = query.run();
    //TODO file bug upstream that queryResult may never be null
    length = queryResult == null ? 0 : queryResult.length;
    for (int j = 0; j < length; j++) {
      final Record record = queryResult[j];
      if(record instanceof SOARecord) {
        final SOARecord soaRecord = (SOARecord) record;
        result.add(new SRVRecord(name, DClass.IN, soaRecord.getTTL(), 0, 0, SimpleResolver.DEFAULT_PORT, soaRecord.getHost()));
      }
    }
    return result;
  }
View Full Code Here

Examples of org.xbill.DNS.SRVRecord

    return result;
  }

  private int compareSrvRecord(int result, final IServiceInfo serviceInfo,
      final Record record) {
    final SRVRecord srvRec = (SRVRecord) record;
    final String name = srvRec.getName().toString();
    final String string = "_" + DnsSdTestHelper.REG_SCHEME + "._" + DnsSdTestHelper.PROTO;
    if(name.startsWith(string)) {
      final String target = srvRec.getTarget().toString();
      result += serviceInfo.getPriority() == srvRec.getPriority() ? 1 : -1;
      result += serviceInfo.getWeight() == srvRec.getWeight() ? 1 : -1;
      result += DnsSdTestHelper.TTL == srvRec.getTTL() ? 1 : -1;
      result += serviceInfo.getLocation().getHost().equals(target.substring(0, target.length() - 1)) ? 1 : -1;
      result += serviceInfo.getLocation().getPort() == srvRec.getPort() ? 1 : -1;
    }
    return result;
  }
View Full Code Here

Examples of org.xbill.DNS.SRVRecord

    final int priority = serviceInfo.getPriority();
    final int weight = serviceInfo.getWeight();
    final int port = serviceInfo.getLocation().getPort();
    final Name target = Name.fromString(serviceInfo.getLocation().getHost() + "."); //$NON-NLS-1$

    return new SRVRecord(name, DClass.IN, ttl, priority, weight, port, target);
  }
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.