diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-03-15 16:13:10 +0100 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-03-17 00:57:01 +0100 |
commit | b5637ae9c646c99efce4ff874666b75400502b2d (patch) | |
tree | 4a4b0ca46a8d64f6b122c14f25fbc2b0866a18bb /base/common/src | |
parent | f65188e4df1ecc080bfca18bd8244f6df9177adc (diff) | |
download | pki-b5637ae9c646c99efce4ff874666b75400502b2d.tar.gz pki-b5637ae9c646c99efce4ff874666b75400502b2d.tar.xz pki-b5637ae9c646c99efce4ff874666b75400502b2d.zip |
Fixed illegal token state transition via TEMP_LOST.
The TokenService.setTokenStatus() has been modified to restore
the temporarily lost token back into either uninitialized or
active state based on whether the token has certificates.
The TPSTokendb.tdbGetCertRecordsByCUID() has been modified to use
only tokenID attribute to search for token certificates more
accurately. It also has been simplified to return the certificate
records collection object directly.
Some constructors were added to the TPSException to allow chaining
the exception cause.
https://fedorahosted.org/pki/ticket/1808
Diffstat (limited to 'base/common/src')
-rw-r--r-- | base/common/src/org/dogtagpki/tps/main/TPSException.java | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/base/common/src/org/dogtagpki/tps/main/TPSException.java b/base/common/src/org/dogtagpki/tps/main/TPSException.java index 940e89ad1..4ff7e4c54 100644 --- a/base/common/src/org/dogtagpki/tps/main/TPSException.java +++ b/base/common/src/org/dogtagpki/tps/main/TPSException.java @@ -26,16 +26,29 @@ public class TPSException extends EBaseException { private static final long serialVersionUID = -678878301521643436L; private TPSStatus status; - public TPSException(String e) { - super(e); + public TPSException(String message) { + super(message); status = TPSStatus.STATUS_ERROR_CONTACT_ADMIN; } - public TPSException(String msg, TPSStatus theStatus) { + public TPSException(String message, TPSStatus status) { + super(message); + this.status = status; + } + + public TPSException(Throwable cause) { + super(cause.getMessage(), cause); + status = TPSStatus.STATUS_ERROR_CONTACT_ADMIN; + } - super(msg); - status = theStatus; + public TPSException(String message, Throwable cause) { + super(message, cause); + status = TPSStatus.STATUS_ERROR_CONTACT_ADMIN; + } + public TPSException(String message, TPSStatus status, Throwable cause) { + super(message, cause); + this.status = status; } public TPSStatus getStatus() { |