public class DiffResultProcessor extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
DiffResultProcessor.DiffResultEntry |
private class |
DiffResultProcessor.Parser |
Modifier and Type | Field and Description |
---|---|
private Map<PrimitiveId,DiffResultProcessor.DiffResultEntry> |
diffResults
mapping from old id to new id and version, the result of parsing the diff result
replied by the server
|
private Collection<? extends OsmPrimitive> |
primitives
the collection of primitives being uploaded
|
private Set<OsmPrimitive> |
processed
the set of processed primitives *after* the new id, the new version and the new changeset id is set
|
Constructor and Description |
---|
DiffResultProcessor(Collection<? extends OsmPrimitive> primitives)
Creates a diff result reader
|
Modifier and Type | Method and Description |
---|---|
void |
parse(String diffUploadResponse,
ProgressMonitor progressMonitor)
Parse the response from a diff upload to the OSM API.
|
protected Set<OsmPrimitive> |
postProcess(Changeset cs,
ProgressMonitor monitor)
Postprocesses the diff result read and parsed from the server.
|
private Map<PrimitiveId,DiffResultProcessor.DiffResultEntry> diffResults
private Set<OsmPrimitive> processed
private Collection<? extends OsmPrimitive> primitives
public DiffResultProcessor(Collection<? extends OsmPrimitive> primitives)
primitives
- the collection of primitives which have been uploaded. If null,
assumes an empty collection.public void parse(String diffUploadResponse, ProgressMonitor progressMonitor) throws XmlParsingException
diffUploadResponse
- the response. Must not be null.progressMonitor
- a progress monitor. Defaults to NullProgressMonitor.INSTANCE
if nullIllegalArgumentException
- if diffUploadRequest is nullXmlParsingException
- if the diffUploadRequest can't be parsed successfullyprotected Set<OsmPrimitive> postProcess(Changeset cs, ProgressMonitor monitor)
cs
- the current changeset. Ignored if null.monitor
- the progress monitor. Set to NullProgressMonitor.INSTANCE
if null