| | |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public enum Reason |
| | | { |
| | | UNEXPECTED_COMMAND, |
| | | MALFORMED_XML, |
| | | MISSING_FIELD, |
| | | INVALID_VALUE, |
| | | IDENTITY_MISMATCH, |
| | | INVALID_RESPONSE |
| | | } |
| | | |
| | | private final Reason reason; |
| | | |
| | | public BtsProtocolException(String message) |
| | | { |
| | | super(message); |
| | | this(Reason.INVALID_RESPONSE, message); |
| | | } |
| | | |
| | | public BtsProtocolException(String message, Throwable cause) |
| | | { |
| | | super(message, cause); |
| | | this(Reason.INVALID_RESPONSE, message, cause); |
| | | } |
| | | |
| | | public BtsProtocolException(Reason reason, String message) |
| | | { |
| | | this(reason, message, null); |
| | | } |
| | | |
| | | public BtsProtocolException(Reason reason, String message, Throwable cause) |
| | | { |
| | | super(reason.name(), message, cause); |
| | | this.reason = reason; |
| | | } |
| | | |
| | | public Reason reason() |
| | | { |
| | | return reason; |
| | | } |
| | | } |