source: josm/trunk/src/org/openstreetmap/josm/io/OsmApi.java@ 2604

Last change on this file since 2604 was 2604, checked in by Gubaer, 14 years ago

New: JOSM reading, writing, merging changeset attribute
fixed #4090: Add changeset:* search option to JOSM's search engine

File size: 26.2 KB
Line 
1//License: GPL. See README for details.
2package org.openstreetmap.josm.io;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.io.BufferedReader;
7import java.io.BufferedWriter;
8import java.io.IOException;
9import java.io.InputStream;
10import java.io.InputStreamReader;
11import java.io.OutputStream;
12import java.io.OutputStreamWriter;
13import java.io.PrintWriter;
14import java.io.StringReader;
15import java.io.StringWriter;
16import java.net.ConnectException;
17import java.net.HttpURLConnection;
18import java.net.SocketTimeoutException;
19import java.net.URL;
20import java.net.UnknownHostException;
21import java.util.Collection;
22import java.util.Collections;
23import java.util.HashMap;
24
25import javax.xml.parsers.SAXParserFactory;
26
27import org.openstreetmap.josm.Main;
28import org.openstreetmap.josm.data.osm.Changeset;
29import org.openstreetmap.josm.data.osm.OsmPrimitive;
30import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
31import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
32import org.openstreetmap.josm.gui.progress.ProgressMonitor;
33import org.xml.sax.Attributes;
34import org.xml.sax.InputSource;
35import org.xml.sax.SAXException;
36import org.xml.sax.helpers.DefaultHandler;
37
38/**
39 * Class that encapsulates the communications with the OSM API.
40 *
41 * All interaction with the server-side OSM API should go through this class.
42 *
43 * It is conceivable to extract this into an interface later and create various
44 * classes implementing the interface, to be able to talk to various kinds of servers.
45 *
46 */
47public class OsmApi extends OsmConnection {
48 /** max number of retries to send a request in case of HTTP 500 errors or timeouts */
49 static public final int DEFAULT_MAX_NUM_RETRIES = 5;
50
51 /** the collection of instantiated OSM APIs */
52 private static HashMap<String, OsmApi> instances = new HashMap<String, OsmApi>();
53
54 /**
55 * replies the {@see OsmApi} for a given server URL
56 *
57 * @param serverUrl the server URL
58 * @return the OsmApi
59 * @throws IllegalArgumentException thrown, if serverUrl is null
60 *
61 */
62 static public OsmApi getOsmApi(String serverUrl) {
63 OsmApi api = instances.get(serverUrl);
64 if (api == null) {
65 api = new OsmApi(serverUrl);
66 instances.put(serverUrl,api);
67 }
68 return api;
69 }
70 /**
71 * replies the {@see OsmApi} for the URL given by the preference <code>osm-server.url</code>
72 *
73 * @return the OsmApi
74 * @exception IllegalStateException thrown, if the preference <code>osm-server.url</code> is not set
75 *
76 */
77 static public OsmApi getOsmApi() {
78 String serverUrl = Main.pref.get("osm-server.url", "http://api.openstreetmap.org/api");
79 if (serverUrl == null)
80 throw new IllegalStateException(tr("Preference ''{0}'' missing. Can''t initialize OsmApi.", "osm-server.url"));
81 return getOsmApi(serverUrl);
82 }
83
84 /** the server URL */
85 private String serverUrl;
86
87 /**
88 * Object describing current changeset
89 */
90 private Changeset changeset;
91
92 /**
93 * API version used for server communications
94 */
95 private String version = null;
96
97 /** the api capabilities */
98 private Capabilities capabilities = new Capabilities();
99
100 /**
101 * true if successfully initialized
102 */
103 private boolean initialized = false;
104
105 private StringWriter swriter = new StringWriter();
106 private OsmWriter osmWriter = new OsmWriter(new PrintWriter(swriter), true, null);
107
108 /**
109 * A parser for the "capabilities" response XML
110 */
111 private class CapabilitiesParser extends DefaultHandler {
112 @Override
113 public void startDocument() throws SAXException {
114 capabilities.clear();
115 }
116
117 @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
118 for (int i=0; i< qName.length(); i++) {
119 capabilities.put(qName, atts.getQName(i), atts.getValue(i));
120 }
121 }
122 }
123
124 /**
125 * creates an OSM api for a specific server URL
126 *
127 * @param serverUrl the server URL. Must not be null
128 * @exception IllegalArgumentException thrown, if serverUrl is null
129 */
130 protected OsmApi(String serverUrl) {
131 if (serverUrl == null)
132 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "serverUrl"));
133 this.serverUrl = serverUrl;
134 }
135
136 /**
137 * Returns the OSM protocol version we use to talk to the server.
138 * @return protocol version, or null if not yet negotiated.
139 */
140 public String getVersion() {
141 return version;
142 }
143
144 /**
145 * Initializes this component by negotiating a protocol version with the server.
146 *
147 * @exception OsmApiInitializationException thrown, if an exception occurs
148 */
149 public void initialize(ProgressMonitor monitor) throws OsmApiInitializationException {
150 if (initialized)
151 return;
152 cancel = false;
153 initAuthentication();
154 try {
155 String s = sendRequest("GET", "capabilities", null,monitor, false);
156 InputSource inputSource = new InputSource(new StringReader(s));
157 SAXParserFactory.newInstance().newSAXParser().parse(inputSource, new CapabilitiesParser());
158 if (capabilities.supportsVersion("0.6")) {
159 version = "0.6";
160 } else {
161 System.err.println(tr("This version of JOSM is incompatible with the configured server."));
162 System.err.println(tr("It supports protocol version 0.6, while the server says it supports {0} to {1}.",
163 capabilities.get("version", "minimum"), capabilities.get("version", "maximum")));
164 initialized = false;
165 }
166 System.out.println(tr("Communications with {0} established using protocol version {1}.",
167 serverUrl,
168 version));
169 osmWriter.setVersion(version);
170 initialized = true;
171 } catch (Exception ex) {
172 initialized = false;
173 throw new OsmApiInitializationException(ex);
174 }
175 }
176
177 /**
178 * Makes an XML string from an OSM primitive. Uses the OsmWriter class.
179 * @param o the OSM primitive
180 * @param addBody true to generate the full XML, false to only generate the encapsulating tag
181 * @return XML string
182 */
183 private String toXml(OsmPrimitive o, boolean addBody) {
184 swriter.getBuffer().setLength(0);
185 osmWriter.setWithBody(addBody);
186 osmWriter.setChangeset(changeset);
187 osmWriter.header();
188 o.visit(osmWriter);
189 osmWriter.footer();
190 osmWriter.out.flush();
191 return swriter.toString();
192 }
193
194 /**
195 * Makes an XML string from an OSM primitive. Uses the OsmWriter class.
196 * @param o the OSM primitive
197 * @param addBody true to generate the full XML, false to only generate the encapsulating tag
198 * @return XML string
199 */
200 private String toXml(Changeset s) {
201 swriter.getBuffer().setLength(0);
202 osmWriter.header();
203 s.visit(osmWriter);
204 osmWriter.footer();
205 osmWriter.out.flush();
206 return swriter.toString();
207 }
208
209 /**
210 * Returns the base URL for API requests, including the negotiated version number.
211 * @return base URL string
212 */
213 public String getBaseUrl() {
214 StringBuffer rv = new StringBuffer(serverUrl);
215 if (version != null) {
216 rv.append("/");
217 rv.append(version);
218 }
219 rv.append("/");
220 // this works around a ruby (or lighttpd) bug where two consecutive slashes in
221 // an URL will cause a "404 not found" response.
222 int p; while ((p = rv.indexOf("//", 6)) > -1) { rv.delete(p, p + 1); }
223 return rv.toString();
224 }
225
226 /**
227 * Creates an OSM primitive on the server. The OsmPrimitive object passed in
228 * is modified by giving it the server-assigned id.
229 *
230 * @param osm the primitive
231 * @throws OsmTransferException if something goes wrong
232 */
233 public void createPrimitive(OsmPrimitive osm, ProgressMonitor monitor) throws OsmTransferException {
234 String ret = "";
235 try {
236 ensureValidChangeset();
237 initialize(monitor);
238 ret = sendRequest("PUT", OsmPrimitiveType.from(osm).getAPIName()+"/create", toXml(osm, true),monitor);
239 osm.setOsmId(Long.parseLong(ret.trim()), 1);
240 osm.setChangesetId(getChangeset().getId());
241 } catch(NumberFormatException e){
242 throw new OsmTransferException(tr("Unexpected format of ID replied by the server. Got ''{0}''.", ret));
243 }
244 }
245
246 /**
247 * Modifies an OSM primitive on the server.
248 *
249 * @param osm the primitive. Must not be null.
250 * @param monitor the progress monitor
251 * @throws OsmTransferException if something goes wrong
252 */
253 public void modifyPrimitive(OsmPrimitive osm, ProgressMonitor monitor) throws OsmTransferException {
254 String ret = null;
255 try {
256 ensureValidChangeset();
257 initialize(monitor);
258 // normal mode (0.6 and up) returns new object version.
259 ret = sendRequest("PUT", OsmPrimitiveType.from(osm).getAPIName()+"/" + osm.getId(), toXml(osm, true), monitor);
260 osm.setOsmId(osm.getId(), Integer.parseInt(ret.trim()));
261 osm.setChangesetId(getChangeset().getId());
262 } catch(NumberFormatException e) {
263 throw new OsmTransferException(tr("Unexpected format of new version of modified primitive ''{0}''. Got ''{1}''.", osm.getId(), ret));
264 }
265 }
266
267 /**
268 * Deletes an OSM primitive on the server.
269 * @param osm the primitive
270 * @throws OsmTransferException if something goes wrong
271 */
272 public void deletePrimitive(OsmPrimitive osm, ProgressMonitor monitor) throws OsmTransferException {
273 ensureValidChangeset();
274 initialize(monitor);
275 // can't use a the individual DELETE method in the 0.6 API. Java doesn't allow
276 // submitting a DELETE request with content, the 0.6 API requires it, however. Falling back
277 // to diff upload.
278 //
279 uploadDiff(Collections.singleton(osm), monitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
280 }
281
282 /**
283 * Creates a new changeset based on the keys in <code>changeset</code>. If this
284 * method succeeds, changeset.getId() replies the id the server assigned to the new
285 * changeset
286 *
287 * The changeset must not be null, but its key/value-pairs may be empty.
288 *
289 * @param changeset the changeset toe be created. Must not be null.
290 * @param progressMonitor the progress monitor
291 * @throws OsmTransferException signifying a non-200 return code, or connection errors
292 * @throws IllegalArgumentException thrown if changeset is null
293 */
294 public void openChangeset(Changeset changeset, ProgressMonitor progressMonitor) throws OsmTransferException {
295 if (changeset == null)
296 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "changeset"));
297 try {
298 progressMonitor.beginTask((tr("Creating changeset...")));
299 initialize(progressMonitor);
300 String ret = "";
301 try {
302 ret = sendRequest("PUT", "changeset/create", toXml(changeset),progressMonitor);
303 changeset.setId(Integer.parseInt(ret.trim()));
304 changeset.setOpen(true);
305 } catch(NumberFormatException e){
306 throw new OsmTransferException(tr("Unexpected format of ID replied by the server. Got ''{0}''.", ret));
307 }
308 progressMonitor.setCustomText((tr("Successfully opened changeset {0}",changeset.getId())));
309 } finally {
310 progressMonitor.finishTask();
311 }
312 }
313
314 /**
315 * Updates a changeset with the keys in <code>changesetUpdate</code>. The changeset must not
316 * be null and id > 0 must be true.
317 *
318 * @param changeset the changeset to update. Must not be null.
319 * @param monitor the progress monitor. If null, uses the {@see NullProgressMonitor#INSTANCE}.
320 *
321 * @throws OsmTransferException if something goes wrong.
322 * @throws IllegalArgumentException if changeset is null
323 * @throws IllegalArgumentException if changeset.getId() <= 0
324 *
325 */
326 public void updateChangeset(Changeset changeset, ProgressMonitor monitor) throws OsmTransferException {
327 if (changeset == null)
328 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "changeset"));
329 if (monitor == null) {
330 monitor = NullProgressMonitor.INSTANCE;
331 }
332 if (changeset.getId() <= 0)
333 throw new IllegalArgumentException(tr("Changeset ID > 0 expected. Got {0}.", changeset.getId()));
334 try {
335 monitor.beginTask(tr("Updating changeset..."));
336 initialize(monitor);
337 monitor.setCustomText(tr("Updating changeset {0}...", changeset.getId()));
338 sendRequest(
339 "PUT",
340 "changeset/" + changeset.getId(),
341 toXml(changeset),
342 monitor
343 );
344 } catch(ChangesetClosedException e) {
345 e.setSource(ChangesetClosedException.Source.UPDATE_CHANGESET);
346 throw e;
347 } catch(OsmApiException e) {
348 if (e.getResponseCode() == HttpURLConnection.HTTP_CONFLICT && ChangesetClosedException.errorHeaderMatchesPattern(e.getErrorHeader()))
349 throw new ChangesetClosedException(e.getErrorHeader(), ChangesetClosedException.Source.UPDATE_CHANGESET);
350 throw e;
351 } finally {
352 monitor.finishTask();
353 }
354 }
355
356 /**
357 * Closes a changeset on the server. Sets changeset.setOpen(false) if this operation
358 * succeeds.
359 *
360 * @param changeset the changeset to be closed. Must not be null. changeset.getId() > 0 required.
361 * @param monitor the progress monitor. If null, uses {@see NullProgressMonitor#INSTANCE}
362 *
363 * @throws OsmTransferException if something goes wrong.
364 * @throws IllegalArgumentException thrown if changeset is null
365 * @throws IllegalArgumentException thrown if changeset.getId() <= 0
366 */
367 public void closeChangeset(Changeset changeset, ProgressMonitor monitor) throws OsmTransferException {
368 if (changeset == null)
369 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "changeset"));
370 if (monitor == null) {
371 monitor = NullProgressMonitor.INSTANCE;
372 }
373 if (changeset.getId() <= 0)
374 throw new IllegalArgumentException(tr("Changeset ID > 0 expected. Got {0}.", changeset.getId()));
375 try {
376 monitor.beginTask(tr("Closing changeset..."));
377 initialize(monitor);
378 sendRequest("PUT", "changeset" + "/" + changeset.getId() + "/close", null, monitor);
379 changeset.setOpen(false);
380 } finally {
381 monitor.finishTask();
382 }
383 }
384
385 /**
386 * Uploads a list of changes in "diff" form to the server.
387 *
388 * @param list the list of changed OSM Primitives
389 * @param monitor the progress monitor
390 * @return list of processed primitives
391 * @throws OsmTransferException if something is wrong
392 */
393 public Collection<OsmPrimitive> uploadDiff(Collection<OsmPrimitive> list, ProgressMonitor monitor) throws OsmTransferException {
394 try {
395 monitor.beginTask("", list.size() * 2);
396 if (changeset == null)
397 throw new OsmTransferException(tr("No changeset present for diff upload."));
398
399 initialize(monitor);
400
401 // prepare upload request
402 //
403 OsmChangeBuilder changeBuilder = new OsmChangeBuilder(changeset);
404 monitor.subTask(tr("Preparing upload request..."));
405 changeBuilder.start();
406 changeBuilder.append(list);
407 changeBuilder.finish();
408 String diffUploadRequest = changeBuilder.getDocument();
409
410 // Upload to the server
411 //
412 monitor.indeterminateSubTask(tr("Uploading {0} objects...", list.size()));
413 String diffUploadResponse = sendRequest("POST", "changeset/" + changeset.getId() + "/upload", diffUploadRequest,monitor);
414
415 // Process the response from the server
416 //
417 DiffResultProcessor reader = new DiffResultProcessor(list);
418 reader.parse(diffUploadResponse, monitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
419 return reader.postProcess(
420 getChangeset(),
421 monitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false)
422 );
423 } catch(OsmTransferException e) {
424 throw e;
425 } catch(OsmDataParsingException e) {
426 throw new OsmTransferException(e);
427 } finally {
428 monitor.finishTask();
429 }
430 }
431
432 private void sleepAndListen(int retry, ProgressMonitor monitor) throws OsmTransferCancelledException {
433 System.out.print(tr("Waiting 10 seconds ... "));
434 for(int i=0; i < 10; i++) {
435 if (monitor != null) {
436 monitor.setCustomText(tr("Starting retry {0} of {1} in {2} seconds ...", getMaxRetries() - retry,getMaxRetries(), 10-i));
437 }
438 if (cancel || isAuthCancelled())
439 throw new OsmTransferCancelledException();
440 try {
441 Thread.sleep(1000);
442 } catch (InterruptedException ex) {}
443 }
444 System.out.println(tr("OK - trying again."));
445 }
446
447 /**
448 * Replies the max. number of retries in case of 5XX errors on the server
449 *
450 * @return the max number of retries
451 */
452 protected int getMaxRetries() {
453 int ret = Main.pref.getInteger("osm-server.max-num-retries", DEFAULT_MAX_NUM_RETRIES);
454 return Math.max(ret,0);
455 }
456
457 private String sendRequest(String requestMethod, String urlSuffix,String requestBody, ProgressMonitor monitor) throws OsmTransferException {
458 return sendRequest(requestMethod, urlSuffix, requestBody, monitor, true);
459 }
460
461 /**
462 * Generic method for sending requests to the OSM API.
463 *
464 * This method will automatically re-try any requests that are answered with a 5xx
465 * error code, or that resulted in a timeout exception from the TCP layer.
466 *
467 * @param requestMethod The http method used when talking with the server.
468 * @param urlSuffix The suffix to add at the server url, not including the version number,
469 * but including any object ids (e.g. "/way/1234/history").
470 * @param requestBody the body of the HTTP request, if any.
471 * @param monitor the progress monitor
472 * @param doAuthenticate set to true, if the request sent to the server shall include authentication
473 * credentials;
474 *
475 * @return the body of the HTTP response, if and only if the response code was "200 OK".
476 * @exception OsmTransferException if the HTTP return code was not 200 (and retries have
477 * been exhausted), or rewrapping a Java exception.
478 */
479 private String sendRequest(String requestMethod, String urlSuffix,String requestBody, ProgressMonitor monitor, boolean doAuthenticate) throws OsmTransferException {
480 StringBuffer responseBody = new StringBuffer();
481 int retries = getMaxRetries();
482
483 while(true) { // the retry loop
484 try {
485 URL url = new URL(new URL(getBaseUrl()), urlSuffix);
486 System.out.print(requestMethod + " " + url + "... ");
487 activeConnection = (HttpURLConnection)url.openConnection();
488 activeConnection.setConnectTimeout(15000);
489 activeConnection.setRequestMethod(requestMethod);
490 if (doAuthenticate) {
491 addAuth(activeConnection);
492 }
493
494 if (requestMethod.equals("PUT") || requestMethod.equals("POST") || requestMethod.equals("DELETE")) {
495 activeConnection.setDoOutput(true);
496 activeConnection.setRequestProperty("Content-type", "text/xml");
497 OutputStream out = activeConnection.getOutputStream();
498
499 // It seems that certain bits of the Ruby API are very unhappy upon
500 // receipt of a PUT/POST message without a Content-length header,
501 // even if the request has no payload.
502 // Since Java will not generate a Content-length header unless
503 // we use the output stream, we create an output stream for PUT/POST
504 // even if there is no payload.
505 if (requestBody != null) {
506 BufferedWriter bwr = new BufferedWriter(new OutputStreamWriter(out, "UTF-8"));
507 bwr.write(requestBody);
508 bwr.flush();
509 }
510 out.close();
511 }
512
513 activeConnection.connect();
514 System.out.println(activeConnection.getResponseMessage());
515 int retCode = activeConnection.getResponseCode();
516
517 if (retCode >= 500) {
518 if (retries-- > 0) {
519 sleepAndListen(retries, monitor);
520 System.out.println(tr("Starting retry {0} of {1}.", getMaxRetries() - retries,getMaxRetries()));
521 continue;
522 }
523 }
524
525 // populate return fields.
526 responseBody.setLength(0);
527
528 // If the API returned an error code like 403 forbidden, getInputStream
529 // will fail with an IOException.
530 InputStream i = null;
531 try {
532 i = activeConnection.getInputStream();
533 } catch (IOException ioe) {
534 i = activeConnection.getErrorStream();
535 }
536 if (i != null) {
537 // the input stream can be null if both the input and the error stream
538 // are null. Seems to be the case if the OSM server replies a 401
539 // Unauthorized, see #3887.
540 //
541 BufferedReader in = new BufferedReader(new InputStreamReader(i));
542 String s;
543 while((s = in.readLine()) != null) {
544 responseBody.append(s);
545 responseBody.append("\n");
546 }
547 }
548 String errorHeader = null;
549 // Look for a detailed error message from the server
550 if (activeConnection.getHeaderField("Error") != null) {
551 errorHeader = activeConnection.getHeaderField("Error");
552 System.err.println("Error header: " + errorHeader);
553 } else if (retCode != 200 && responseBody.length()>0) {
554 System.err.println("Error body: " + responseBody);
555 }
556 activeConnection.disconnect();
557
558 errorHeader = errorHeader == null? null : errorHeader.trim();
559 String errorBody = responseBody.length() == 0? null : responseBody.toString().trim();
560 switch(retCode) {
561 case HttpURLConnection.HTTP_OK:
562 return responseBody.toString();
563 case HttpURLConnection.HTTP_GONE:
564 throw new OsmApiPrimitiveGoneException(errorHeader, errorBody);
565 case HttpURLConnection.HTTP_CONFLICT:
566 if (ChangesetClosedException.errorHeaderMatchesPattern(errorHeader))
567 throw new ChangesetClosedException(errorBody, ChangesetClosedException.Source.UPLOAD_DATA);
568 else
569 throw new OsmApiException(retCode, errorHeader, errorBody);
570 default:
571 throw new OsmApiException(retCode, errorHeader, errorBody);
572 }
573 } catch (UnknownHostException e) {
574 throw new OsmTransferException(e);
575 } catch (SocketTimeoutException e) {
576 if (retries-- > 0) {
577 continue;
578 }
579 throw new OsmTransferException(e);
580 } catch (ConnectException e) {
581 if (retries-- > 0) {
582 continue;
583 }
584 throw new OsmTransferException(e);
585 } catch(OsmTransferException e) {
586 throw e;
587 } catch (Exception e) {
588 throw new OsmTransferException(e);
589 }
590 }
591 }
592
593 /**
594 * returns the API capabilities; null, if the API is not initialized yet
595 *
596 * @return the API capabilities
597 */
598 public Capabilities getCapabilities() {
599 return capabilities;
600 }
601
602 /**
603 * Ensures that the current changeset can be used for uploading data
604 *
605 * @throws OsmTransferException thrown if the current changeset can't be used for
606 * uploading data
607 */
608 protected void ensureValidChangeset() throws OsmTransferException {
609 if (changeset == null)
610 throw new OsmTransferException(tr("Current changeset is null. Can't upload data."));
611 if (changeset.getId() <= 0)
612 throw new OsmTransferException(tr("ID of current changeset > 0 required. Current ID is {0}.", changeset.getId()));
613 }
614 /**
615 * Replies the changeset data uploads are currently directed to
616 *
617 * @return the changeset data uploads are currently directed to
618 */
619 public Changeset getChangeset() {
620 return changeset;
621 }
622
623 /**
624 * Sets the changesets to which further data uploads are directed. The changeset
625 * can be null. If it isn't null it must have been created, i.e. id > 0 is required. Furthermore,
626 * it must be open.
627 *
628 * @param changeset the changeset
629 * @throws IllegalArgumentException thrown if changeset.getId() <= 0
630 * @throws IllegalArgumentException thrown if !changeset.isOpen()
631 */
632 public void setChangeset(Changeset changeset) {
633 if (changeset == null) {
634 this.changeset = null;
635 return;
636 }
637 if (changeset.getId() <= 0)
638 throw new IllegalArgumentException(tr("Changeset ID > 0 expected. Got {0}.", changeset.getId()));
639 if (!changeset.isOpen())
640 throw new IllegalArgumentException(tr("Open changeset expected. Got closed changeset with id {0}.", changeset.getId()));
641 this.changeset = changeset;
642 }
643}
Note: See TracBrowser for help on using the repository browser.