Package org.openstreetmap.josm.io
Class OsmServerChangesetReader
java.lang.Object
org.openstreetmap.josm.io.OsmConnection
org.openstreetmap.josm.io.OsmServerReader
org.openstreetmap.josm.io.OsmServerChangesetReader
Reads the history of an
OsmPrimitive from the OSM API server.-
Nested Class Summary
Nested classes/interfaces inherited from class org.openstreetmap.josm.io.OsmServerReader
OsmServerReader.DomParser<R>Nested classes/interfaces inherited from class org.openstreetmap.josm.io.OsmConnection
OsmConnection.OAuthAccessTokenFetcher -
Field Summary
FieldsFields inherited from class org.openstreetmap.josm.io.OsmServerReader
contentType, gpxParsedProperlyFields inherited from class org.openstreetmap.josm.io.OsmConnection
activeConnection, cancel, fetcher, oAuth20Parameters -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newOsmServerChangesetReaderwith default settings.OsmServerChangesetReader(boolean useAnonymousUser) Constructs a newOsmServerChangesetReader -
Method Summary
Modifier and TypeMethodDescriptiondownloadChangeset(int id, ProgressMonitor monitor) Downloads the content of a changesetprotected final InputStreamgetChangesetInputStream(long id, boolean includeDiscussion, ProgressMonitor monitor) parseOsm(ProgressMonitor progressMonitor) don't use - not implemented!queryChangesets(ChangesetQuery query, ProgressMonitor monitor) Queries a listreadChangeset(long id, boolean includeDiscussion, ProgressMonitor monitor) Reads the changeset with ididfrom the server.readChangesets(Collection<Integer> ids, boolean includeDiscussion, ProgressMonitor monitor) Reads the changesets with ididsfrom the server.Methods inherited from class org.openstreetmap.josm.io.OsmServerReader
adaptRequest, fetchData, getAttribute, getBaseUrl, getInputStream, getInputStream, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, isDoAuthenticate, isGpxParsedProperly, parseNotes, parseOsm, parseOsmChange, parseOsmChange, parseRawGps, parseRawGps, parseRawNotes, parseRawNotes, setDoAuthenticateMethods inherited from class org.openstreetmap.josm.io.OsmConnection
addAuth, addBasicAuthorizationHeader, addOAuth20AuthorizationHeader, cancel, isCanceled, retrieveBasicAuthorizationLogin, setOAuthAccessTokenFetcher
-
Field Details
-
useAnonymousUser
-
-
Constructor Details
-
OsmServerChangesetReader
public OsmServerChangesetReader()Constructs a newOsmServerChangesetReaderwith default settings. -
OsmServerChangesetReader
Constructs a newOsmServerChangesetReader- Parameters:
useAnonymousUser- if true, replace all user information with the anonymous user- Since:
- 14946
-
-
Method Details
-
parseOsm
don't use - not implemented!- Specified by:
parseOsmin classOsmServerReader- Parameters:
progressMonitor- The progress monitor- Returns:
- The corresponding dataset
- Throws:
OsmTransferException- if any error occurs
-
getChangesetInputStream
protected final InputStream getChangesetInputStream(long id, boolean includeDiscussion, ProgressMonitor monitor) throws OsmTransferException - Throws:
OsmTransferException
-
queryChangesets
public List<Changeset> queryChangesets(ChangesetQuery query, ProgressMonitor monitor) throws OsmTransferException Queries a list- Parameters:
query- the query specification. Must not be null.monitor- a progress monitor. Set toNullProgressMonitor.INSTANCEif null- Returns:
- the list of changesets read from the server
- Throws:
IllegalArgumentException- if query is nullOsmTransferException- if something goes wrong
-
readChangeset
public Changeset readChangeset(long id, boolean includeDiscussion, ProgressMonitor monitor) throws OsmTransferException Reads the changeset with ididfrom the server.- Parameters:
id- the changeset id. id > 0 required.includeDiscussion- determines if discussion comments must be downloaded or notmonitor- the progress monitor. Set toNullProgressMonitor.INSTANCEif null- Returns:
- the changeset read
- Throws:
OsmTransferException- if something goes wrongIllegalArgumentException- if id <= 0- Since:
- 7704
-
readChangesets
public List<Changeset> readChangesets(Collection<Integer> ids, boolean includeDiscussion, ProgressMonitor monitor) throws OsmTransferException Reads the changesets with ididsfrom the server.- Parameters:
ids- the list of ids. Ignored if null. Only load changesets for ids > 0.includeDiscussion- determines if discussion comments must be downloaded or notmonitor- the progress monitor. Set toNullProgressMonitor.INSTANCEif null- Returns:
- the changeset read
- Throws:
OsmTransferException- if something goes wrongIllegalArgumentException- if id <= 0- Since:
- 7704
-
downloadChangeset
public ChangesetDataSet downloadChangeset(int id, ProgressMonitor monitor) throws OsmTransferException Downloads the content of a changeset- Parameters:
id- the changeset id. > 0 required.monitor- the progress monitor.NullProgressMonitor.INSTANCEassumed if null.- Returns:
- the changeset content
- Throws:
IllegalArgumentException- if id <= 0OsmTransferException- if something went wrong
-