1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59 package org.metricshub.wbem.sblim.cimclient.internal.util;
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81 import java.io.FileNotFoundException;
82 import java.io.IOException;
83 import java.io.InputStream;
84 import java.net.URL;
85 import java.security.Provider;
86 import java.security.Security;
87 import java.util.Arrays;
88 import java.util.Iterator;
89 import java.util.Map.Entry;
90 import java.util.Properties;
91 import java.util.logging.Level;
92 import javax.net.SocketFactory;
93 import org.metricshub.wbem.sblim.cimclient.WBEMConfigurationProperties;
94
95
96
97
98
99
100
101 public class WBEMConfiguration {
102 private static WBEMConfiguration cConfiguration;
103
104 private static String cConfigURL = null;
105
106 private static String cConfigFullURL = null;
107
108 private static boolean cLoadSuccessful = false;
109
110 private static Exception cLoadException = null;
111
112 static {
113 loadGlobalConfiguration();
114 cConfiguration = new WBEMConfiguration();
115 cConfiguration.iIsGlobal = true;
116 }
117
118
119
120
121 public static void loadGlobalConfiguration() {
122 Properties wbemProperties = new Properties(new Properties());
123 try {
124 cConfigURL = null;
125 cLoadSuccessful = false;
126 cLoadException = null;
127
128 InputStream inputstream = getConfigURLStream();
129 if (inputstream != null) {
130 wbemProperties.load(inputstream);
131 cLoadSuccessful = true;
132 }
133 for (Iterator<Entry<Object, Object>> iterator = wbemProperties.entrySet().iterator(); iterator.hasNext();) {
134 Entry<Object, Object> entry = iterator.next();
135 String key = String.valueOf(entry.getKey());
136 if (key.startsWith("sblim.wbem.") || key.startsWith("javax.net.ssl.") || key.startsWith("net.slp.")) {
137 String value = String.valueOf(entry.getValue());
138 System.setProperty(key, value);
139 } else if (key.startsWith("ssl.")) {
140 String value = String.valueOf(entry.getValue());
141 Security.setProperty(key, value);
142 }
143
144
145
146
147
148 }
149 } catch (IOException e) {
150 cLoadException = e;
151 }
152 }
153
154
155
156
157
158
159
160 public static String getActiveConfigURL() {
161 return cConfigURL;
162 }
163
164
165
166
167
168
169
170 public static String getActiveConfigFullURL() {
171 return cConfigFullURL;
172 }
173
174
175
176
177
178
179
180
181 public static boolean isConfigurationLoadSuccessful() {
182 return cLoadSuccessful;
183 }
184
185
186
187
188
189
190
191
192
193 private static InputStream getConfigURLStream() {
194 String configURL = System.getProperty(WBEMConfigurationProperties.CONFIG_URL);
195
196 if (configURL != null) {
197 if (configURL.trim().length() > 0) {
198 try {
199 cConfigURL = configURL;
200 URL url = new URL(configURL);
201 cConfigFullURL = getFullURL(url);
202 InputStream inputstream = url.openStream();
203 return inputstream;
204 } catch (Exception e) {
205 cLoadException = e;
206 }
207 }
208 } else {
209 for (int i = 0; i < WBEMConfigurationDefaults.CONFIG_URL.length; ++i) {
210 configURL = WBEMConfigurationDefaults.CONFIG_URL[i];
211 try {
212 cConfigURL = configURL;
213 URL url = new URL(configURL);
214 cConfigFullURL = getFullURL(url);
215 InputStream inputstream = url.openStream();
216 return inputstream;
217 } catch (FileNotFoundException e) {
218
219 } catch (Exception e) {
220 cLoadException = e;
221 }
222 }
223 cConfigURL = Arrays.asList(WBEMConfigurationDefaults.CONFIG_URL).toString();
224 }
225 return null;
226 }
227
228
229
230
231
232
233
234
235
236
237 private static String getFullURL(URL url) {
238 if (url.getProtocol().equalsIgnoreCase("file")) {
239 try {
240 String path = url.getPath();
241 int lastSlash = path.lastIndexOf('/');
242 int lastBackslash = path.lastIndexOf('\\');
243 int lastSep = lastSlash > lastBackslash ? lastSlash : lastBackslash;
244
245 String dir, file;
246 if (lastSep == -1) {
247
248 dir = ".";
249 file = path;
250 } else if (lastSep == 0) {
251
252 dir = "/";
253 file = path.substring(1);
254 } else {
255
256 dir = path.substring(0, lastSep);
257 file = path.substring(lastSep + 1);
258 }
259
260 String cp = new java.io.File(dir).getCanonicalPath();
261 if (cp.endsWith(System.getProperty("file.separator"))) return cp + file;
262 return cp + System.getProperty("file.separator") + file;
263 } catch (IOException e) {
264
265 }
266 return url.getPath();
267 }
268 return url.toString();
269 }
270
271
272
273
274
275
276 public static WBEMConfiguration getGlobalConfiguration() {
277 return cConfiguration;
278 }
279
280
281
282
283
284
285 public static Exception getConfigurationLoadException() {
286 return cLoadException;
287 }
288
289 private final ThreadLocal<Object> iLocalProperties = new InheritableThreadLocal<Object>() {
290
291 @Override
292 protected Object childValue(Object parentValue) {
293 if (parentValue instanceof Properties) {
294 return ((Properties) parentValue).clone();
295 }
296 return super.childValue(parentValue);
297 }
298 };
299
300
301
302
303 private Properties iDomainProperties = null;
304
305
306
307
308 private SocketFactory iCustomSocketFactory = null;
309
310 private boolean iIsGlobal = false;
311
312
313
314
315 private WBEMConfiguration() {
316 super();
317 }
318
319
320
321
322
323
324
325
326
327
328
329 public WBEMConfiguration(Properties pDomainProperties) {
330 if (pDomainProperties == null) {
331 throw new NullPointerException("Domain properties shall not be null");
332 }
333 this.iDomainProperties = pDomainProperties;
334 }
335
336
337
338
339
340
341 public boolean isGlobal() {
342 return this.iIsGlobal;
343 }
344
345
346
347
348
349
350 public synchronized Properties getDomainProperties() {
351 return this.iDomainProperties;
352 }
353
354
355
356
357
358
359
360 public synchronized void setDomainProperties(Properties pDomainProperties) {
361 if (isGlobal()) throw new IllegalStateException("Global configuration cannot be modified by setDomainProperties()");
362 this.iDomainProperties = pDomainProperties;
363 }
364
365
366
367
368
369
370
371
372 public synchronized String getDomainProperty(String pKey) {
373 return (this.iDomainProperties != null) ? this.iDomainProperties.getProperty(pKey) : null;
374 }
375
376
377
378
379
380
381
382
383
384 public synchronized void setDomainProperty(String pKey, String pValue) {
385 if (isGlobal()) throw new IllegalStateException("Global configuration cannot be modified by setDomainProperty()");
386 this.iDomainProperties.setProperty(pKey, pValue);
387 }
388
389
390
391
392
393
394 public Properties getLocalProperties() {
395 return (Properties) this.iLocalProperties.get();
396 }
397
398
399
400
401
402
403
404 public void setLocalProperties(Properties pLocalProperties) {
405 if (isGlobal()) throw new IllegalStateException("Global configuration cannot be modified by setLocalProperties()");
406 this.iLocalProperties.set(pLocalProperties);
407 }
408
409
410
411
412
413
414
415
416 public String getLocalProperty(String pKey) {
417 Properties localProperties = (Properties) this.iLocalProperties.get();
418 return (localProperties != null) ? localProperties.getProperty(pKey) : null;
419 }
420
421
422
423
424
425
426
427
428
429 public void setLocalProperty(String pKey, String pValue) {
430 if (isGlobal()) throw new IllegalStateException("Global configuration cannot be modified by setLocalProperty()");
431 Properties localProperties = (Properties) this.iLocalProperties.get();
432 if (localProperties == null) {
433 localProperties = new Properties();
434 this.iLocalProperties.set(localProperties);
435 }
436 localProperties.setProperty(pKey, pValue);
437 }
438
439 private String getProperty(String pProperty, String pDefault) {
440 String globalProperty = System.getProperty(pProperty, pDefault);
441 String domainProperty = getDomainProperty(pProperty);
442 String localProperty = getLocalProperty(pProperty);
443 return (localProperty != null)
444 ? localProperty
445 : (domainProperty != null) ? domainProperty : (globalProperty != null) ? globalProperty : pDefault;
446 }
447
448 private String getSecurityProperty(String pProperty, String pDefault) {
449 String globalProperty = Security.getProperty(pProperty);
450 String domainProperty = getDomainProperty(pProperty);
451 String localProperty = getLocalProperty(pProperty);
452 return (localProperty != null)
453 ? localProperty
454 : (domainProperty != null) ? domainProperty : (globalProperty != null) ? globalProperty : pDefault;
455 }
456
457
458
459
460
461
462
463 public synchronized void setCustomSocketFactory(SocketFactory pFactory) {
464 this.iCustomSocketFactory = pFactory;
465 }
466
467
468
469
470
471
472 public synchronized SocketFactory getCustomSocketFactory() {
473 return this.iCustomSocketFactory;
474 }
475
476
477
478
479
480
481 public Level getLogConsoleLevel() {
482 return Level.parse(
483 getProperty(WBEMConfigurationProperties.LOG_CONSOLE_LEVEL, WBEMConfigurationDefaults.LOG_CONSOLE_LEVEL)
484 );
485 }
486
487
488
489
490
491
492 public String getLogConsoleType() {
493 return getProperty(WBEMConfigurationProperties.LOG_CONSOLE_TYPE, WBEMConfigurationDefaults.LOG_CONSOLE_TYPE);
494 }
495
496
497
498
499
500
501 public Level getLogFileLevel() {
502 return Level.parse(
503 getProperty(WBEMConfigurationProperties.LOG_FILE_LEVEL, WBEMConfigurationDefaults.LOG_FILE_LEVEL)
504 );
505 }
506
507
508
509
510
511
512 public String getLogFileLocation() {
513 return getProperty(WBEMConfigurationProperties.LOG_FILE_LOCATION, WBEMConfigurationDefaults.LOG_FILE_LOCATION);
514 }
515
516
517
518
519
520
521 public int getLogFileCount() {
522 return Integer.parseInt(
523 getProperty(WBEMConfigurationProperties.LOG_FILE_COUNT, WBEMConfigurationDefaults.LOG_FILE_COUNT)
524 );
525 }
526
527
528
529
530
531
532 public int getLogFileSizeLimit() {
533 return Integer.parseInt(
534 getProperty(WBEMConfigurationProperties.LOG_FILE_SIZE_LIMIT, WBEMConfigurationDefaults.LOG_FILE_SIZE_LIMIT)
535 );
536 }
537
538
539
540
541
542
543 public Level getTraceFileLevel() {
544 return Level.parse(
545 getProperty(WBEMConfigurationProperties.TRACE_FILE_LEVEL, WBEMConfigurationDefaults.TRACE_FILE_LEVEL)
546 );
547 }
548
549
550
551
552
553
554 public String getTraceFileLocation() {
555 return getProperty(WBEMConfigurationProperties.TRACE_FILE_LOCATION, WBEMConfigurationDefaults.TRACE_FILE_LOCATION);
556 }
557
558
559
560
561
562
563 public int getTraceFileCount() {
564 return Integer.parseInt(
565 getProperty(WBEMConfigurationProperties.TRACE_FILE_COUNT, WBEMConfigurationDefaults.TRACE_FILE_COUNT)
566 );
567 }
568
569
570
571
572
573
574 public int getTraceFileSizeLimit() {
575 return Integer.parseInt(
576 getProperty(WBEMConfigurationProperties.TRACE_FILE_SIZE_LIMIT, WBEMConfigurationDefaults.TRACE_FILE_SIZE_LIMIT)
577 );
578 }
579
580
581
582
583
584
585 public int getHttpTimeout() {
586 return Integer.parseInt(
587 getProperty(WBEMConfigurationProperties.HTTP_TIMEOUT, WBEMConfigurationDefaults.HTTP_TIMEOUT)
588 );
589 }
590
591
592
593
594
595
596 public int getHttpPoolSize() {
597 return Integer.parseInt(
598 getProperty(WBEMConfigurationProperties.HTTP_POOL_SIZE, WBEMConfigurationDefaults.HTTP_POOL_SIZE)
599 );
600 }
601
602
603
604
605
606
607 public String getHttpAuthenticationModule() {
608 return getProperty(
609 WBEMConfigurationProperties.HTTP_AUTHENTICATION_MODULE,
610 WBEMConfigurationDefaults.HTTP_AUTHENTICATION_MODULE
611 );
612 }
613
614
615
616
617
618
619 public String getHttpWwwAuthenticateInfo() {
620 return getProperty(WBEMConfigurationProperties.HTTP_WWW_AUTHENTICATE_INFO, null);
621 }
622
623
624
625
626
627
628
629 public boolean isHttpMPost() {
630 return Boolean
631 .valueOf(getProperty(WBEMConfigurationProperties.HTTP_USE_MPOST, WBEMConfigurationDefaults.HTTP_USE_MPOST))
632 .booleanValue();
633 }
634
635
636
637
638
639
640
641 public boolean isHttpChunked() {
642 return Boolean
643 .valueOf(getProperty(WBEMConfigurationProperties.HTTP_USE_CHUNKING, WBEMConfigurationDefaults.HTTP_USE_CHUNKING))
644 .booleanValue();
645 }
646
647
648
649
650
651
652 public String getHttpVersion() {
653 return getProperty(WBEMConfigurationProperties.HTTP_VERSION, WBEMConfigurationDefaults.HTTP_VERSION);
654 }
655
656
657
658
659
660
661 public String getSslKeyStorePath() {
662 return getProperty(WBEMConfigurationProperties.KEYSTORE_PATH, null);
663 }
664
665
666
667
668
669
670 public String getSslKeyStoreType() {
671 return getProperty(WBEMConfigurationProperties.KEYSTORE_TYPE, WBEMConfigurationDefaults.KEYSTORE_TYPE);
672 }
673
674
675
676
677
678
679 public String getSslKeyStorePassword() {
680 return getProperty(WBEMConfigurationProperties.KEYSTORE_PASSWORD, "");
681 }
682
683
684
685
686
687
688 public String getSslTrustStorePath() {
689 return getProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, null);
690 }
691
692
693
694
695
696
697 public String getSslTrustStoreType() {
698 return getProperty(WBEMConfigurationProperties.TRUSTSTORE_TYPE, WBEMConfigurationDefaults.TRUSTSTORE_TYPE);
699 }
700
701
702
703
704
705
706 public String getSslTrustStorePassword() {
707 return getProperty(WBEMConfigurationProperties.TRUSTSTORE_PASSWORD, "");
708 }
709
710
711
712
713
714
715 public String getSslSocketProvider() {
716 Provider[] providers = Security.getProviders("SSLContext.SSL");
717 return getProperty(
718 WBEMConfigurationProperties.SSL_SOCKET_PROVIDER,
719 providers != null && providers.length > 0 ? providers[0].getClass().getName() : null
720 );
721 }
722
723
724
725
726
727
728 public String getSslServerSocketProvider() {
729 Provider[] providers = Security.getProviders("SSLContext.SSL");
730 return getProperty(
731 WBEMConfigurationProperties.SSL_SERVER_SOCKET_PROVIDER,
732 providers != null && providers.length > 0 ? providers[0].getClass().getName() : null
733 );
734 }
735
736
737
738
739
740
741 public String getSslProtocol() {
742 return getSecurityProperty(WBEMConfigurationProperties.SSL_PROTOCOL, WBEMConfigurationDefaults.SSL_DEF_PROTOCOL);
743 }
744
745
746
747
748
749
750 public String getSslClientProtocol() {
751 return getProperty(WBEMConfigurationProperties.SSL_CLIENT_PROTOCOL, null);
752 }
753
754
755
756
757
758
759 public String getSslListenerProtocol() {
760 return getProperty(WBEMConfigurationProperties.SSL_LISTENER_PROTOCOL, null);
761 }
762
763
764
765
766
767
768 public String getSslKeyManagerAlgorithm() {
769 return getSecurityProperty(WBEMConfigurationProperties.SSL_KEYMANAGER_ALGORITHM, null);
770 }
771
772
773
774
775
776
777 public String getSslTrustManagerAlgorithm() {
778 return getSecurityProperty(WBEMConfigurationProperties.SSL_TRUSTMANAGER_ALGORITHM, null);
779 }
780
781
782
783
784
785
786
787
788 public boolean getSslClientPeerVerification() {
789 return Boolean
790 .valueOf(
791 getProperty(
792 WBEMConfigurationProperties.SSL_CLIENT_PEER_VERIFICATION,
793 WBEMConfigurationDefaults.SSL_CLIENT_PEER_VERIFICATION
794 )
795 )
796 .booleanValue();
797 }
798
799
800
801
802
803
804
805 public String getSslListenerPeerVerification() {
806 return getProperty(
807 WBEMConfigurationProperties.SSL_LISTENER_PEER_VERIFICATION,
808 WBEMConfigurationDefaults.SSL_LISTENER_PEER_VERIFICATION
809 );
810 }
811
812
813
814
815
816
817
818 public String getSslClientCipherSuitesToDisable() {
819 return getProperty(WBEMConfigurationProperties.SSL_CLIENT_CIPHER_SUITES_TO_DISABLE, null);
820 }
821
822
823
824
825
826
827
828 public String getSslListenerCipherSuitesToDisable() {
829 return getProperty(WBEMConfigurationProperties.SSL_LISTENER_CIPHER_SUITES_TO_DISABLE, null);
830 }
831
832
833
834
835
836
837
838 public int getHttpConnectRetriesCount() {
839 return Integer.parseInt(
840 getProperty(
841 WBEMConfigurationProperties.HTTP_CONNECTION_RETRIES,
842 WBEMConfigurationDefaults.HTTP_CONNECTION_RETRIES
843 )
844 );
845 }
846
847
848
849
850
851
852
853 public boolean isHttpContentLengthRetryEnabled() {
854 return Boolean
855 .valueOf(
856 getProperty(
857 WBEMConfigurationProperties.HTTP_ENABLE_CONTENT_LENGTH_RETRY,
858 WBEMConfigurationDefaults.HTTP_ENABLE_CONTENT_LENGTH_RETRY
859 )
860 )
861 .booleanValue();
862 }
863
864
865
866
867
868
869 public int getHttpContentLengthThreshold() {
870 return Integer.parseInt(
871 getProperty(
872 WBEMConfigurationProperties.HTTP_CONTENT_LENGTH_THRESHOLD,
873 WBEMConfigurationDefaults.HTTP_CONTENT_LENGTH_THRESHOLD
874 )
875 );
876 }
877
878
879
880
881
882
883 public String getCimXmlParser() {
884 return getProperty(WBEMConfigurationProperties.CIMXML_PARSER, WBEMConfigurationDefaults.CIMXML_PARSER);
885 }
886
887
888
889
890
891
892 public String getCimXmlEmbObjBuilder() {
893 return getProperty(
894 WBEMConfigurationProperties.CIMXML_EMBOBJBUILDER,
895 WBEMConfigurationDefaults.CIMXML_EMBOBJBUILDER
896 );
897 }
898
899
900
901
902
903
904 public boolean strictEmbObjTypes() {
905 return Boolean
906 .valueOf(
907 getProperty(
908 WBEMConfigurationProperties.CIMXML_PARSER_STRICT_EMBOBJ_TYPES,
909 WBEMConfigurationDefaults.CIMXML_PARSER_STRICT_EMBOBJ_TYPES
910 )
911 )
912 .booleanValue();
913 }
914
915
916
917
918
919
920 public boolean upperCaseEmbObjEntities() {
921 return Boolean
922 .valueOf(
923 getProperty(
924 WBEMConfigurationProperties.CIMXML_BUILDER_UPPERCASE_EMBOBJ_ENTITIES,
925 WBEMConfigurationDefaults.CIMXML_BUILDER_UPPERCASE_EMBOBJ_ENTITIES
926 )
927 )
928 .booleanValue();
929 }
930
931
932
933
934
935
936 public boolean performSslHandshake() {
937 return Boolean
938 .valueOf(
939 getProperty(WBEMConfigurationProperties.PERFORM_SSL_HANDSHAKE, WBEMConfigurationDefaults.PERFORM_SSL_HANDSHAKE)
940 )
941 .booleanValue();
942 }
943
944
945
946
947
948
949 public boolean synchronizedSslHandshake() {
950 return Boolean
951 .valueOf(
952 getProperty(
953 WBEMConfigurationProperties.SYNCHRONIZED_SSL_HANDSHAKE,
954 WBEMConfigurationDefaults.SYNCHRONIZED_SSL_HANDSHAKE
955 )
956 )
957 .booleanValue();
958 }
959
960
961
962
963
964
965 public boolean socketConnectWithTimeout() {
966 return Boolean
967 .valueOf(
968 getProperty(
969 WBEMConfigurationProperties.SOCKET_CONNECT_WITH_TIMEOUT,
970 WBEMConfigurationDefaults.SOCKET_CONNECT_WITH_TIMEOUT
971 )
972 )
973 .booleanValue();
974 }
975
976
977
978
979
980
981 public int getSocketConnectTimeout() {
982 return Integer.parseInt(
983 getProperty(WBEMConfigurationProperties.SOCKET_CONNECT_TIMEOUT, WBEMConfigurationDefaults.SOCKET_CONNECT_TIMEOUT)
984 );
985 }
986
987
988
989
990
991
992 public int getSocketIdleTimeout() {
993 return Integer.parseInt(
994 getProperty(WBEMConfigurationProperties.SOCKET_IDLE_TIMEOUT, WBEMConfigurationDefaults.SOCKET_IDLE_TIMEOUT)
995 );
996 }
997
998
999
1000
1001
1002
1003 public boolean isDefaultAuthorizationEnabled() {
1004 return Boolean
1005 .valueOf(
1006 getProperty(
1007 WBEMConfigurationProperties.KEY_CREDENTIALS_DEFAULT_ENABLED,
1008 WBEMConfigurationDefaults.KEY_CREDENTIALS_DEFAULT_ENABLED
1009 )
1010 )
1011 .booleanValue();
1012 }
1013
1014
1015
1016
1017
1018
1019 public String getDefaultPrincipal() {
1020 return getProperty(
1021 WBEMConfigurationProperties.KEY_DEFAULT_PRINCIPAL,
1022 WBEMConfigurationDefaults.KEY_DEFAULT_PRINCIPAL
1023 );
1024 }
1025
1026
1027
1028
1029
1030
1031 public String getDefaultCredentials() {
1032 return getProperty(
1033 WBEMConfigurationProperties.KEY_DEFAULT_CREDENTIAL,
1034 WBEMConfigurationDefaults.KEY_DEFAULT_CREDENTIAL
1035 );
1036 }
1037
1038
1039
1040
1041
1042
1043
1044 public boolean isCimXmlTracingEnabled() {
1045 return Boolean
1046 .valueOf(getProperty(WBEMConfigurationProperties.CIMXML_TRACING, WBEMConfigurationDefaults.CIMXML_TRACING))
1047 .booleanValue();
1048 }
1049
1050
1051
1052
1053
1054
1055
1056 public String getCimXmlTraceStream() {
1057 return getProperty(WBEMConfigurationProperties.CIMXML_TRACE_STREAM, null);
1058 }
1059
1060
1061
1062
1063
1064
1065
1066 public int getListenerBacklog() {
1067 return Integer.parseInt(
1068 getProperty(WBEMConfigurationProperties.LISTENER_BACKLOG, WBEMConfigurationDefaults.LISTENER_BACKLOG)
1069 );
1070 }
1071
1072
1073
1074
1075
1076
1077 public int getListenerHttpTimeout() {
1078 return Integer.parseInt(
1079 getProperty(WBEMConfigurationProperties.LISTENER_HTTP_TIMEOUT, WBEMConfigurationDefaults.LISTENER_HTTP_TIMEOUT)
1080 );
1081 }
1082
1083
1084
1085
1086
1087
1088 public int getListenerHttpHeaderTimeout() {
1089 return Integer.parseInt(
1090 getProperty(
1091 WBEMConfigurationProperties.LISTENER_HTTP_HEADER_TIMEOUT,
1092 WBEMConfigurationDefaults.LISTENER_HTTP_HEADER_TIMEOUT
1093 )
1094 );
1095 }
1096
1097
1098
1099
1100
1101
1102 public int getListenerMaxAllowedTimeouts() {
1103 return Integer.parseInt(
1104 getProperty(
1105 WBEMConfigurationProperties.LISTENER_HTTP_MAX_ALLOWED_TIMEOUTS,
1106 WBEMConfigurationDefaults.LISTENER_HTTP_MAX_ALLOWED_TIMEOUTS
1107 )
1108 );
1109 }
1110
1111
1112
1113
1114
1115
1116 public int getListenerMaxPoolSize() {
1117 return Integer.parseInt(
1118 getProperty(WBEMConfigurationProperties.LISTENER_MAX_POOL_SIZE, WBEMConfigurationDefaults.LISTENER_MAX_POOL_SIZE)
1119 );
1120 }
1121
1122
1123
1124
1125
1126
1127 public int getListenerMinPoolSize() {
1128 return Integer.parseInt(
1129 getProperty(WBEMConfigurationProperties.LISTENER_MIN_POOL_SIZE, WBEMConfigurationDefaults.LISTENER_MIN_POOL_SIZE)
1130 );
1131 }
1132
1133
1134
1135
1136
1137
1138 public int getListenerMaxQueueSize() {
1139 return Integer.parseInt(
1140 getProperty(
1141 WBEMConfigurationProperties.LISTENER_MAX_QUEUE_SIZE,
1142 WBEMConfigurationDefaults.LISTENER_MAX_QUEUE_SIZE
1143 )
1144 );
1145 }
1146
1147
1148
1149
1150
1151
1152 public long getListenerMaxIdle() {
1153 return Long.parseLong(
1154 getProperty(
1155 WBEMConfigurationProperties.LISTENER_HANDLER_MAX_IDLE,
1156 WBEMConfigurationDefaults.LISTENER_HANDLER_MAX_IDLE
1157 )
1158 );
1159 }
1160
1161
1162
1163
1164
1165
1166 public int getListenerMaxQueuedEvents() {
1167 return Integer.parseInt(
1168 getProperty(
1169 WBEMConfigurationProperties.LISTENER_MAX_QUEUED_EVENTS,
1170 WBEMConfigurationDefaults.LISTENER_MAX_QUEUED_EVENTS
1171 )
1172 );
1173 }
1174
1175
1176
1177
1178
1179
1180
1181 public boolean isReliableIndicationEnabled() {
1182 return Boolean
1183 .valueOf(
1184 getProperty(
1185 WBEMConfigurationProperties.LISTENER_ENABLE_RELIABLE_INDICATIONS,
1186 WBEMConfigurationDefaults.LISTENER_ENABLE_RELIABLE_INDICATIONS
1187 )
1188 )
1189 .booleanValue();
1190 }
1191
1192
1193
1194
1195
1196
1197
1198 public long getListenerDeliveryRetryAttempts() {
1199 return Long.parseLong(
1200 getProperty(
1201 WBEMConfigurationProperties.LISTENER_DELIVERY_RETRY_ATTEMPTS,
1202 WBEMConfigurationDefaults.LISTENER_DELIVERY_RETRY_ATTEMPTS
1203 )
1204 );
1205 }
1206
1207
1208
1209
1210
1211
1212
1213 public long getListenerDeliveryRetryInterval() {
1214 return Long.parseLong(
1215 getProperty(
1216 WBEMConfigurationProperties.LISTENER_DELIVERY_RETRY_INTERVAL,
1217 WBEMConfigurationDefaults.LISTENER_DELIVERY_RETRY_INTERVAL
1218 )
1219 );
1220 }
1221
1222
1223
1224
1225
1226
1227
1228 public int getReliableIndicationHashtableCapacity() {
1229 return Integer.parseInt(
1230 getProperty(
1231 WBEMConfigurationProperties.LISTENER_RELIABLE_INDICATION_HASHTABLE_CAPACITY,
1232 WBEMConfigurationDefaults.LISTENER_RELIABLE_INDICATION_HASHTABLE_CAPACITY
1233 )
1234 );
1235 }
1236
1237
1238
1239
1240
1241
1242
1243 public String getListenerIndicationTraceFilter() {
1244 return getProperty(WBEMConfigurationProperties.LISTENER_INDICATION_TRACE_FILTER, null);
1245 }
1246
1247
1248
1249
1250
1251
1252
1253 public boolean getListenerAddSenderIPAddress() {
1254 return Boolean
1255 .valueOf(
1256 getProperty(
1257 WBEMConfigurationProperties.LISTENER_ADD_SENDER_IP_ADDRESS,
1258 WBEMConfigurationDefaults.LISTENER_ADD_SENDER_IP_ADDRESS
1259 )
1260 )
1261 .booleanValue();
1262 }
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272 public boolean verifyJavaLangDoubleStrings() {
1273 return Boolean
1274 .valueOf(
1275 getProperty(
1276 WBEMConfigurationProperties.VERIFY_JAVA_LANG_DOUBLE_STRINGS,
1277 WBEMConfigurationDefaults.VERIFY_JAVA_LANG_DOUBLE_STRINGS
1278 )
1279 )
1280 .booleanValue();
1281 }
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293 public boolean synchronizeNumericKeyDataTypes() {
1294 return Boolean
1295 .valueOf(
1296 getProperty(
1297 WBEMConfigurationProperties.SYNCHRONIZE_NUMERIC_KEY_DATA_TYPES,
1298 WBEMConfigurationDefaults.SYNCHRONIZE_NUMERIC_KEY_DATA_TYPES
1299 )
1300 )
1301 .booleanValue();
1302 }
1303
1304
1305
1306
1307
1308
1309
1310 public boolean isGzipEncodingEnabled() {
1311 return Boolean
1312 .valueOf(
1313 getProperty(WBEMConfigurationProperties.ENABLE_GZIP_ENCODING, WBEMConfigurationDefaults.ENABLE_GZIP_ENCODING)
1314 )
1315 .booleanValue();
1316 }
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326 public boolean allowEmptyLocalNameSpacePath() {
1327 return Boolean
1328 .valueOf(
1329 getProperty(
1330 WBEMConfigurationProperties.CIMXML_PARSER_ALLOW_EMPTY_LOCALNAMESPACEPATH,
1331 WBEMConfigurationDefaults.CIMXML_PARSER_ALLOW_EMPTY_LOCALNAMESPACEPATH
1332 )
1333 )
1334 .booleanValue();
1335 }
1336
1337 public boolean useKeepAliveStrictMode() {
1338 return Boolean.valueOf(
1339 getProperty(
1340 WBEMConfigurationProperties.HTTP_KEEP_ALIVE_STRICT_MODE,
1341 WBEMConfigurationDefaults.HTTP_KEEP_ALIVE_STRICT_MODE
1342 )
1343 );
1344 }
1345 }