Package org.xbill.DNS

Examples of org.xbill.DNS.NAPTRRecord


            // I.e. when the protocol to use is decided via NAPTR then we stick
            // with that protocol
            // only exception is MTU size > 1300 bytes etc.
            //
            for (int i = 0; i < records.length; i++) {
                NAPTRRecord record = (NAPTRRecord) records[i];

                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE,
                        "NAPTRRecord.toString():" + record.toString());
                }

                String service = record.getService();

                // Lets check the NAPTR record. Do we support the protocol?
                // if MTUExceeded is true UDP should not be considered
                if (SipTransports.UDP_PROT.isSupported() &&
                        service.equals(SipTransports.UDP_PROT.getNAPTRId()) &&
                        (isUdpMTUExceeded == false)) {
                    return lookupSRVRecord(SipTransports.UDP_PROT,
                        record.getReplacement().toString());
                } else if (SipTransports.TCP_PROT.isSupported() &&
                        service.equals(SipTransports.TCP_PROT.getNAPTRId())) {
                    return lookupSRVRecord(SipTransports.TCP_PROT,
                        record.getReplacement().toString());
                }
            }
        } catch (DnsLookupFailedException dLookupEx) {
            if (logger.isLoggable(Level.FINE)) {
                logger.log(Level.FINE, dLookupEx.getMessage());
View Full Code Here


        try {
            Record[] records = doLookup(e164arpa_domain, Type.NAPTR);
            Arrays.sort(records, new NaptrComparator());

            for (Record record : records) {
                NAPTRRecord naptrRecord = (NAPTRRecord) record;

                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE,
                        "number of DNS/NAPTR records:" + records.length);
                    logger.log(Level.FINE,
                        "NAPTRRecord.toString():" + record.toString());
                }

                String flag = naptrRecord.getFlags();
                String service = naptrRecord.getService();
                Name replacement = naptrRecord.getReplacement();

                if (service.equalsIgnoreCase("E2U+sip") ||
                        service.equalsIgnoreCase("sip+E2U")) {
                    if (logger.isLoggable(Level.FINE)) {
                        logger.log(Level.FINE,
                            "flag:" + naptrRecord.getFlags() + " flaglength:" +
                            naptrRecord.getFlags().length());
                        logger.log(Level.FINE,
                            "regexp:" + naptrRecord.getRegexp() +
                            " replacement:" + replacement);
                    }

                    if (!EnumUtil.isEmpty(replacement) && (flag.length() == 0)) {
                        return lookupTelUrlNAPTRRecord(AUS,
                            replacement.toString(), visited, ++depth);
                    }

                    String substitution = EnumUtil.applyRegExp(AUS,
                            naptrRecord.getRegexp());

                    if (substitution == null) {
                        // try next record
                        continue;
                    }
View Full Code Here

    public NaptrComparator() {
    }

    public int compare(Object o1, Object o2) {
        NAPTRRecord rec1 = (NAPTRRecord) o1;
        NAPTRRecord rec2 = (NAPTRRecord) o2;
        int comparison = compareOrder(rec1, rec2);

        if (comparison != compEQUAL) {
            return comparison;
        }
View Full Code Here

  }

  @Override
  protected NAPTRRecord createRecord(final Name name, final int dclass,
      final long ttl, final ObjectNode recordNode) {
    return new NAPTRRecord(name, dclass, ttl, getNodeIntegerValue(
        recordNode, "order"), getNodeIntegerValue(recordNode,
        "preference"), getNodeStringValue(recordNode, "flags"),
        getNodeStringValue(recordNode, "service"), getNodeStringValue(
            recordNode, "regexp"), getNodeNameValue(recordNode,
            "replacement"));
View Full Code Here

TOP

Related Classes of org.xbill.DNS.NAPTRRecord

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.