1
2
3
4
5
6
7 package org.mule.api.security;
8
9 import org.mule.api.EncryptionStrategy;
10 import org.mule.api.MuleException;
11 import org.mule.config.i18n.CoreMessages;
12 import org.mule.config.i18n.Message;
13
14
15
16
17
18
19
20
21
22 public class CryptoFailureException extends MuleException
23 {
24
25
26
27 private static final long serialVersionUID = 1336343718508294379L;
28
29 private transient EncryptionStrategy encryptionStrategy;
30
31 public CryptoFailureException(Message message, EncryptionStrategy strategy)
32 {
33 super(message);
34 String s = (strategy == null ? "null" : strategy.toString());
35 addInfo("Encryption", s);
36 this.encryptionStrategy = strategy;
37 }
38
39 public CryptoFailureException(Message message, EncryptionStrategy strategy, Throwable cause)
40 {
41 super(message, cause);
42 String s = (strategy == null ? "null" : strategy.toString());
43 addInfo("Encryption", s);
44 this.encryptionStrategy = strategy;
45 }
46
47 public CryptoFailureException(EncryptionStrategy strategy, Throwable cause)
48 {
49 super(CoreMessages.cryptoFailure(), cause);
50 String s = (strategy == null ? "null" : strategy.toString());
51 addInfo("Encryption", s);
52 this.encryptionStrategy = strategy;
53
54 }
55
56 public EncryptionStrategy getEncryptionStrategy()
57 {
58 return encryptionStrategy;
59 }
60 }