Examples of MXRecord


Examples of org.xbill.DNS.MXRecord

        try {
            if (answers == null) {
                return servers;
            }

            MXRecord mxAnswers[] = new MXRecord[answers.length];
            for (int i = 0; i < answers.length; i++) {
                mxAnswers[i] = (MXRecord)answers[i];
            }

            Comparator prioritySort = new Comparator () {
                    public int compare (Object a, Object b) {
                        MXRecord ma = (MXRecord)a;
                        MXRecord mb = (MXRecord)b;
                        return ma.getPriority () - mb.getPriority ();
                    }
                };

            Arrays.sort(mxAnswers, prioritySort);
View Full Code Here

Examples of org.xbill.DNS.MXRecord

        int currentPrio = -1;
        List<String> samePrio = new ArrayList<String>();
        for (int i = 0; i < mxAnswers.length; i++) {
            boolean same = false;
            boolean lastItem = i + 1 == mxAnswers.length;
            MXRecord mx = mxAnswers[i];
            if (i == 0) {
                currentPrio = mx.getPriority();
            } else {
                same = currentPrio == mx.getPriority();
            }

            String mxRecord = mx.getTarget().toString();
            if (same) {
                samePrio.add(mxRecord);
            } else {
                // shuffle entries with same prio
                // JAMES-913
View Full Code Here

Examples of org.xbill.DNS.MXRecord

  }

  @Override
  protected MXRecord createRecord(final Name name, final int dclass,
      final long ttl, final ObjectNode recordNode) {
    return new MXRecord(name, dclass, ttl, getNodeIntegerValue(recordNode,
        "priority"), getNodeNameValue(recordNode, "target"));
  }
View Full Code Here

Examples of org.xbill.DNS.MXRecord

                    case Type.AAAA:
                        AAAARecord aaaa = (AAAARecord) rr[i];
                        records.add(aaaa.getAddress().getHostAddress());
                        break;
                    case Type.MX:
                        MXRecord mx = (MXRecord) rr[i];
                        records.add(mx.getTarget().toString());
                        break;
                    case Type.PTR:
                        PTRRecord ptr = (PTRRecord) rr[i];
                        records.add(IPAddr.stripDot(ptr.getTarget().toString()));
                        break;
View Full Code Here

Examples of org.xbill.DNS.MXRecord

                                        Long prio = (Long) mxs.next();
                                        String cname = (String) mxs.next();
                                        if (cname != null) {
                                            if (cname.length() > 0 &&  !cname.endsWith(".")) cname += ".";
                                           
                                            records.add(new MXRecord(hostname,
                                                    DClass.IN, 3600, prio
                                                            .intValue(), Name
                                                            .fromString(cname)));
                                        }
                                    }
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.