Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DIFErrorHandingConfiguration |
|
| 1.1538461538461537;1,154 |
1 | /** | |
2 | * 2007, Digitalis Informatica. All rights reserved. Distribuicao e Gestao de Informatica, Lda. Estrada de Paco de Arcos | |
3 | * num.9 - Piso -1 2780-666 Paco de Arcos Telefone: (351) 21 4408990 Fax: (351) 21 4408999 http://www.digitalis.pt | |
4 | */ | |
5 | package pt.digitalis.dif.startup; | |
6 | ||
7 | import pt.digitalis.dif.ioc.DIFIoCRegistry; | |
8 | import pt.digitalis.utils.config.IConfigurations; | |
9 | import pt.digitalis.utils.config.annotations.ConfigDefault; | |
10 | import pt.digitalis.utils.config.annotations.ConfigID; | |
11 | import pt.digitalis.utils.config.annotations.ConfigIgnore; | |
12 | import pt.digitalis.utils.config.annotations.ConfigSectionID; | |
13 | ||
14 | /** | |
15 | * Configuration object for framework error handling parameters. | |
16 | * | |
17 | * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a><br/> | |
18 | * @created 7 de Abr de 2011 | |
19 | */ | |
20 | @ConfigID("dif2") | |
21 | @ConfigSectionID("ErrorHandling") | |
22 | 0 | public class DIFErrorHandingConfiguration { |
23 | ||
24 | /** | |
25 | * The singleton instance | |
26 | */ | |
27 | 0 | static private DIFErrorHandingConfiguration instance = null; |
28 | ||
29 | /** | |
30 | * Returns the active configuration object instance. | |
31 | * | |
32 | * @return the configuration instance | |
33 | */ | |
34 | @ConfigIgnore | |
35 | static public DIFErrorHandingConfiguration getInstance() | |
36 | { | |
37 | 0 | if (instance == null) |
38 | try | |
39 | { | |
40 | 0 | instance = DIFIoCRegistry.getRegistry().getImplementation(IConfigurations.class) |
41 | 0 | .readConfiguration(DIFErrorHandingConfiguration.class); |
42 | } | |
43 | 0 | catch (Exception e) |
44 | { | |
45 | 0 | instance = null; |
46 | } | |
47 | ||
48 | 0 | return instance; |
49 | } | |
50 | ||
51 | /** allow issue reporting */ | |
52 | private boolean allowCustomDestinationMail; | |
53 | ||
54 | /** allow issue reporting */ | |
55 | private boolean allowReportIssue; | |
56 | ||
57 | /** allow view error details */ | |
58 | private boolean allowViewErrorDetails; | |
59 | ||
60 | /** allow issue reporting */ | |
61 | private boolean automaticReportIssue; | |
62 | ||
63 | /** allow issue reporting */ | |
64 | private String reportIssueDestinationMail; | |
65 | ||
66 | /** allow issue reporting */ | |
67 | private String reportIssueDestinationMailControlledEnvirionment; | |
68 | ||
69 | /** | |
70 | * Inspector for the 'reportIssueDestinationMail' attribute. | |
71 | * | |
72 | * @return the reportIssueDestinationMail value | |
73 | */ | |
74 | @ConfigDefault("support@somedomain.pt") | |
75 | public String getReportIssueDestinationMail() | |
76 | { | |
77 | 0 | return reportIssueDestinationMail; |
78 | } | |
79 | ||
80 | /** | |
81 | * Inspector for the 'reportIssueDestinationMailControlledEnvirionment' attribute. | |
82 | * | |
83 | * @return the reportIssueDestinationMailControlledEnvirionment value | |
84 | */ | |
85 | @ConfigDefault("suporte@digitalis.pt") | |
86 | public String getReportIssueDestinationMailControlledEnvirionment() | |
87 | { | |
88 | 0 | return reportIssueDestinationMailControlledEnvirionment; |
89 | } | |
90 | ||
91 | /** | |
92 | * Inspector for the 'allowCustomDestinationMail' attribute. | |
93 | * | |
94 | * @return the allowCustomDestinationMail value | |
95 | */ | |
96 | @ConfigDefault("false") | |
97 | public boolean isAllowCustomDestinationMail() | |
98 | { | |
99 | 0 | return allowCustomDestinationMail; |
100 | } | |
101 | ||
102 | /** | |
103 | * Inspector for the 'allowReportIssue' attribute. | |
104 | * | |
105 | * @return the allowReportIssue value | |
106 | */ | |
107 | @ConfigDefault("false") | |
108 | public boolean isAllowReportIssue() | |
109 | { | |
110 | 0 | return allowReportIssue; |
111 | } | |
112 | ||
113 | /** | |
114 | * Inspector for the 'allowViewErrorDetails' attribute. | |
115 | * | |
116 | * @return the allowViewErrorDetails value | |
117 | */ | |
118 | @ConfigDefault("true") | |
119 | public boolean isAllowViewErrorDetails() | |
120 | { | |
121 | 0 | return allowViewErrorDetails; |
122 | } | |
123 | ||
124 | /** | |
125 | * Inspector for the 'automaticReportIssue' attribute. | |
126 | * | |
127 | * @return the automaticReportIssue value | |
128 | */ | |
129 | @ConfigDefault("false") | |
130 | public boolean isAutomaticReportIssue() | |
131 | { | |
132 | 0 | return automaticReportIssue; |
133 | } | |
134 | ||
135 | /** | |
136 | * Modifier for the 'allowCustomDestinationMail' attribute. | |
137 | * | |
138 | * @param allowCustomDestinationMail | |
139 | * the new allowCustomDestinationMail value to set | |
140 | */ | |
141 | public void setAllowCustomDestinationMail(boolean allowCustomDestinationMail) | |
142 | { | |
143 | 0 | this.allowCustomDestinationMail = allowCustomDestinationMail; |
144 | 0 | } |
145 | ||
146 | /** | |
147 | * Modifier for the 'allowReportIssue' attribute. | |
148 | * | |
149 | * @param allowReportIssue | |
150 | * the new allowReportIssue value to set | |
151 | */ | |
152 | public void setAllowReportIssue(boolean allowReportIssue) | |
153 | { | |
154 | 0 | this.allowReportIssue = allowReportIssue; |
155 | 0 | } |
156 | ||
157 | /** | |
158 | * Modifier for the 'allowViewErrorDetails' attribute. | |
159 | * | |
160 | * @param allowViewErrorDetails | |
161 | * the new allowViewErrorDetails value to set | |
162 | */ | |
163 | public void setAllowViewErrorDetails(boolean allowViewErrorDetails) | |
164 | { | |
165 | 0 | this.allowViewErrorDetails = allowViewErrorDetails; |
166 | 0 | } |
167 | ||
168 | /** | |
169 | * Modifier for the 'automaticReportIssue' attribute. | |
170 | * | |
171 | * @param automaticReportIssue | |
172 | * the new automaticReportIssue value to set | |
173 | */ | |
174 | public void setAutomaticReportIssue(boolean automaticReportIssue) | |
175 | { | |
176 | 0 | this.automaticReportIssue = automaticReportIssue; |
177 | 0 | } |
178 | ||
179 | /** | |
180 | * Modifier for the 'reportIssueDestinationMail' attribute. | |
181 | * | |
182 | * @param reportIssueDestinationMail | |
183 | * the new reportIssueDestinationMail value to set | |
184 | */ | |
185 | public void setReportIssueDestinationMail(String reportIssueDestinationMail) | |
186 | { | |
187 | 0 | this.reportIssueDestinationMail = reportIssueDestinationMail; |
188 | 0 | } |
189 | ||
190 | /** | |
191 | * Modifier for the 'reportIssueDestinationMailControlledEnvirionment' attribute. | |
192 | * | |
193 | * @param reportIssueDestinationMailControlledEnvirionment | |
194 | * the new reportIssueDestinationMailControlledEnvirionment value to set | |
195 | */ | |
196 | public void setReportIssueDestinationMailControlledEnvirionment( | |
197 | String reportIssueDestinationMailControlledEnvirionment) | |
198 | { | |
199 | 0 | this.reportIssueDestinationMailControlledEnvirionment = reportIssueDestinationMailControlledEnvirionment; |
200 | 0 | } |
201 | } |