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 anOsmPrimitive
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
Fields Modifier and Type Field Description (package private) boolean
useAnonymousUser
-
Fields inherited from class org.openstreetmap.josm.io.OsmServerReader
contentType, gpxParsedProperly
-
Fields inherited from class org.openstreetmap.josm.io.OsmConnection
activeConnection, cancel, fetcher, oauthParameters
-
-
Constructor Summary
Constructors Constructor Description OsmServerChangesetReader()
Constructs a newOsmServerChangesetReader
with default settings.OsmServerChangesetReader(boolean useAnonymousUser)
Constructs a newOsmServerChangesetReader
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangesetDataSet
downloadChangeset(int id, ProgressMonitor monitor)
Downloads the content of a changesetprotected InputStream
getChangesetInputStream(long id, boolean includeDiscussion, ProgressMonitor monitor)
DataSet
parseOsm(ProgressMonitor progressMonitor)
don't use - not implemented!List<Changeset>
queryChangesets(ChangesetQuery query, ProgressMonitor monitor)
Queries a listChangeset
readChangeset(long id, boolean includeDiscussion, ProgressMonitor monitor)
Reads the changeset with idid
from the server.List<Changeset>
readChangesets(Collection<Integer> ids, boolean includeDiscussion, ProgressMonitor monitor)
Reads the changesets with idids
from 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, addOAuthAuthorizationHeader, cancel, isCanceled, obtainAccessToken, retrieveBasicAuthorizationLogin, setOAuthAccessTokenFetcher
-
-
-
-
Field Detail
-
useAnonymousUser
final boolean useAnonymousUser
-
-
Constructor Detail
-
OsmServerChangesetReader
public OsmServerChangesetReader()
Constructs a newOsmServerChangesetReader
with 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:
parseOsm
in 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.INSTANCE
if 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 idid
from 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.INSTANCE
if 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 idids
from 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.INSTANCE
if 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.INSTANCE
assumed if null.- Returns:
- the changeset content
- Throws:
IllegalArgumentException
- if id <= 0OsmTransferException
- if something went wrong
-
-