View Javadoc
1   /*
2    * Copyright 2001-2009 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   */
17  package org.apache.juddi.v3.client.config;
18  
19  import java.io.File;
20  import java.util.ArrayList;
21  import java.util.HashMap;
22  import java.util.HashSet;
23  import java.util.Iterator;
24  import java.util.List;
25  import java.util.Map;
26  import java.util.Properties;
27  import java.util.Set;
28  
29  import javax.xml.crypto.dsig.CanonicalizationMethod;
30  
31  import org.apache.commons.configuration.CompositeConfiguration;
32  import org.apache.commons.configuration.Configuration;
33  import org.apache.commons.configuration.ConfigurationException;
34  import org.apache.commons.configuration.SystemConfiguration;
35  import org.apache.commons.configuration.XMLConfiguration;
36  import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;
37  import org.apache.commons.logging.Log;
38  import org.apache.commons.logging.LogFactory;
39  import org.apache.juddi.api_v3.Node;
40  import org.apache.juddi.v3.client.cryptor.CryptorFactory;
41  import org.apache.juddi.v3.client.cryptor.DigSigUtil;
42  import org.apache.juddi.v3.client.subscription.SubscriptionCallbackListener;
43  
44  /**
45   * Handles the client configuration of the uddi-client. By default it first
46   * looks at system properties. Then loads from the config file from the system
47   * property "uddi.client.xml", next the user specified file, finally,
48   * "META-INF/uddi.xml"
49   *
50   * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
51   * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
52   */
53  public class ClientConfig {
54  
55          public final static String UDDI_CONFIG_FILENAME_PROPERTY = "uddi.client.xml";
56          public final static String DEFAULT_UDDI_CONFIG = "META-INF/uddi.xml";
57          private Log log = LogFactory.getLog(ClientConfig.class);
58          private Configuration config = null;
59  
60          private Map<String, UDDINode> uddiNodes = null;
61          private Map<String, UDDIClerk> uddiClerks = null;
62          private Set<XRegistration> xBusinessRegistrations = null;
63          private Set<XRegistration> xServiceBindingRegistrations = null;
64          private String clientName = null;
65          private String clientCallbackUrl = null;
66          private String configurationFile = null;
67  
68          /**
69           * Constructor (note Singleton pattern).
70           *
71           * @throws ConfigurationException
72           */
73          public ClientConfig(String configurationFile) throws ConfigurationException {
74                  loadConfiguration(configurationFile, null);
75          }
76  
77          /**
78           * Constructor (note Singleton pattern).
79           *
80           * @throws ConfigurationException
81           */
82          public ClientConfig(String configurationFile, Properties properties) throws ConfigurationException {
83                  loadConfiguration(configurationFile, properties);
84          }
85  
86          /**
87           * Attempts to save any changes made to the configuration back to disk
88           * Revised in 3.2.1 to reconstruct the file from the in memory data
89           * structure, enable you to programmatically add nodes.
90           * <br><br>
91           * For previous functionality see, saveConfigRaw()
92           *
93           * @throws ConfigurationException
94           */
95          public void saveConfig() throws ConfigurationException {
96  
97                  if (log.isDebugEnabled()) {
98                          System.out.println("DEBUG dumping current cfg");
99                          Iterator<String> keys = config.getKeys();
100                         while (keys.hasNext()) {
101                                 String k = keys.next();
102                                 System.out.println(k + " = " + config.getProperty(k));
103                         }
104                 }
105                 XMLConfiguration saveConfiguration = new XMLConfiguration();
106                 Configuration cc = new CompositeConfiguration(saveConfiguration);
107 
108                 saveConfiguration.setRootElementName("uddi");
109 
110                                 
111                 cc.addProperty("client(0).selection.policy", config.getProperty("client.selection.policy"));
112                 cc.addProperty("reloadDelay", config.getProperty("reloadDelay"));
113                 addCurrentNodeConfig(cc);
114                 addCurrentClerks(cc);
115                 try {
116                         addDigitalSubscription(cc);
117                 } catch (Exception ex) {
118                         throw new ConfigurationException("error", ex);
119                 }
120                 addSubscriptionCallback(cc);
121                 addXRegistration(cc);
122                 if (log.isDebugEnabled()) {
123                         System.out.println("DEBUG dumping NEW cfg");
124                         Iterator<String> keys = cc.getKeys();
125 
126                         while (keys.hasNext()) {
127                                 String k = keys.next();
128                                 System.out.println(k + " = " + config.getProperty(k));
129                         }
130                 }
131 
132                 saveConfiguration.save(configurationFile);
133         }
134         
135         /**
136          * Use this method to attempt to save the jUDDI configuration file after
137          * you've modified it using the Apache Commons Configuration settings.
138          * This is especially useful if you've constructed a user interface for manipulating
139          * the configuration like a properties sheet and is used by the juddi-gui (web ui)
140          * @since 3.2.1
141          * @throws org.apache.commons.configuration.ConfigurationException
142          */
143         public void saveConfigRaw() throws ConfigurationException{
144          XMLConfiguration saveConfiguration = new XMLConfiguration(configurationFile);
145             Configuration cc = new CompositeConfiguration(saveConfiguration);
146             Iterator<String> keys = this.config.getKeys();
147             while (keys.hasNext()){
148                 String key = keys.next();
149                 if (key.startsWith("client") || key.startsWith("config"))
150                 {
151                     cc.setProperty(key, config.getProperty(key));
152                 }
153             }
154             saveConfiguration.save();
155 
156         }
157         protected void readConfig(Properties properties) throws ConfigurationException {
158                 uddiNodes = readNodeConfig(config, properties);
159                 uddiClerks = readClerkConfig(config, uddiNodes);
160                 xServiceBindingRegistrations = readXServiceBindingRegConfig(config, uddiClerks);
161                 xBusinessRegistrations = readXBusinessRegConfig(config, uddiClerks);
162         }
163 
164         /**
165          * Does the actual work of reading the configuration from System
166          * Properties and/or uddi.xml file. When the uddi.xml file is updated
167          * the file will be reloaded. By default the reloadDelay is set to 1
168          * second to prevent excessive date stamp checking.
169          */
170         private void loadConfiguration(String configurationFile, Properties properties) throws ConfigurationException {
171                 //Properties from system properties
172                 CompositeConfiguration compositeConfig = new CompositeConfiguration();
173                 compositeConfig.addConfiguration(new SystemConfiguration());
174                 //Properties from XML file
175                 if (System.getProperty(UDDI_CONFIG_FILENAME_PROPERTY) != null) {
176                         log.info("Using system property config override");
177                         configurationFile = System.getProperty(UDDI_CONFIG_FILENAME_PROPERTY);
178                 }
179                 XMLConfiguration xmlConfig = null;
180                 if (configurationFile != null) {
181                         xmlConfig = new XMLConfiguration(configurationFile);
182                 } else {
183                         final String filename = System.getProperty(UDDI_CONFIG_FILENAME_PROPERTY);
184                         if (filename != null) {
185                                 xmlConfig = new XMLConfiguration(filename);
186                         } else {
187                                 xmlConfig = new XMLConfiguration(DEFAULT_UDDI_CONFIG);
188                         }
189                 }
190                 log.info("Reading UDDI Client properties file " + xmlConfig.getBasePath() + " use -D" + UDDI_CONFIG_FILENAME_PROPERTY + " to override");
191                 this.configurationFile = xmlConfig.getBasePath();
192                 long refreshDelay = xmlConfig.getLong(Property.UDDI_RELOAD_DELAY, 1000l);
193                 log.debug("Setting refreshDelay to " + refreshDelay);
194                 FileChangedReloadingStrategy fileChangedReloadingStrategy = new FileChangedReloadingStrategy();
195                 fileChangedReloadingStrategy.setRefreshDelay(refreshDelay);
196                 xmlConfig.setReloadingStrategy(fileChangedReloadingStrategy);
197                 compositeConfig.addConfiguration(xmlConfig);
198                 //Making the new configuration globally accessible.
199                 config = compositeConfig;
200                 readConfig(properties);
201 
202                 validateConfig();
203         }
204 
205         private Map<String, UDDIClerk> readClerkConfig(Configuration config, Map<String, UDDINode> uddiNodes)
206              throws ConfigurationException {
207                 clientName = config.getString("client[@name]");
208                 clientCallbackUrl = config.getString("client[@callbackUrl]");
209                 Map<String, UDDIClerk> clerks = new HashMap<String, UDDIClerk>();
210                 if (config.containsKey("client.clerks.clerk[@name]")) {
211                         String[] names = config.getStringArray("client.clerks.clerk[@name]");
212 
213                         log.debug("clerk names=" + names.length);
214                         for (int i = 0; i < names.length; i++) {
215                                 UDDIClerk uddiClerk = new UDDIClerk();
216                                 uddiClerk.setManagerName(clientName);
217                                 uddiClerk.setName(config.getString("client.clerks.clerk(" + i + ")[@name]"));
218                                 String nodeRef = config.getString("client.clerks.clerk(" + i + ")[@node]");
219                                 if (!uddiNodes.containsKey(nodeRef)) {
220                                         throw new ConfigurationException("Could not find Node with name=" + nodeRef);
221                                 }
222                                 UDDINode uddiNode = uddiNodes.get(nodeRef);
223                                 uddiClerk.setUDDINode(uddiNode);
224                                 uddiClerk.setPublisher(config.getString("client.clerks.clerk(" + i + ")[@publisher]"));
225                                 uddiClerk.setPassword(config.getString("client.clerks.clerk(" + i + ")[@password]"));
226                                 uddiClerk.setIsPasswordEncrypted(config.getBoolean("client.clerks.clerk(" + i + ")[@isPasswordEncrypted]", false));
227                                 uddiClerk.setCryptoProvider(config.getString("client.clerks.clerk(" + i + ")[@cryptoProvider]"));
228 
229                                 String clerkBusinessKey = config.getString("client.clerks.clerk(" + i + ")[@businessKey]");
230                                 String clerkBusinessName = config.getString("client.clerks.clerk(" + i + ")[@businessName]");
231                                 String clerkKeyDomain = config.getString("client.clerks.clerk(" + i + ")[@keyDomain]");
232 
233                                 String[] classes = config.getStringArray("client.clerks.clerk(" + i + ").class");
234                                 uddiClerk.setClassWithAnnotations(classes);
235 
236                                 int numberOfWslds = config.getStringArray("client.clerks.clerk(" + i + ").wsdl").length;
237                                 if (numberOfWslds > 0) {
238                                         UDDIClerk.WSDL[] wsdls = new UDDIClerk.WSDL[numberOfWslds];
239                                         for (int w = 0; w < wsdls.length; w++) {
240 
241                                                 UDDIClerk.WSDL wsdl = new UDDIClerk.WSDL();
242                                                 String fileName = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")");
243                                                 wsdl.setFileName(fileName);
244                                                 if (!new File(fileName).exists()) {
245                                                         log.warn("The wsdl file referenced in the config at '" + fileName + "' doesn't exist!");
246                                                 }
247                                                 String businessKey = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")[@businessKey]");
248                                                 String businessName = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")[@businessName]");
249                                                 String keyDomain = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")[@keyDomain]");
250                                                 if (businessKey == null) {
251                                                         businessKey = clerkBusinessKey;
252                                                 }
253                                                 if (businessKey == null) {
254                                                         businessKey = uddiClerk.getUDDINode().getProperties().getProperty("businessKey");
255                                                 }
256                                                 if (businessKey == null) {
257                                                         //use key convention to build the businessKey
258                                                         if (businessName == null) {
259                                                                 businessName = clerkBusinessName;
260                                                         }
261                                                         if (keyDomain == null) {
262                                                                 keyDomain = clerkKeyDomain;
263                                                         }
264                                                         if (keyDomain == null) {
265                                                                 keyDomain = uddiClerk.getUDDINode().getProperties().getProperty("keyDomain");
266                                                         }
267                                                         if ((businessName == null && !uddiClerk.getUDDINode().getProperties().containsKey("businessName"))
268                                                              || keyDomain == null && !uddiClerk.getUDDINode().getProperties().containsKey("keyDomain")) {
269                                                                 throw new ConfigurationException("Either the wsdl(" + wsdls[w]
270                                                                      + ") or clerk (" + uddiClerk.name + ") elements require a businessKey, or businessName & keyDomain attributes");
271                                                         } else {
272                                                                 Properties properties = new Properties(uddiClerk.getUDDINode().getProperties());
273                                                                 if (businessName != null) {
274                                                                         properties.put("businessName", businessName);
275                                                                 }
276                                                                 if (keyDomain != null) {
277                                                                         properties.put("keyDomain", keyDomain);
278                                                                 }
279                                                                 businessKey = UDDIKeyConvention.getBusinessKey(properties);
280                                                         }
281                                                 }
282                                                 if (!businessKey.toLowerCase().startsWith("uddi:") || !businessKey.substring(5).contains(":")) {
283                                                         throw new ConfigurationException("The businessKey '" + businessKey + "' does not implement a valid UDDI v3 key format. See config file at client.clerks.clerk(" + i + ").wsdl(" + w + ")[@businessKey]");
284                                                 }
285                                                 wsdl.setBusinessKey(businessKey);
286                                                 if (keyDomain == null) {
287                                                         keyDomain = businessKey.split(":")[1];
288                                                 }
289                                                 wsdl.setKeyDomain(keyDomain);
290                                                 wsdls[w] = wsdl;
291                                         }
292                                         uddiClerk.setWsdls(wsdls);
293                                 }
294 
295                                 clerks.put(names[i], uddiClerk);
296                         }
297                 }
298                 return clerks;
299         }
300 
301         /**
302          * signals that the specified classes/wsdls are registered with the UDDI
303          * server when UDDIClient.start() is called
304          * client.clerks[@registerOnStartup]
305          *
306          * @return true/false
307          */
308         public boolean isRegisterOnStartup() {
309                 boolean isRegisterOnStartup = false;
310                 if (config.containsKey("client.clerks[@registerOnStartup]")) {
311                         isRegisterOnStartup = config.getBoolean("client.clerks[@registerOnStartup]");
312                 }
313                 return isRegisterOnStartup;
314         }
315 
316         private Map<String, UDDINode> readNodeConfig(Configuration config, Properties properties)
317              throws ConfigurationException {
318                 String[] names = config.getStringArray("client.nodes.node.name");
319                 Map<String, UDDINode> nodes = new HashMap<String, UDDINode>();
320                 log.debug("node names=" + names.length);
321                 for (int i = 0; i < names.length; i++) {
322                         UDDINode uddiNode = new UDDINode();
323                         String nodeName = config.getString("client.nodes.node(" + i + ").name");
324                         String[] propertyKeys = config.getStringArray("client.nodes.node(" + i + ").properties.property[@name]");
325 
326                         if (propertyKeys != null && propertyKeys.length > 0) {
327                                 if (properties == null) {
328                                         properties = new Properties();
329                                 }
330                                 for (int p = 0; p < propertyKeys.length; p++) {
331                                         String name = config.getString("client.nodes.node(" + i + ").properties.property(" + p + ")[@name]");
332                                         String value = config.getString("client.nodes.node(" + i + ").properties.property(" + p + ")[@value]");
333                                         log.debug("Property: name=" + name + " value=" + value);
334                                         properties.put(name, value);
335                                 }
336                                 uddiNode.setProperties(properties);
337                         }
338 
339                         uddiNode.setHomeJUDDI(config.getBoolean("client.nodes.node(" + i + ")[@isHomeJUDDI]", false));
340                         uddiNode.setName(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").name"), properties));
341                         uddiNode.setClientName(TokenResolver.replaceTokens(config.getString("client[@name]"), properties));
342                         uddiNode.setDescription(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").description"), properties));
343                         uddiNode.setProxyTransport(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").proxyTransport"), properties));
344                         uddiNode.setInquiryUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").inquiryUrl"), properties));
345                         uddiNode.setInquiryRESTUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").inquiryRESTUrl"), properties));
346                         uddiNode.setPublishUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").publishUrl"), properties));
347                         uddiNode.setCustodyTransferUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").custodyTransferUrl"), properties));
348                         uddiNode.setSecurityUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").securityUrl"), properties));
349                         uddiNode.setReplicationUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").replicationUrl"), properties));
350                         uddiNode.setSubscriptionUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").subscriptionUrl"), properties));
351                         uddiNode.setSubscriptionListenerUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").subscriptionListenerUrl"), properties));
352                         uddiNode.setJuddiApiUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").juddiApiUrl"), properties));
353                         uddiNode.setFactoryInitial(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").javaNamingFactoryInitial"), properties));
354                         uddiNode.setFactoryURLPkgs(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").javaNamingFactoryUrlPkgs"), properties));
355                         uddiNode.setFactoryNamingProvider(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").javaNamingProviderUrl"), properties));
356                         nodes.put(nodeName, uddiNode);
357                 }
358                 return nodes;
359         }
360 
361         private Set<XRegistration> readXBusinessRegConfig(Configuration config, Map<String, UDDIClerk> clerks)
362              throws ConfigurationException {
363                 return readXRegConfig(config, clerks, "business");
364         }
365 
366         private Set<XRegistration> readXServiceBindingRegConfig(Configuration config, Map<String, UDDIClerk> clerks)
367              throws ConfigurationException {
368                 return readXRegConfig(config, clerks, "servicebinding");
369         }
370 
371         private Set<XRegistration> readXRegConfig(Configuration config, Map<String, UDDIClerk> clerks, String entityType)
372              throws ConfigurationException {
373                 String[] entityKeys = config.getStringArray("client.clerks.xregister." + entityType + "[@entityKey]");
374                 Set<XRegistration> xRegistrations = new HashSet<XRegistration>();
375                 if (entityKeys.length > 0) {
376                         log.info("XRegistration " + entityKeys.length + " " + entityType + "Keys");
377                 }
378                 for (int i = 0; i < entityKeys.length; i++) {
379                         XRegistration xRegistration = new XRegistration();
380                         xRegistration.setEntityKey(config.getString("client.clerks.xregister." + entityType + "(" + i + ")[@entityKey]"));
381 
382                         String fromClerkRef = config.getString("client.clerks.xregister." + entityType + "(" + i + ")[@fromClerk]");
383                         if (!clerks.containsKey(fromClerkRef)) {
384                                 throw new ConfigurationException("Could not find fromClerk with name=" + fromClerkRef);
385                         }
386                         UDDIClerk fromClerk = clerks.get(fromClerkRef);
387                         xRegistration.setFromClerk(fromClerk);
388 
389                         String toClerkRef = config.getString("client.clerks.xregister." + entityType + "(" + i + ")[@toClerk]");
390                         if (!clerks.containsKey(toClerkRef)) {
391                                 throw new ConfigurationException("Could not find toClerk with name=" + toClerkRef);
392                         }
393                         UDDIClerk toClerk = clerks.get(toClerkRef);
394                         xRegistration.setToClerk(toClerk);
395                         log.debug(xRegistration);
396 
397                         xRegistrations.add(xRegistration);
398                 }
399                 return xRegistrations;
400         }
401 
402         protected Map<String, UDDINode> getUDDINodes() {
403                 return uddiNodes;
404         }
405 
406         /**
407          * gets the current configuration's node list Only a copy of these
408          * values are returned
409          *
410          * @return a list of nodes representing the config file as described
411          * @since 3.3 updated to return all fields
412          * @since 3.2
413          */
414         public List<Node> getUDDINodeList() {
415                 List<Node> ret = new ArrayList<Node>();
416                 Iterator<UDDINode> it = uddiNodes.values().iterator();
417                 while (it.hasNext()) {
418                         UDDINode next = it.next();
419                         Node n = new Node();
420                         n.setClientName(next.getClientName());
421                         n.setDescription(next.getDescription());
422                         n.setName(next.getName());
423                         n.setProxyTransport(next.getProxyTransport());
424                         n.setCustodyTransferUrl(next.getCustodyTransferUrl());
425                         n.setFactoryInitial(next.getFactoryInitial());
426                         n.setFactoryNamingProvider(next.getFactoryNamingProvider());
427                         n.setFactoryURLPkgs(next.getFactoryURLPkgs());
428                         n.setInquiryUrl(next.getInquiryUrl());
429                         n.setJuddiApiUrl(next.getJuddiApiUrl());
430                         n.setPublishUrl(next.getPublishUrl());
431                         n.setReplicationUrl(next.getReplicationUrl());
432                         n.setSecurityUrl(next.getSecurityUrl());
433                         n.setSubscriptionListenerUrl(next.getSubscriptionListenerUrl());
434                         n.setSubscriptionUrl(next.getSubscriptionUrl());
435                         ret.add(n);
436                 }
437                 return ret;
438         }
439 
440         public UDDINode getHomeNode() throws ConfigurationException {
441                 if (uddiNodes == null) {
442                         throw new ConfigurationException("The juddi client configuration "
443                              + "must contain at least one node element.");
444                 }
445                 if (uddiNodes.values().size() == 1) {
446                         return uddiNodes.values().iterator().next();
447                 }
448                 UDDINode ret = null;
449                 for (UDDINode uddiNode : uddiNodes.values()) {
450                         if (uddiNode.isHomeJUDDI()) {
451                                 if (ret != null) {
452                                         throw new ConfigurationException("Only one of the node elements in the client configuration needs to a 'isHomeJUDDI=\"true\"' attribute.");
453                                 }
454                                 ret = uddiNode;
455                         }
456                 }
457                 if (ret != null) {
458                         return ret;
459                 }
460                 throw new ConfigurationException("One of the node elements in the client configuration needs to a 'isHomeJUDDI=\"true\"' attribute.");
461         }
462 
463         /**
464          * returns the named uddi node from config or throws if one is not found
465          * @param nodeName
466          * @return
467          * @throws ConfigurationException 
468          */
469         public UDDINode getUDDINode(String nodeName) throws ConfigurationException {
470                 if (!uddiNodes.containsKey(nodeName)) {
471                         throw new ConfigurationException("Node '" + nodeName
472                              + "' cannot be found in the config '" + getClientName() + "'");
473                 }
474                 return uddiNodes.get(nodeName);
475         }
476 
477         public Map<String, UDDIClerk> getUDDIClerks() {
478                 return uddiClerks;
479         }
480 
481         public Set<XRegistration> getXServiceBindingRegistrations() {
482                 return xServiceBindingRegistrations;
483         }
484 
485         public Set<XRegistration> getXBusinessRegistrations() {
486                 return xBusinessRegistrations;
487         }
488 
489         public Configuration getConfiguration() {
490                 return config;
491         }
492 
493         public String getClientName() {
494                 return clientName;
495         }
496 
497         @Deprecated
498         public String getClientCallbackUrl() {
499                 return clientCallbackUrl;
500         }
501 
502         public String getConfigurationFile() {
503                 return configurationFile;
504         }
505 
506         /**
507          * Used for WADL/WSDL to WSDL
508          *
509          * @return true/false
510          */
511         public boolean isX_To_Wsdl_Ignore_SSL_Errors() {
512                 return this.config.getBoolean("client.XtoWsdl.IgnoreSSLErrors", false);
513         }
514 
515         /**
516          * Fetches all digital signature related properties for the digital
517          * signature utility. warning, this will decrypt all passwords
518          *
519          * @return a properties object
520          * @throws Exception
521          * @see DigSigUtil
522          * @see Properties
523          */
524         public Properties getDigitalSignatureConfiguration() throws Exception {
525                 Properties p = new Properties();
526                 p.setProperty(DigSigUtil.CANONICALIZATIONMETHOD, this.config.getString("client.signature.canonicalizationMethod", CanonicalizationMethod.EXCLUSIVE));
527                 p.setProperty(DigSigUtil.CHECK_TIMESTAMPS, ((Boolean) (this.config.getBoolean("client.signature.checkTimestamps", true))).toString());
528                 p.setProperty(DigSigUtil.CHECK_REVOCATION_STATUS_CRL, ((Boolean) (this.config.getBoolean("client.signature.checkRevocationCRL", true))).toString());
529                 p.setProperty(DigSigUtil.CHECK_REVOCATION_STATUS_OCSP, ((Boolean) (this.config.getBoolean("client.signature.checkRevocationOCSP", true))).toString());
530                 p.setProperty(DigSigUtil.CHECK_TRUST_CHAIN, ((Boolean) (this.config.getBoolean("client.signature.checkTrust", true))).toString());
531 
532                 p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE, this.config.getString("client.signature.signingKeyStorePath", ""));
533                 p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILETYPE, this.config.getString("client.signature.signingKeyStoreType", ""));
534 
535                 if (this.config.getBoolean("client.signature.signingKeyPassword[@isPasswordEncrypted]", false)) {
536                         String enc = this.config.getString("client.signature.signingKeyPassword", "");
537                         String prov = this.config.getString("client.signature.signingKeyPassword[@cryptoProvider]", "");
538                         p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD, CryptorFactory.getCryptor(prov).decrypt(enc));
539                         p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC, "true");
540                         p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_PROVIDER, prov);
541                         p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_CIPHER, enc);
542                 } else {
543                         log.warn("Hey, you should consider encrypting your key password!");
544                         p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD, this.config.getString("client.signature.signingKeyPassword", ""));
545                         p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC, "false");
546                 }
547                 if (this.config.getBoolean("client.signature.signingKeyStoreFilePassword[@isPasswordEncrypted]", false)) {
548                         String enc = this.config.getString("client.signature.signingKeyStoreFilePassword", "");
549                         String prov = this.config.getString("client.signature.signingKeyStoreFilePassword[@cryptoProvider]", "");
550                         p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD, CryptorFactory.getCryptor(prov).decrypt(enc));
551                         p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_PROVIDER, (prov));
552                         p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_CIPHER, (enc));
553                 } else {
554                         log.warn("Hey, you should consider encrypting your keystore password!");
555                         p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD, this.config.getString("client.signature.signingKeyStoreFilePassword", ""));
556                 }
557 
558                 p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_ALIAS, this.config.getString("client.signature.signingKeyAlias", ""));
559                 p.setProperty(DigSigUtil.SIGNATURE_METHOD, this.config.getString("client.signature.signatureMethod", "http://www.w3.org/2000/09/xmldsig#rsa-sha1"));
560                 p.setProperty(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN, this.config.getString("client.signature.keyInfoInclusionSubjectDN", "true"));
561                 p.setProperty(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64, this.config.getString("client.signature.keyInfoInclusionBase64PublicKey", "true"));
562                 p.setProperty(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SERIAL, this.config.getString("client.signature.keyInfoInclusionSerial", "true"));
563 
564                 p.setProperty(DigSigUtil.SIGNATURE_OPTION_DIGEST_METHOD, this.config.getString("client.signature.digestMethod", "http://www.w3.org/2000/09/xmldsig#sha1"));
565 
566                 p.setProperty(DigSigUtil.TRUSTSTORE_FILE, this.config.getString("client.signature.trustStorePath", ""));
567                 p.setProperty(DigSigUtil.TRUSTSTORE_FILETYPE, this.config.getString("client.signature.trustStoreType", ""));
568 
569                 if (this.config.getBoolean("client.signature.trustStorePassword[@isPasswordEncrypted]", false)) {
570                         String enc = this.config.getString("client.signature.trustStorePassword", "");
571                         String prov = this.config.getString("client.signature.trustStorePassword[@cryptoProvider]", "");
572                         p.setProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD, CryptorFactory.getCryptor(prov).decrypt(enc));
573                         p.setProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_PROVIDER, (prov));
574                         p.setProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_CIPHER, (enc));
575                 } else {
576                         log.warn("Hey, you should consider encrypting your trust store password!");
577                         p.setProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD, this.config.getString("client.signature.trustStorePassword", ""));
578                 }
579 
580                 return p;
581         }
582 
583         /**
584          * adds a new node to the client configuration section. Don't forget to
585          * call save to persist the changes
586          *
587          * @param node
588          * @throws org.apache.commons.configuration.ConfigurationException
589          * @since 3.3
590          */
591         public void addUDDINode(UDDINode node) throws ConfigurationException {
592                 if (node == null) {
593                         throw new ConfigurationException("The new node is null");
594                 }
595                 if (this.uddiNodes.containsKey(node.getName())) {
596                         throw new ConfigurationException("Node '" + node.getName() + "' already existings in the collection!");
597                 }
598                 if (node.getClientName() == null || "".equalsIgnoreCase(node.getClientName())) {
599                         log.info("ClientName wasn't specified, I'll configure it with the defaults");
600                         node.setClientName(this.clientName);
601                 }
602                 if (node.getName() == null || "".equalsIgnoreCase(node.getName())) {
603                        throw new ConfigurationException("Node Name wasn't specified. It cannot be null");
604                 }
605                 this.uddiNodes.put(node.getName(), node);
606 
607         }
608 
609         /**
610          * removes the named node from the client configuration section. don't
611          * forget to save to persist the changes
612          *
613          * @param name expecting the Node name, not the "clientName"
614          * @throws ConfigurationException
615          */
616         public void removeUDDINode(String name) throws ConfigurationException {
617                 if (this.uddiNodes.containsKey(name)) {
618                         this.uddiNodes.remove(name);
619                 }
620         }
621 
622         /**
623          * performs some basic validation tests on the config setting that was
624          * read from file
625          */
626         private void validateConfig() throws ConfigurationException {
627                 if (config == null) {
628                         throw new ConfigurationException("config is null!");
629                 }
630                 if (uddiNodes == null) {
631                         throw new ConfigurationException("nodes is null!");
632                 }
633                 if (uddiClerks == null) {
634                         throw new ConfigurationException("clerks is null!");
635                 }
636                 Iterator<Map.Entry<String, UDDIClerk>> it = uddiClerks.entrySet().iterator();
637                 while (it.hasNext()) {
638                         Map.Entry<String, UDDIClerk> next = it.next();
639                         if (next.getValue().uddiNode == null) {
640                                 throw new ConfigurationException("clerk " + next.getValue().name + " references a node that doesn't exist!");
641                         }
642                 }
643         }
644 
645         private void addCurrentNodeConfig(Configuration cc) {
646 
647                 cc.addProperty("[@xmlns]", config.getProperty("[@xmlns]"));
648                 cc.addProperty("client(0)[@name]", clientName);
649                 Iterator<Map.Entry<String, UDDINode>> iterator = uddiNodes.entrySet().iterator();
650                 int i = 0;
651                 while (iterator.hasNext()) {
652                         log.debug("node names=" + uddiNodes.size());
653 
654                         UDDINode uddiNode = iterator.next().getValue();
655 
656                         Properties properties = uddiNode.getProperties();
657 
658                         if (properties == null) {
659                                 properties = new Properties();
660                         }
661                         Iterator<Map.Entry<Object, Object>> iterator1 = properties.entrySet().iterator();
662                         int x = 0;
663                         while (iterator1.hasNext()) {
664                                 Map.Entry<Object, Object> next = iterator1.next();
665                                 cc.addProperty("client(0).nodes.node(" + i + ").properties.property(" + x + ")[@name]", next.getKey());
666                                 cc.addProperty("client(0).nodes.node(" + i + ").properties.property(" + x + ")[@value]", next.getValue());
667 
668                                 log.debug("Property: name=" + next.getKey() + " value=" + next.getValue());
669 
670                                 x++;
671                         }
672 
673                         cc.addProperty("client(0).nodes.node(" + i + ")[@isHomeJUDDI]", uddiNode.isHomeJUDDI());
674                         cc.addProperty("client(0).nodes.node(" + i + ").name", uddiNode.getName());
675                         cc.addProperty("client(0).nodes.node(" + i + ").description", uddiNode.getDescription());
676                         cc.addProperty("client(0).nodes.node(" + i + ").proxyTransport", uddiNode.getProxyTransport());
677                         cc.addProperty("client(0).nodes.node(" + i + ").inquiryUrl", uddiNode.getInquiryUrl());
678                         cc.addProperty("client(0).nodes.node(" + i + ").inquiryRESTUrl", uddiNode.getInquiry_REST_Url());
679                         cc.addProperty("client(0).nodes.node(" + i + ").publishUrl", uddiNode.getPublishUrl());
680                         cc.addProperty("client(0).nodes.node(" + i + ").custodyTransferUrl", uddiNode.getCustodyTransferUrl());
681                         cc.addProperty("client(0).nodes.node(" + i + ").securityUrl", uddiNode.getSecurityUrl());
682                         cc.addProperty("client(0).nodes.node(" + i + ").replicationUrl", uddiNode.getReplicationUrl());
683                         cc.addProperty("client(0).nodes.node(" + i + ").subscriptionUrl", uddiNode.getSubscriptionUrl());
684                         cc.addProperty("client(0).nodes.node(" + i + ").juddiApiUrl", uddiNode.getJuddiApiUrl());
685                         cc.addProperty("client(0).nodes.node(" + i + ").subscriptionListenerUrl", uddiNode.getSubscriptionListenerUrl());
686                         cc.addProperty("client(0).nodes.node(" + i + ").javaNamingFactoryInitial", uddiNode.getFactoryInitial());
687                         cc.addProperty("client(0).nodes.node(" + i + ").javaNamingFactoryUrlPkgs", uddiNode.getFactoryURLPkgs());
688                         cc.addProperty("client(0).nodes.node(" + i + ").javaNamingProviderUrl", uddiNode.getFactoryNamingProvider());
689 
690                         i++;
691                 }
692 
693         }
694 
695         private void addCurrentClerks(Configuration cc) {
696 
697                 Iterator<Map.Entry<String, UDDIClerk>> iterator = uddiClerks.entrySet().iterator();
698                 clientName = config.getString("client[@name]");
699                 clientCallbackUrl = config.getString("client(0)[@callbackUrl]");
700 
701                 cc.addProperty("client(0).clerks[@registerOnStartup]", isRegisterOnStartup());
702                 int i = 0;
703                 while (iterator.hasNext()) {
704 
705                         UDDIClerk uddiClerk = iterator.next().getValue();
706                         cc.addProperty("client(0).clerks.clerk(" + i + ")[@name]", uddiClerk.getName());
707                         //registerOnStartup
708                         cc.addProperty("client(0).clerks.clerk(" + i + ")[@node]", uddiClerk.getUDDINode().getName());
709 
710                         cc.addProperty("client(0).clerks.clerk(" + i + ")[@publisher]", uddiClerk.getPublisher());
711                         cc.addProperty("client(0).clerks.clerk(" + i + ")[@password]", uddiClerk.getRawPassword());
712 
713                         cc.addProperty("client(0).clerks.clerk(" + i + ")[@isPasswordEncrypted]", uddiClerk.getIsPasswordEncrypted());
714 
715                         cc.addProperty("client(0).clerks.clerk(" + i + ")[@cryptoProvider]", uddiClerk.getCryptoProvider());
716 
717                         String[] classes = uddiClerk.getClassWithAnnotations();
718                         if (classes != null) {
719                                 for (int x = 0; x < classes.length; x++) {
720                                         cc.addProperty("client(0).clerks.clerk(" + i + ").class(" + x + ")", classes[x]);
721                                 }
722                         }
723 
724                         UDDIClerk.WSDL[] wsdls = uddiClerk.getWsdls();
725                         if (wsdls != null) {
726                                 for (int w = 0; w < wsdls.length; w++) {
727                                         cc.addProperty("client(0).clerks.clerk(" + i + ").wsdl(" + w + ")", wsdls[w].getFileName());
728                                         cc.addProperty("client(0).clerks.clerk(" + i + ").wsdl(" + w + ")[@businessKey]", wsdls[w].getBusinessKey());
729                                         cc.addProperty("client(0).clerks.clerk(" + i + ").wsdl(" + w + ")[@keyDomain]", wsdls[w].getKeyDomain());
730                                 }
731                         }
732                         i++;
733                 }
734 
735                 if (xBusinessRegistrations != null) {
736                         Iterator<XRegistration> iterator1 = xBusinessRegistrations.iterator();
737                         int x = 0;
738                         while (iterator1.hasNext()) {
739                                 XRegistration next = iterator1.next();
740                                 cc.addProperty("client(0).clerks.business(" + x + ")[@fromClerk]", next.getFromClerk().name);
741                                 cc.addProperty("client(0).clerks.business(" + x + ")[@toClerk]", next.getToClerk().name);
742                                 cc.addProperty("client(0).clerks.business(" + x + ")[@entityKey]", next.getEntityKey());
743                                 x++;
744                         }
745                 }
746                 if (xServiceBindingRegistrations != null) {
747                         Iterator<XRegistration> iterator1 = xServiceBindingRegistrations.iterator();
748                         int x = 0;
749                         while (iterator1.hasNext()) {
750                                 XRegistration next = iterator1.next();
751                                 cc.addProperty("client(0).clerks.servicebinding(" + x + ")[@fromClerk]", next.getFromClerk().name);
752                                 cc.addProperty("client(0).clerks.servicebinding(" + x + ")[@toClerk]", next.getToClerk().name);
753                                 cc.addProperty("client(0).clerks.servicebinding(" + x + ")[@entityKey]", next.getEntityKey());
754                                 x++;
755                         }
756                 }
757         }
758 
759         private void addSubscriptionCallback(Configuration cc) {
760                 if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_AUTOREG_BT)) {
761                         cc.addProperty(SubscriptionCallbackListener.PROPERTY_AUTOREG_BT, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_AUTOREG_BT));
762                 }
763                 if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_AUTOREG_SERVICE_KEY)) {
764                         cc.addProperty(SubscriptionCallbackListener.PROPERTY_AUTOREG_SERVICE_KEY, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_AUTOREG_SERVICE_KEY));
765                 }
766                 if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_KEYDOMAIN)) {
767                         cc.addProperty(SubscriptionCallbackListener.PROPERTY_KEYDOMAIN, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_KEYDOMAIN));
768                 }
769                 if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_LISTENURL)) {
770                         cc.addProperty(SubscriptionCallbackListener.PROPERTY_LISTENURL, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_LISTENURL));
771                 }
772                 if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_NODE)) {
773                         cc.addProperty(SubscriptionCallbackListener.PROPERTY_NODE, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_NODE));
774                 }
775                 if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_SIGNATURE_BEHAVIOR)) {
776                         cc.addProperty(SubscriptionCallbackListener.PROPERTY_SIGNATURE_BEHAVIOR, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_SIGNATURE_BEHAVIOR));
777                 }
778         }
779 
780         private void addDigitalSubscription(Configuration cc) throws Exception {
781                 Properties p = this.getDigitalSignatureConfiguration();
782                 Iterator<Map.Entry<Object, Object>> it = p.entrySet().iterator();
783                 while (it.hasNext()) {
784                         Map.Entry<Object, Object> next = it.next();
785                         String key = (String) next.getKey();
786                         Object val = next.getValue();
787                         if (val == null) {
788                                 continue;
789                         }
790                         if (key.equalsIgnoreCase(DigSigUtil.CANONICALIZATIONMETHOD)) {
791                                 cc.addProperty("client(0).signature.canonicalizationMethod", val);
792                         } else if (key.equalsIgnoreCase(DigSigUtil.CHECK_TIMESTAMPS)) {
793                                 cc.addProperty("client(0).signature.checkTimestamps", val);
794                         } else if (key.equalsIgnoreCase(DigSigUtil.CHECK_REVOCATION_STATUS_CRL)) {
795                                 cc.addProperty("client(0).signature.checkRevocationCRL", val);
796                         } else if (key.equalsIgnoreCase(DigSigUtil.CHECK_REVOCATION_STATUS_OCSP)) {
797                                 cc.addProperty("client(0).signature.checkRevocationOCSP", val);
798                         } else if (key.equalsIgnoreCase(DigSigUtil.CHECK_TRUST_CHAIN)) {
799                                 cc.addProperty("client(0).signature.checkTrust", val);
800                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_FILE)) {
801                                 cc.addProperty("client(0).signature.signingKeyStorePath", val);
802                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_FILETYPE)) {
803                                 cc.addProperty("client(0).signature.signingKeyStoreType", val);
804                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD)) {
805                                 cc.addProperty("client(0).signature.signingKeyPassword", val);
806                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC)) {
807                                 cc.addProperty("client(0).signature.signingKeyPassword[@isPasswordEncrypted]", val);
808                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_PROVIDER)) {
809                                 cc.addProperty("client(0).signature.signingKeyPassword[@cryptoProvider]", val);
810                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_CIPHER)) {
811                                 cc.addProperty("client(0).signature.signingKeyPassword", val);
812                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_KEY_ALIAS)) {
813                                 cc.addProperty("client(0).signature.signingKeyAlias", val);
814                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_METHOD)) {
815                                 cc.addProperty("client(0).signature.signatureMethod", val);
816                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN)) {
817                                 cc.addProperty("client(0).signature.keyInfoInclusionSubjectDN", val);
818                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64)) {
819                                 cc.addProperty("client(0).signature.keyInfoInclusionBase64PublicKey", val);
820                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SERIAL)) {
821                                 cc.addProperty("client(0).signature.keyInfoInclusionSerial", val);
822                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_OPTION_DIGEST_METHOD)) {
823                                 cc.addProperty("client(0).signature.digestMethod", val);
824                         } else if (key.equalsIgnoreCase(DigSigUtil.TRUSTSTORE_FILE)) {
825                                 cc.addProperty("client(0).signature.trustStorePath", val);
826                         } else if (key.equalsIgnoreCase(DigSigUtil.TRUSTSTORE_FILETYPE)) {
827                                 cc.addProperty("client(0).signature.trustStoreType", val);
828                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_WASENC)) {
829                                 cc.addProperty("client(0).signature.signingKeyStoreFilePassword[@isPasswordEncrypted]", val);
830                         } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_PROVIDER)) {
831                                 cc.addProperty("client(0).signature.signingKeyStoreFilePassword[@cryptoProvider]", val);
832                         } else if (key.equalsIgnoreCase(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_WASENC)) {
833                                 cc.addProperty("client(0).signature.trustStorePassword[@isPasswordEncrypted]", val);
834                         } else if (key.equalsIgnoreCase(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_PROVIDER)) {
835                                 cc.addProperty("client(0).signature.trustStorePassword[@cryptoProvider]", val);
836                         }
837 
838                 }
839 
840                 if (p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_WASENC, "false").equalsIgnoreCase("true")) {
841                         cc.addProperty("client(0).signature.signingKeyStoreFilePassword", p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_CIPHER));
842                 } else {
843                         cc.addProperty("client(0).signature.signingKeyStoreFilePassword", p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD));
844                 }
845 
846                 if (p.getProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_WASENC, "false").equalsIgnoreCase("true")) {
847                         cc.addProperty("client(0).signature.trustStorePassword", p.getProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_CIPHER));
848                 } else {
849                         cc.addProperty("client(0).signature.trustStorePassword", p.getProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD));
850                 }
851 
852                 if (p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC, "false").equalsIgnoreCase("true")) {
853                         cc.addProperty("client(0).signature.signingKeyPassword", p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_CIPHER));
854                 } else {
855                         cc.addProperty("client(0).signature.signingKeyPassword", p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD));
856                 }
857 
858         }
859 
860         private void addXRegistration(Configuration cc) {
861 
862                 cc.addProperty("client.XtoWsdl.IgnoreSSLErrors", isX_To_Wsdl_Ignore_SSL_Errors());
863         }
864 
865 }