Package org.openstreetmap.josm.io
Class ChangesetClosedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.openstreetmap.josm.io.OsmTransferException
org.openstreetmap.josm.io.ChangesetClosedException
- All Implemented Interfaces:
Serializable
A ChangesetClosedException is thrown if the server replies with a HTTP
return code 409 (Conflict) with the error header
ERROR_HEADER_PATTERN.
Depending on the context the exception is thrown in we have to react differently.
- if it is thrown when we try to update a changeset, the changeset was most likely closed before, either explicitly by the user or because of a timeout
- if it is thrown when we try to upload data to the changeset, the changeset was most likely closed because we reached the servers capability limit for the size of a changeset.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIdentifies when the changeset exception occurred. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longthe changeset idprivate Instantthe date on which the changeset was closedstatic final Stringthe error header pattern for in case of HTTP response 409 indicating that a changeset was closedprivate ChangesetClosedException.Sourcethe source -
Constructor Summary
ConstructorsConstructorDescriptionChangesetClosedException(long changesetId, Instant closedOn, ChangesetClosedException.Source source) Creates the exceptionChangesetClosedException(String errorHeader) Creates the exception with the givenerrorHeaderChangesetClosedException(String errorHeader, ChangesetClosedException.Source source) Creates the exception with the given error header and source.ChangesetClosedException(String errorHeader, ChangesetClosedException.Source source, Throwable cause) Creates the exception with the given error header, source and cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanerrorHeaderMatchesPattern(String errorHeader) Replies true iferrorHeadermatches withERROR_HEADER_PATTERNlongReplies the id of the changeset which was closedReplies the date the changeset was closedReplies the source where the exception was thrownprotected final voidparseErrorHeader(String errorHeader) voidSets the source where the exception was thrownMethods inherited from class org.openstreetmap.josm.io.OsmTransferException
getUrl, setUrlMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
ERROR_HEADER_PATTERN
the error header pattern for in case of HTTP response 409 indicating that a changeset was closed- See Also:
-
changesetId
the changeset id -
closedOn
the date on which the changeset was closed -
source
the source
-
-
Constructor Details
-
ChangesetClosedException
Creates the exception with the givenerrorHeader- Parameters:
errorHeader- the error header
-
ChangesetClosedException
Creates the exception with the given error header and source.- Parameters:
errorHeader- the error headersource- the source for the exception
-
ChangesetClosedException
public ChangesetClosedException(String errorHeader, ChangesetClosedException.Source source, Throwable cause) Creates the exception with the given error header, source and cause.- Parameters:
errorHeader- the error headersource- the source for the exceptioncause- The cause (which is saved for later retrieval by theThrowable.getCause()method). A null value is permitted, and indicates that the cause is nonexistent or unknown.- Since:
- 13207
-
ChangesetClosedException
public ChangesetClosedException(long changesetId, Instant closedOn, ChangesetClosedException.Source source) Creates the exception- Parameters:
changesetId- the id if the closed changesetclosedOn- the date the changeset was closed onsource- the source for the exception
-
-
Method Details
-
errorHeaderMatchesPattern
Replies true iferrorHeadermatches withERROR_HEADER_PATTERN- Parameters:
errorHeader- the error header- Returns:
- true if
errorHeadermatches withERROR_HEADER_PATTERN
-
parseErrorHeader
-
getChangesetId
Replies the id of the changeset which was closed- Returns:
- the id of the changeset which was closed
-
getClosedOn
Replies the date the changeset was closed- Returns:
- the date the changeset was closed. May be null if the date isn't known.
-
getSource
Replies the source where the exception was thrown- Returns:
- the source
-
setSource
Sets the source where the exception was thrown- Parameters:
source- the source where the exception was thrown
-