| 164 | } |
| 165 | |
| 166 | private void |
| 167 | fromXFR(ZoneTransferIn xfrin) throws IOException, ZoneTransferException { |
| 168 | data = new TreeMap(); |
| 169 | |
| 170 | origin = xfrin.getName(); |
| 171 | List records = xfrin.run(); |
| 172 | for (Iterator it = records.iterator(); it.hasNext(); ) { |
| 173 | Record record = (Record) it.next(); |
| 174 | maybeAddRecord(record); |
| 175 | } |
| 176 | if (!xfrin.isAXFR()) |
| 177 | throw new IllegalArgumentException("zones can only be " + |
| 178 | "created from AXFRs"); |
| 179 | validate(); |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * Creates a Zone by doing the specified zone transfer. |