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 Date |
closedOn
the date on which the changeset was closed
|
static 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,
Date closedOn,
ChangesetClosedException.Source source)
Creates the exception
|
ChangesetClosedException(String errorHeader)
Creates the exception with the given
errorHeader |
ChangesetClosedException(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(String errorHeader)
Replies true if
errorHeader matches with ERROR_HEADER_PATTERN |
long |
getChangesetId()
Replies the id of the changeset which was closed
|
Date |
getClosedOn()
Replies the date the changeset was closed
|
ChangesetClosedException.Source |
getSource()
Replies the source where the exception was thrown
|
protected void |
parseErrorHeader(String errorHeader) |
void |
setSource(ChangesetClosedException.Source source) |
getUrl, setUrl
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final String ERROR_HEADER_PATTERN
private long changesetId
private ChangesetClosedException.Source source
public ChangesetClosedException(String errorHeader)
errorHeader
errorHeader
- the error headerpublic ChangesetClosedException(String errorHeader, ChangesetClosedException.Source source)
errorHeader
- the error headersource
- the source for the exceptionpublic ChangesetClosedException(long changesetId, 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(String errorHeader)
errorHeader
matches with ERROR_HEADER_PATTERN
errorHeader
- the error headererrorHeader
matches with ERROR_HEADER_PATTERN
protected void parseErrorHeader(String errorHeader)
public long getChangesetId()
public Date getClosedOn()
public ChangesetClosedException.Source getSource()
public void setSource(ChangesetClosedException.Source source)