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
-
public class OsmServerChangesetReader extends OsmServerReader
Reads the history of anOsmPrimitivefrom 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
Fields Modifier and Type Field Description (package private) booleanuseAnonymousUser-
Fields inherited from class org.openstreetmap.josm.io.OsmServerReader
contentType, gpxParsedProperly
-
Fields inherited from class org.openstreetmap.josm.io.OsmConnection
activeConnection, cancel, fetcher, oAuth20Parameters
-
-
Constructor Summary
Constructors Constructor Description OsmServerChangesetReader()Constructs a newOsmServerChangesetReaderwith default settings.OsmServerChangesetReader(boolean useAnonymousUser)Constructs a newOsmServerChangesetReader
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangesetDataSetdownloadChangeset(int id, ProgressMonitor monitor)Downloads the content of a changesetprotected java.io.InputStreamgetChangesetInputStream(long id, boolean includeDiscussion, ProgressMonitor monitor)DataSetparseOsm(ProgressMonitor progressMonitor)don't use - not implemented!java.util.List<Changeset>queryChangesets(ChangesetQuery query, ProgressMonitor monitor)Queries a listChangesetreadChangeset(long id, boolean includeDiscussion, ProgressMonitor monitor)Reads the changeset with ididfrom the server.java.util.List<Changeset>readChangesets(java.util.Collection<java.lang.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, setDoAuthenticate
-
Methods inherited from class org.openstreetmap.josm.io.OsmConnection
addAuth, addBasicAuthorizationHeader, addOAuth20AuthorizationHeader, cancel, isCanceled, retrieveBasicAuthorizationLogin, setOAuthAccessTokenFetcher
-
-
-
-
Field Detail
-
useAnonymousUser
final boolean useAnonymousUser
-
-
Constructor Detail
-
OsmServerChangesetReader
public OsmServerChangesetReader()
Constructs a newOsmServerChangesetReaderwith default settings.
-
OsmServerChangesetReader
public OsmServerChangesetReader(boolean useAnonymousUser)
Constructs a newOsmServerChangesetReader- Parameters:
useAnonymousUser- if true, replace all user information with the anonymous user- Since:
- 14946
-
-
Method Detail
-
parseOsm
public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException
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 java.io.InputStream getChangesetInputStream(long id, boolean includeDiscussion, ProgressMonitor monitor) throws OsmTransferException
- Throws:
OsmTransferException
-
queryChangesets
public java.util.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:
java.lang.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 wrongjava.lang.IllegalArgumentException- if id <= 0- Since:
- 7704
-
readChangesets
public java.util.List<Changeset> readChangesets(java.util.Collection<java.lang.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 wrongjava.lang.IllegalArgumentException- 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:
java.lang.IllegalArgumentException- if id <= 0OsmTransferException- if something went wrong
-
-