source: josm/trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java@ 10686

Last change on this file since 10686 was 10671, checked in by Don-vip, 8 years ago

see #12472 - fix "MissingCasesInEnumSwitch" warnings

  • Property svn:eol-style set to native
File size: 25.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.io;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5import static org.openstreetmap.josm.tools.I18n.trn;
6
7import java.io.IOException;
8import java.io.InputStream;
9import java.net.HttpURLConnection;
10import java.util.ArrayList;
11import java.util.Collection;
12import java.util.Collections;
13import java.util.HashSet;
14import java.util.Iterator;
15import java.util.LinkedHashSet;
16import java.util.List;
17import java.util.Set;
18import java.util.concurrent.Callable;
19import java.util.concurrent.CompletionService;
20import java.util.concurrent.ExecutionException;
21import java.util.concurrent.ExecutorCompletionService;
22import java.util.concurrent.ExecutorService;
23import java.util.concurrent.Executors;
24import java.util.concurrent.Future;
25
26import org.openstreetmap.josm.Main;
27import org.openstreetmap.josm.data.osm.DataSet;
28import org.openstreetmap.josm.data.osm.DataSetMerger;
29import org.openstreetmap.josm.data.osm.Node;
30import org.openstreetmap.josm.data.osm.OsmPrimitive;
31import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
32import org.openstreetmap.josm.data.osm.PrimitiveId;
33import org.openstreetmap.josm.data.osm.Relation;
34import org.openstreetmap.josm.data.osm.RelationMember;
35import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
36import org.openstreetmap.josm.data.osm.Way;
37import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference;
38import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
39import org.openstreetmap.josm.gui.progress.ProgressMonitor;
40import org.openstreetmap.josm.tools.Utils;
41
42/**
43 * Retrieves a set of {@link OsmPrimitive}s from an OSM server using the so called
44 * Multi Fetch API.
45 *
46 * Usage:
47 * <pre>
48 * MultiFetchServerObjectReader reader = MultiFetchServerObjectReader()
49 * .append(2345,2334,4444)
50 * .append(new Node(72343));
51 * reader.parseOsm();
52 * if (!reader.getMissingPrimitives().isEmpty()) {
53 * Main.info("There are missing primitives: " + reader.getMissingPrimitives());
54 * }
55 * if (!reader.getSkippedWays().isEmpty()) {
56 * Main.info("There are skipped ways: " + reader.getMissingPrimitives());
57 * }
58 * </pre>
59 */
60public class MultiFetchServerObjectReader extends OsmServerReader {
61 /**
62 * the max. number of primitives retrieved in one step. Assuming IDs with 7 digits,
63 * this leads to a max. request URL of ~ 1600 Bytes ((7 digits + 1 Separator) * 200),
64 * which should be safe according to the
65 * <a href="http://www.boutell.com/newfaq/misc/urllength.html">WWW FAQ</a>.
66 */
67 private static final int MAX_IDS_PER_REQUEST = 200;
68
69 private final Set<Long> nodes;
70 private final Set<Long> ways;
71 private final Set<Long> relations;
72 private Set<PrimitiveId> missingPrimitives;
73 private final DataSet outputDataSet;
74
75 /**
76 * Constructs a {@code MultiFetchServerObjectReader}.
77 */
78 protected MultiFetchServerObjectReader() {
79 nodes = new LinkedHashSet<>();
80 ways = new LinkedHashSet<>();
81 relations = new LinkedHashSet<>();
82 this.outputDataSet = new DataSet();
83 this.missingPrimitives = new LinkedHashSet<>();
84 }
85
86 /**
87 * Creates a new instance of {@link MultiFetchServerObjectReader} or {@link MultiFetchOverpassObjectReader}
88 * depending on the {@link OverpassServerPreference#useForMultiFetch preference}.
89 *
90 * @return a new instance
91 * @since 9241
92 */
93 public static MultiFetchServerObjectReader create() {
94 return create(OverpassServerPreference.useForMultiFetch());
95 }
96
97 /**
98 * Creates a new instance of {@link MultiFetchServerObjectReader} or {@link MultiFetchOverpassObjectReader}
99 * depending on the {@code fromMirror} parameter.
100 *
101 * @param fromMirror {@code false} for {@link MultiFetchServerObjectReader}, {@code true} for {@link MultiFetchOverpassObjectReader}
102 * @return a new instance
103 * @since 9241
104 */
105 static MultiFetchServerObjectReader create(final boolean fromMirror) {
106 if (fromMirror) {
107 return new MultiFetchOverpassObjectReader();
108 } else {
109 return new MultiFetchServerObjectReader();
110 }
111 }
112
113 /**
114 * Remembers an {@link OsmPrimitive}'s id. The id will
115 * later be fetched as part of a Multi Get request.
116 *
117 * Ignore the id if it represents a new primitives.
118 *
119 * @param id the id
120 */
121 protected void remember(PrimitiveId id) {
122 if (id.isNew()) return;
123 switch(id.getType()) {
124 case NODE: nodes.add(id.getUniqueId()); break;
125 case WAY: ways.add(id.getUniqueId()); break;
126 case RELATION: relations.add(id.getUniqueId()); break;
127 default: throw new AssertionError();
128 }
129 }
130
131 /**
132 * appends a {@link OsmPrimitive} id to the list of ids which will be fetched from the server.
133 *
134 * @param ds the {@link DataSet} to which the primitive belongs
135 * @param id the primitive id
136 * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
137 * {@link OsmPrimitiveType#RELATION RELATION}
138 * @return this
139 */
140 public MultiFetchServerObjectReader append(DataSet ds, long id, OsmPrimitiveType type) {
141 OsmPrimitive p = ds.getPrimitiveById(id, type);
142 switch(type) {
143 case NODE:
144 return appendNode((Node) p);
145 case WAY:
146 return appendWay((Way) p);
147 case RELATION:
148 return appendRelation((Relation) p);
149 default:
150 return this;
151 }
152 }
153
154 /**
155 * appends a {@link Node} id to the list of ids which will be fetched from the server.
156 *
157 * @param node the node (ignored, if null)
158 * @return this
159 */
160 public MultiFetchServerObjectReader appendNode(Node node) {
161 if (node == null) return this;
162 remember(node.getPrimitiveId());
163 return this;
164 }
165
166 /**
167 * appends a {@link Way} id and the list of ids of nodes the way refers to the list of ids which will be fetched from the server.
168 *
169 * @param way the way (ignored, if null)
170 * @return this
171 */
172 public MultiFetchServerObjectReader appendWay(Way way) {
173 if (way == null) return this;
174 if (way.isNew()) return this;
175 for (Node node: !recursesDown() ? way.getNodes() : Collections.<Node>emptyList()) {
176 if (!node.isNew()) {
177 remember(node.getPrimitiveId());
178 }
179 }
180 remember(way.getPrimitiveId());
181 return this;
182 }
183
184 /**
185 * appends a {@link Relation} id to the list of ids which will be fetched from the server.
186 *
187 * @param relation the relation (ignored, if null)
188 * @return this
189 */
190 protected MultiFetchServerObjectReader appendRelation(Relation relation) {
191 if (relation == null) return this;
192 if (relation.isNew()) return this;
193 remember(relation.getPrimitiveId());
194 for (RelationMember member : !recursesDown() ? relation.getMembers() : Collections.<RelationMember>emptyList()) {
195 if (OsmPrimitiveType.from(member.getMember()).equals(OsmPrimitiveType.RELATION)) {
196 // avoid infinite recursion in case of cyclic dependencies in relations
197 //
198 if (relations.contains(member.getMember().getId())) {
199 continue;
200 }
201 }
202 if (!member.getMember().isIncomplete()) {
203 append(member.getMember());
204 }
205 }
206 return this;
207 }
208
209 /**
210 * appends an {@link OsmPrimitive} to the list of ids which will be fetched from the server.
211 * @param primitive the primitive
212 * @return this
213 */
214 public MultiFetchServerObjectReader append(OsmPrimitive primitive) {
215 if (primitive != null) {
216 switch (OsmPrimitiveType.from(primitive)) {
217 case NODE: return appendNode((Node) primitive);
218 case WAY: return appendWay((Way) primitive);
219 case RELATION: return appendRelation((Relation) primitive);
220 default: break;
221 }
222 }
223 return this;
224 }
225
226 /**
227 * appends a list of {@link OsmPrimitive} to the list of ids which will be fetched from the server.
228 *
229 * @param primitives the list of primitives (ignored, if null)
230 * @return this
231 *
232 * @see #append(OsmPrimitive)
233 */
234 public MultiFetchServerObjectReader append(Collection<? extends OsmPrimitive> primitives) {
235 if (primitives == null) return this;
236 for (OsmPrimitive primitive : primitives) {
237 append(primitive);
238 }
239 return this;
240 }
241
242 /**
243 * extracts a subset of max {@link #MAX_IDS_PER_REQUEST} ids from <code>ids</code> and
244 * replies the subset. The extracted subset is removed from <code>ids</code>.
245 *
246 * @param ids a set of ids
247 * @return the subset of ids
248 */
249 protected Set<Long> extractIdPackage(Set<Long> ids) {
250 Set<Long> pkg = new HashSet<>();
251 if (ids.isEmpty())
252 return pkg;
253 if (ids.size() > MAX_IDS_PER_REQUEST) {
254 Iterator<Long> it = ids.iterator();
255 for (int i = 0; i < MAX_IDS_PER_REQUEST; i++) {
256 pkg.add(it.next());
257 }
258 ids.removeAll(pkg);
259 } else {
260 pkg.addAll(ids);
261 ids.clear();
262 }
263 return pkg;
264 }
265
266 /**
267 * builds the Multi Get request string for a set of ids and a given {@link OsmPrimitiveType}.
268 *
269 * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
270 * {@link OsmPrimitiveType#RELATION RELATION}
271 * @param idPackage the package of ids
272 * @return the request string
273 */
274 protected String buildRequestString(final OsmPrimitiveType type, Set<Long> idPackage) {
275 return type.getAPIName() + "s?" + type.getAPIName() + "s=" + Utils.join(",", idPackage);
276 }
277
278 @Override
279 protected String getBaseUrl() {
280 return super.getBaseUrl();
281 }
282
283 protected void rememberNodesOfIncompleteWaysToLoad(DataSet from) {
284 for (Way w: from.getWays()) {
285 if (w.hasIncompleteNodes()) {
286 for (Node n: w.getNodes()) {
287 if (n.isIncomplete()) {
288 nodes.add(n.getId());
289 }
290 }
291 }
292 }
293 }
294
295 /**
296 * merges the dataset <code>from</code> to {@link #outputDataSet}.
297 *
298 * @param from the other dataset
299 */
300 protected void merge(DataSet from) {
301 final DataSetMerger visitor = new DataSetMerger(outputDataSet, from);
302 visitor.merge();
303 }
304
305 /**
306 * fetches a set of ids of a given {@link OsmPrimitiveType} from the server
307 *
308 * @param ids the set of ids
309 * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
310 * {@link OsmPrimitiveType#RELATION RELATION}
311 * @param progressMonitor progress monitor
312 * @throws OsmTransferException if an error occurs while communicating with the API server
313 */
314 protected void fetchPrimitives(Set<Long> ids, OsmPrimitiveType type, ProgressMonitor progressMonitor) throws OsmTransferException {
315 String msg;
316 final String baseUrl = getBaseUrl();
317 switch (type) {
318 // CHECKSTYLE.OFF: SingleSpaceSeparator
319 case NODE: msg = tr("Fetching a package of nodes from ''{0}''", baseUrl); break;
320 case WAY: msg = tr("Fetching a package of ways from ''{0}''", baseUrl); break;
321 case RELATION: msg = tr("Fetching a package of relations from ''{0}''", baseUrl); break;
322 // CHECKSTYLE.ON: SingleSpaceSeparator
323 default: throw new AssertionError();
324 }
325 progressMonitor.setTicksCount(ids.size());
326 progressMonitor.setTicks(0);
327 // The complete set containing all primitives to fetch
328 Set<Long> toFetch = new HashSet<>(ids);
329 // Build a list of fetchers that will download smaller sets containing only MAX_IDS_PER_REQUEST (200) primitives each.
330 // we will run up to MAX_DOWNLOAD_THREADS concurrent fetchers.
331 int threadsNumber = Main.pref.getInteger("osm.download.threads", OsmApi.MAX_DOWNLOAD_THREADS);
332 threadsNumber = Math.min(Math.max(threadsNumber, 1), OsmApi.MAX_DOWNLOAD_THREADS);
333 final ExecutorService exec = Executors.newFixedThreadPool(
334 threadsNumber, Utils.newThreadFactory(getClass() + "-%d", Thread.NORM_PRIORITY));
335 CompletionService<FetchResult> ecs = new ExecutorCompletionService<>(exec);
336 List<Future<FetchResult>> jobs = new ArrayList<>();
337 while (!toFetch.isEmpty()) {
338 jobs.add(ecs.submit(new Fetcher(type, extractIdPackage(toFetch), progressMonitor)));
339 }
340 // Run the fetchers
341 for (int i = 0; i < jobs.size() && !isCanceled(); i++) {
342 progressMonitor.subTask(msg + "... " + progressMonitor.getTicks() + '/' + progressMonitor.getTicksCount());
343 try {
344 FetchResult result = ecs.take().get();
345 if (result.missingPrimitives != null) {
346 missingPrimitives.addAll(result.missingPrimitives);
347 }
348 if (result.dataSet != null && !isCanceled()) {
349 rememberNodesOfIncompleteWaysToLoad(result.dataSet);
350 merge(result.dataSet);
351 }
352 } catch (InterruptedException | ExecutionException e) {
353 Main.error(e);
354 }
355 }
356 exec.shutdown();
357 // Cancel requests if the user chose to
358 if (isCanceled()) {
359 for (Future<FetchResult> job : jobs) {
360 job.cancel(true);
361 }
362 }
363 }
364
365 /**
366 * invokes one or more Multi Gets to fetch the {@link OsmPrimitive}s and replies
367 * the dataset of retrieved primitives. Note that the dataset includes non visible primitives too!
368 * In contrast to a simple Get for a node, a way, or a relation, a Multi Get always replies
369 * the latest version of the primitive (if any), even if the primitive is not visible (i.e. if
370 * visible==false).
371 *
372 * Invoke {@link #getMissingPrimitives()} to get a list of primitives which have not been
373 * found on the server (the server response code was 404)
374 *
375 * @return the parsed data
376 * @throws OsmTransferException if an error occurs while communicating with the API server
377 * @see #getMissingPrimitives()
378 *
379 */
380 @Override
381 public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException {
382 int n = nodes.size() + ways.size() + relations.size();
383 progressMonitor.beginTask(trn("Downloading {0} object from ''{1}''",
384 "Downloading {0} objects from ''{1}''", n, n, OsmApi.getOsmApi().getBaseUrl()));
385 try {
386 missingPrimitives = new HashSet<>();
387 if (isCanceled()) return null;
388 fetchPrimitives(ways, OsmPrimitiveType.WAY, progressMonitor);
389 if (isCanceled()) return null;
390 fetchPrimitives(nodes, OsmPrimitiveType.NODE, progressMonitor);
391 if (isCanceled()) return null;
392 fetchPrimitives(relations, OsmPrimitiveType.RELATION, progressMonitor);
393 if (outputDataSet != null) {
394 outputDataSet.deleteInvisible();
395 }
396 return outputDataSet;
397 } finally {
398 progressMonitor.finishTask();
399 }
400 }
401
402 /**
403 * replies the set of ids of all primitives for which a fetch request to the
404 * server was submitted but which are not available from the server (the server
405 * replied a return code of 404)
406 *
407 * @return the set of ids of missing primitives
408 */
409 public Set<PrimitiveId> getMissingPrimitives() {
410 return missingPrimitives;
411 }
412
413 /**
414 * Whether this reader fetches nodes when loading ways, or members when loading relations.
415 *
416 * @return {@code true} if the reader recurses down
417 */
418 protected boolean recursesDown() {
419 return false;
420 }
421
422 /**
423 * The class holding the results given by {@link Fetcher}.
424 * It is only a wrapper of the resulting {@link DataSet} and the collection of {@link PrimitiveId} that could not have been loaded.
425 */
426 protected static class FetchResult {
427
428 /**
429 * The resulting data set
430 */
431 public final DataSet dataSet;
432
433 /**
434 * The collection of primitive ids that could not have been loaded
435 */
436 public final Set<PrimitiveId> missingPrimitives;
437
438 /**
439 * Constructs a {@code FetchResult}
440 * @param dataSet The resulting data set
441 * @param missingPrimitives The collection of primitive ids that could not have been loaded
442 */
443 public FetchResult(DataSet dataSet, Set<PrimitiveId> missingPrimitives) {
444 this.dataSet = dataSet;
445 this.missingPrimitives = missingPrimitives;
446 }
447 }
448
449 /**
450 * The class that actually download data from OSM API.
451 * Several instances of this class are used by {@link MultiFetchServerObjectReader} (one per set of primitives to fetch).
452 * The inheritance of {@link OsmServerReader} is only explained by the need to have a distinct OSM connection by {@code Fetcher} instance.
453 * @see FetchResult
454 */
455 protected class Fetcher extends OsmServerReader implements Callable<FetchResult> {
456
457 private final Set<Long> pkg;
458 private final OsmPrimitiveType type;
459 private final ProgressMonitor progressMonitor;
460
461 /**
462 * Constructs a {@code Fetcher}
463 * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
464 * {@link OsmPrimitiveType#RELATION RELATION}
465 * @param idsPackage The set of primitives ids to fetch
466 * @param progressMonitor The progress monitor
467 */
468 public Fetcher(OsmPrimitiveType type, Set<Long> idsPackage, ProgressMonitor progressMonitor) {
469 this.pkg = idsPackage;
470 this.type = type;
471 this.progressMonitor = progressMonitor;
472 }
473
474 @Override
475 public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException {
476 // This method is implemented because of the OsmServerReader inheritance, but not used,
477 // as the main target of this class is the call() method.
478 return fetch(progressMonitor).dataSet;
479 }
480
481 @Override
482 public FetchResult call() throws Exception {
483 return fetch(progressMonitor);
484 }
485
486 /**
487 * fetches the requested primitives and updates the specified progress monitor.
488 * @param progressMonitor the progress monitor
489 * @return the {@link FetchResult} of this operation
490 * @throws OsmTransferException if an error occurs while communicating with the API server
491 */
492 protected FetchResult fetch(ProgressMonitor progressMonitor) throws OsmTransferException {
493 try {
494 return multiGetIdPackage(type, pkg, progressMonitor);
495 } catch (OsmApiException e) {
496 if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
497 Main.info(tr("Server replied with response code 404, retrying with an individual request for each object."));
498 return singleGetIdPackage(type, pkg, progressMonitor);
499 } else {
500 throw e;
501 }
502 }
503 }
504
505 @Override
506 protected String getBaseUrl() {
507 return MultiFetchServerObjectReader.this.getBaseUrl();
508 }
509
510 /**
511 * invokes a Multi Get for a set of ids and a given {@link OsmPrimitiveType}.
512 * The retrieved primitives are merged to {@link #outputDataSet}.
513 *
514 * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
515 * {@link OsmPrimitiveType#RELATION RELATION}
516 * @param pkg the package of ids
517 * @param progressMonitor progress monitor
518 * @return the {@link FetchResult} of this operation
519 * @throws OsmTransferException if an error occurs while communicating with the API server
520 */
521 protected FetchResult multiGetIdPackage(OsmPrimitiveType type, Set<Long> pkg, ProgressMonitor progressMonitor)
522 throws OsmTransferException {
523 String request = buildRequestString(type, pkg);
524 FetchResult result = null;
525 try (InputStream in = getInputStream(request, NullProgressMonitor.INSTANCE)) {
526 if (in == null) return null;
527 progressMonitor.subTask(tr("Downloading OSM data..."));
528 try {
529 result = new FetchResult(OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(pkg.size(), false)), null);
530 } catch (IllegalDataException e) {
531 throw new OsmTransferException(e);
532 }
533 } catch (IOException ex) {
534 Main.warn(ex);
535 }
536 return result;
537 }
538
539 /**
540 * invokes a Multi Get for a single id and a given {@link OsmPrimitiveType}.
541 * The retrieved primitive is merged to {@link #outputDataSet}.
542 *
543 * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
544 * {@link OsmPrimitiveType#RELATION RELATION}
545 * @param id the id
546 * @param progressMonitor progress monitor
547 * @return the {@link DataSet} resulting of this operation
548 * @throws OsmTransferException if an error occurs while communicating with the API server
549 */
550 protected DataSet singleGetId(OsmPrimitiveType type, long id, ProgressMonitor progressMonitor) throws OsmTransferException {
551 String request = buildRequestString(type, Collections.singleton(id));
552 DataSet result = null;
553 try (InputStream in = getInputStream(request, NullProgressMonitor.INSTANCE)) {
554 if (in == null) return null;
555 progressMonitor.subTask(tr("Downloading OSM data..."));
556 try {
557 result = OsmReader.parseDataSet(in, progressMonitor.createSubTaskMonitor(1, false));
558 } catch (IllegalDataException e) {
559 throw new OsmTransferException(e);
560 }
561 } catch (IOException ex) {
562 Main.warn(ex);
563 }
564 return result;
565 }
566
567 /**
568 * invokes a sequence of Multi Gets for individual ids in a set of ids and a given {@link OsmPrimitiveType}.
569 * The retrieved primitives are merged to {@link #outputDataSet}.
570 *
571 * This method is used if one of the ids in pkg doesn't exist (the server replies with return code 404).
572 * If the set is fetched with this method it is possible to find out which of the ids doesn't exist.
573 * Unfortunately, the server does not provide an error header or an error body for a 404 reply.
574 *
575 * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
576 * {@link OsmPrimitiveType#RELATION RELATION}
577 * @param pkg the set of ids
578 * @param progressMonitor progress monitor
579 * @return the {@link FetchResult} of this operation
580 * @throws OsmTransferException if an error occurs while communicating with the API server
581 */
582 protected FetchResult singleGetIdPackage(OsmPrimitiveType type, Set<Long> pkg, ProgressMonitor progressMonitor)
583 throws OsmTransferException {
584 FetchResult result = new FetchResult(new DataSet(), new HashSet<PrimitiveId>());
585 String baseUrl = OsmApi.getOsmApi().getBaseUrl();
586 for (long id : pkg) {
587 try {
588 String msg;
589 switch (type) {
590 // CHECKSTYLE.OFF: SingleSpaceSeparator
591 case NODE: msg = tr("Fetching node with id {0} from ''{1}''", id, baseUrl); break;
592 case WAY: msg = tr("Fetching way with id {0} from ''{1}''", id, baseUrl); break;
593 case RELATION: msg = tr("Fetching relation with id {0} from ''{1}''", id, baseUrl); break;
594 // CHECKSTYLE.ON: SingleSpaceSeparator
595 default: throw new AssertionError();
596 }
597 progressMonitor.setCustomText(msg);
598 result.dataSet.mergeFrom(singleGetId(type, id, progressMonitor));
599 } catch (OsmApiException e) {
600 if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
601 Main.info(tr("Server replied with response code 404 for id {0}. Skipping.", Long.toString(id)));
602 result.missingPrimitives.add(new SimplePrimitiveId(id, type));
603 } else {
604 throw e;
605 }
606 }
607 }
608 return result;
609 }
610 }
611}
Note: See TracBrowser for help on using the repository browser.