public class ChangesetClosedException extends OsmTransferException
ERROR_HEADER_PATTERN
.
Depending on the context the exception is thrown in we have to react differently.
Modifier and Type | Class and Description |
---|---|
static class |
ChangesetClosedException.Source |
Modifier and Type | Field and Description |
---|---|
private long |
changesetId
the changeset id
|
private java.util.Date |
closedOn
the date on which the changeset was closed
|
static java.lang.String |
ERROR_HEADER_PATTERN
the error header pattern for in case of HTTP response 409 indicating
that a changeset was closed
|
private ChangesetClosedException.Source |
source
the source
|
Constructor and Description |
---|
ChangesetClosedException(long changesetId,
java.util.Date closedOn,
ChangesetClosedException.Source source)
Creates the exception
|
ChangesetClosedException(java.lang.String errorHeader)
Creates the exception with the given
errorHeader |
ChangesetClosedException(java.lang.String errorHeader,
ChangesetClosedException.Source source)
Creates the exception with the given error header and the given
source.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
errorHeaderMatchesPattern(java.lang.String errorHeader)
Replies true if
errorHeader matches with ERROR_HEADER_PATTERN |
long |
getChangesetId()
Replies the id of the changeset which was closed
|
java.util.Date |
getClosedOn()
Replies the date the changeset was closed
|
ChangesetClosedException.Source |
getSource()
Replies the source where the exception was thrown
|
protected void |
parseErrorHeader(java.lang.String errorHeader) |
void |
setSource(ChangesetClosedException.Source source) |
getUrl, setUrl
public static final java.lang.String ERROR_HEADER_PATTERN
private long changesetId
private java.util.Date closedOn
private ChangesetClosedException.Source source
public ChangesetClosedException(java.lang.String errorHeader)
errorHeader
errorHeader
- the error headerpublic ChangesetClosedException(java.lang.String errorHeader, ChangesetClosedException.Source source)
errorHeader
- the error headersource
- the source for the exceptionpublic ChangesetClosedException(long changesetId, java.util.Date closedOn, ChangesetClosedException.Source source)
changesetId
- the id if the closed changesetclosedOn
- the date the changeset was closed onsource
- the source for the exceptionpublic static boolean errorHeaderMatchesPattern(java.lang.String errorHeader)
errorHeader
matches with ERROR_HEADER_PATTERN
errorHeader
- the error headererrorHeader
matches with ERROR_HEADER_PATTERN
protected final void parseErrorHeader(java.lang.String errorHeader)
public long getChangesetId()
public java.util.Date getClosedOn()
public ChangesetClosedException.Source getSource()
public void setSource(ChangesetClosedException.Source source)