You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by al...@apache.org on 2014/11/13 01:55:07 UTC
[1/2] juddi git commit: JUDDI-890 fixed,
hopefully all content is preserved while saving, minus xml comments
Repository: juddi
Updated Branches:
refs/heads/master bd0b53f99 -> 1a894c892
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-core/src/test/resources/META-INF/uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-core/src/test/resources/META-INF/uddi.xml b/juddi-core/src/test/resources/META-INF/uddi.xml
index e8f210f..633da90 100644
--- a/juddi-core/src/test/resources/META-INF/uddi.xml
+++ b/juddi-core/src/test/resources/META-INF/uddi.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<reloadDelay>5000</reloadDelay>
<client name="juddi-core-unittest-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-examples/ValueSetValidator/src/main/resources/META-INF/uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-examples/ValueSetValidator/src/main/resources/META-INF/uddi.xml b/juddi-examples/ValueSetValidator/src/main/resources/META-INF/uddi.xml
index 83e103c..c8555fe 100644
--- a/juddi-examples/ValueSetValidator/src/main/resources/META-INF/uddi.xml
+++ b/juddi-examples/ValueSetValidator/src/main/resources/META-INF/uddi.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<reloadDelay>5000</reloadDelay>
<client name="example-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-examples/create-partition/src/main/resources/META-INF/partition-uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-examples/create-partition/src/main/resources/META-INF/partition-uddi.xml b/juddi-examples/create-partition/src/main/resources/META-INF/partition-uddi.xml
index 5af1253..80ac1cf 100644
--- a/juddi-examples/create-partition/src/main/resources/META-INF/partition-uddi.xml
+++ b/juddi-examples/create-partition/src/main/resources/META-INF/partition-uddi.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="uddi-client classpath:xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="uddi-client classpath:xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<reloadDelay>5000</reloadDelay>
<client name="example-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-examples/more-uddi-samples/src/main/resources/META-INF/simple-publish-uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-examples/more-uddi-samples/src/main/resources/META-INF/simple-publish-uddi.xml b/juddi-examples/more-uddi-samples/src/main/resources/META-INF/simple-publish-uddi.xml
index 1164c4e..1f8be39 100644
--- a/juddi-examples/more-uddi-samples/src/main/resources/META-INF/simple-publish-uddi.xml
+++ b/juddi-examples/more-uddi-samples/src/main/resources/META-INF/simple-publish-uddi.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
<reloadDelay>5000</reloadDelay>
<client name="example-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-examples/simple-publish-clerk/src/main/resources/META-INF/uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-examples/simple-publish-clerk/src/main/resources/META-INF/uddi.xml b/juddi-examples/simple-publish-clerk/src/main/resources/META-INF/uddi.xml
index 83e103c..c8555fe 100644
--- a/juddi-examples/simple-publish-clerk/src/main/resources/META-INF/uddi.xml
+++ b/juddi-examples/simple-publish-clerk/src/main/resources/META-INF/uddi.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<reloadDelay>5000</reloadDelay>
<client name="example-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-examples/simple-publish-portable/src/main/resources/META-INF/uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-examples/simple-publish-portable/src/main/resources/META-INF/uddi.xml b/juddi-examples/simple-publish-portable/src/main/resources/META-INF/uddi.xml
index f54c4ed..b3418e1 100644
--- a/juddi-examples/simple-publish-portable/src/main/resources/META-INF/uddi.xml
+++ b/juddi-examples/simple-publish-portable/src/main/resources/META-INF/uddi.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<reloadDelay>5000</reloadDelay>
<client name="example-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-examples/uddi-annotations/src/main/resources/META-INF/sales-uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-examples/uddi-annotations/src/main/resources/META-INF/sales-uddi.xml b/juddi-examples/uddi-annotations/src/main/resources/META-INF/sales-uddi.xml
index 2ee3cbd..4949047 100644
--- a/juddi-examples/uddi-annotations/src/main/resources/META-INF/sales-uddi.xml
+++ b/juddi-examples/uddi-annotations/src/main/resources/META-INF/sales-uddi.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<reloadDelay>5000</reloadDelay>
<client name="example-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-examples/uddi-annotations/src/main/resources/META-INF/uddi-annotations.xml
----------------------------------------------------------------------
diff --git a/juddi-examples/uddi-annotations/src/main/resources/META-INF/uddi-annotations.xml b/juddi-examples/uddi-annotations/src/main/resources/META-INF/uddi-annotations.xml
index f986daa..cff9fed 100644
--- a/juddi-examples/uddi-annotations/src/main/resources/META-INF/uddi-annotations.xml
+++ b/juddi-examples/uddi-annotations/src/main/resources/META-INF/uddi-annotations.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<reloadDelay>5000</reloadDelay>
<client name="uddi-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/wsdl2uddi-uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/wsdl2uddi-uddi.xml b/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/wsdl2uddi-uddi.xml
index caa2f6a..28b35e8 100644
--- a/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/wsdl2uddi-uddi.xml
+++ b/juddi-examples/wsdl2uddi-lifecyle/src/main/resources/META-INF/wsdl2uddi-uddi.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" >
<reloadDelay>5000</reloadDelay>
<client name="example-client" >
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-examples/wsdl2uddi/src/main/resources/META-INF/wsdl2uddi-uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-examples/wsdl2uddi/src/main/resources/META-INF/wsdl2uddi-uddi.xml b/juddi-examples/wsdl2uddi/src/main/resources/META-INF/wsdl2uddi-uddi.xml
index e24757e..cdb2c1e 100644
--- a/juddi-examples/wsdl2uddi/src/main/resources/META-INF/wsdl2uddi-uddi.xml
+++ b/juddi-examples/wsdl2uddi/src/main/resources/META-INF/wsdl2uddi-uddi.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" >
<reloadDelay>5000</reloadDelay>
<client name="example-client" callbackUrl="http://localhost:8079/subscriptionlistener_uddi_client">
<nodes>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org
[2/2] juddi git commit: JUDDI-890 fixed,
hopefully all content is preserved while saving, minus xml comments
Posted by al...@apache.org.
JUDDI-890 fixed, hopefully all content is preserved while saving, minus xml comments
Project: http://git-wip-us.apache.org/repos/asf/juddi/repo
Commit: http://git-wip-us.apache.org/repos/asf/juddi/commit/1a894c89
Tree: http://git-wip-us.apache.org/repos/asf/juddi/tree/1a894c89
Diff: http://git-wip-us.apache.org/repos/asf/juddi/diff/1a894c89
Branch: refs/heads/master
Commit: 1a894c8926a84314305b3e3727486545f1025a20
Parents: bd0b53f
Author: alexoree <al...@apache.org>
Authored: Wed Nov 12 19:54:54 2014 -0500
Committer: alexoree <al...@apache.org>
Committed: Wed Nov 12 19:54:54 2014 -0500
----------------------------------------------------------------------
.../juddi/v3/client/config/ClientConfig.java | 1084 ++++++++++++------
.../juddi/v3/client/config/UDDIClient.java | 2 +-
.../juddi/v3/client/cryptor/DigSigUtil.java | 13 +
.../v3/client/config/MisconfigurationTests.java | 44 -
.../src/test/resources/META-INF/configtests.xml | 2 +-
.../test/resources/META-INF/subscription.xml | 2 +-
.../resources/META-INF/uddi-subcallback1.xml | 2 +-
.../resources/META-INF/uddi-subcallback2.xml | 2 +-
.../resources/META-INF/uddi-subcallback3.xml | 2 +-
.../src/test/resources/META-INF/uddi.xml | 4 +-
.../src/test/resources/META-INF/uddi2.xml | 2 +-
.../resources/META-INF/uddi3-enc-aes128.xml | 2 +-
.../src/test/resources/META-INF/uddiv2.xml | 2 +-
.../src/test/resources/META-INF/uddi.xml | 2 +-
juddi-core/src/test/resources/META-INF/uddi.xml | 2 +-
.../src/main/resources/META-INF/uddi.xml | 2 +-
.../main/resources/META-INF/partition-uddi.xml | 2 +-
.../resources/META-INF/simple-publish-uddi.xml | 2 +-
.../src/main/resources/META-INF/uddi.xml | 2 +-
.../src/main/resources/META-INF/uddi.xml | 2 +-
.../src/main/resources/META-INF/sales-uddi.xml | 2 +-
.../resources/META-INF/uddi-annotations.xml | 2 +-
.../main/resources/META-INF/wsdl2uddi-uddi.xml | 2 +-
.../main/resources/META-INF/wsdl2uddi-uddi.xml | 2 +-
24 files changed, 760 insertions(+), 425 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
----------------------------------------------------------------------
diff --git a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
index 54249a5..bb8d6f9 100644
--- a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
+++ b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
@@ -24,6 +24,8 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.xml.crypto.dsig.CanonicalizationMethod;
@@ -38,420 +40,784 @@ import org.apache.commons.logging.LogFactory;
import org.apache.juddi.api_v3.Node;
import org.apache.juddi.v3.client.cryptor.CryptorFactory;
import org.apache.juddi.v3.client.cryptor.DigSigUtil;
+import org.apache.juddi.v3.client.subscription.SubscriptionCallbackListener;
/**
* Handles the client configuration of the uddi-client. By default it first
- * looks at system properties. Then loads from the config file from the system property
- * "uddi.client.xml", next the user specified file, finally, "META-INF/uddi.xml"
- *
+ * looks at system properties. Then loads from the config file from the system
+ * property "uddi.client.xml", next the user specified file, finally,
+ * "META-INF/uddi.xml"
+ *
* @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
*/
-public class ClientConfig
-{
- public final static String UDDI_CONFIG_FILENAME_PROPERTY = "uddi.client.xml";
- public final static String DEFAULT_UDDI_CONFIG = "META-INF/uddi.xml";
- private Log log = LogFactory.getLog(ClientConfig.class);
- private Configuration config = null;;
- private Map<String,UDDINode> uddiNodes = null;
- private Map<String,UDDIClerk> uddiClerks = null;
- private Set<XRegistration> xBusinessRegistrations = null;
- private Set<XRegistration> xServiceBindingRegistrations = null;
- private String clientName = null;
- private String clientCallbackUrl = null;
- private String configurationFile=null;
-
- /**
- * Constructor (note Singleton pattern).
- * @throws ConfigurationException
- */
- public ClientConfig(String configurationFile) throws ConfigurationException
- {
- loadConfiguration(configurationFile, null);
- }
- /**
- * Constructor (note Singleton pattern).
- * @throws ConfigurationException
- */
- public ClientConfig(String configurationFile, Properties properties) throws ConfigurationException
- {
- loadConfiguration(configurationFile, properties);
- }
+public class ClientConfig {
+
+ public final static String UDDI_CONFIG_FILENAME_PROPERTY = "uddi.client.xml";
+ public final static String DEFAULT_UDDI_CONFIG = "META-INF/uddi.xml";
+ private Log log = LogFactory.getLog(ClientConfig.class);
+ private Configuration config = null;
+ private Map<String, UDDINode> uddiNodes = null;
+ private Map<String, UDDIClerk> uddiClerks = null;
+ private Set<XRegistration> xBusinessRegistrations = null;
+ private Set<XRegistration> xServiceBindingRegistrations = null;
+ private String clientName = null;
+ private String clientCallbackUrl = null;
+ private String configurationFile = null;
+
+ /**
+ * Constructor (note Singleton pattern).
+ *
+ * @throws ConfigurationException
+ */
+ public ClientConfig(String configurationFile) throws ConfigurationException {
+ loadConfiguration(configurationFile, null);
+ }
+
+ /**
+ * Constructor (note Singleton pattern).
+ *
+ * @throws ConfigurationException
+ */
+ public ClientConfig(String configurationFile, Properties properties) throws ConfigurationException {
+ loadConfiguration(configurationFile, properties);
+ }
+
/**
* Attempts to save any changes made to the configuration back to disk
- * @throws ConfigurationException
+ *
+ * @throws ConfigurationException
*/
- public void saveConfig() throws ConfigurationException
- {
-
- XMLConfiguration saveConfiguration = new XMLConfiguration(configurationFile);
- Configuration cc = new CompositeConfiguration(saveConfiguration);
- Iterator<String> keys = this.config.getKeys();
- while (keys.hasNext()){
- String key = keys.next();
- if (key.startsWith("client") || key.startsWith("config"))
+ public void saveConfig() throws ConfigurationException {
+
+ /*System.out.println("DEBUG dumping current cfg");
+ Iterator<String> keys = config.getKeys();
+ while(keys.hasNext())
{
- cc.setProperty(key, config.getProperty(key));
+ String k=keys.next();
+ System.out.println(k +" = " + config.getProperty(k));
+ }*/
+ XMLConfiguration saveConfiguration = new XMLConfiguration();
+ Configuration cc = new CompositeConfiguration(saveConfiguration);
+
+ saveConfiguration.setRootElementName("uddi");
+
+ cc.addProperty("reloadDelay", config.getProperty("reloadDelay"));
+ addCurrentNodeConfig(cc);
+ addCurrentClerks(cc);
+ try {
+ addDigitalSubscription(cc);
+ } catch (Exception ex) {
+ throw new ConfigurationException("error", ex);
}
- }
- saveConfiguration.save();
+ addSubscriptionCallback(cc);
+
+ /*log.de("DEBUG dumping NEW cfg");
+ keys= cc.getKeys();
+
+ while(keys.hasNext())
+ {
+ String k=keys.next();
+ System.out.println(k +" = " + config.getProperty(k));
+ }*/
+ addXRegistration(cc);
+
+ saveConfiguration.save(configurationFile);
}
-
- protected void readConfig(Properties properties) throws ConfigurationException {
- uddiNodes = readNodeConfig(config, properties);
- uddiClerks = readClerkConfig(config, uddiNodes);
- xServiceBindingRegistrations = readXServiceBindingRegConfig(config,uddiClerks);
- xBusinessRegistrations = readXBusinessRegConfig(config, uddiClerks);
- }
- /**
- * Does the actual work of reading the configuration from System
- * Properties and/or uddi.xml file. When the uddi.xml
- * file is updated the file will be reloaded. By default the reloadDelay is
- * set to 1 second to prevent excessive date stamp checking.
- */
- private void loadConfiguration(String configurationFile, Properties properties) throws ConfigurationException {
- //Properties from system properties
- CompositeConfiguration compositeConfig = new CompositeConfiguration();
- compositeConfig.addConfiguration(new SystemConfiguration());
- //Properties from XML file
- if (System.getProperty(UDDI_CONFIG_FILENAME_PROPERTY)!=null){
+
+ protected void readConfig(Properties properties) throws ConfigurationException {
+ uddiNodes = readNodeConfig(config, properties);
+ uddiClerks = readClerkConfig(config, uddiNodes);
+ xServiceBindingRegistrations = readXServiceBindingRegConfig(config, uddiClerks);
+ xBusinessRegistrations = readXBusinessRegConfig(config, uddiClerks);
+ }
+
+ /**
+ * Does the actual work of reading the configuration from System
+ * Properties and/or uddi.xml file. When the uddi.xml file is updated
+ * the file will be reloaded. By default the reloadDelay is set to 1
+ * second to prevent excessive date stamp checking.
+ */
+ private void loadConfiguration(String configurationFile, Properties properties) throws ConfigurationException {
+ //Properties from system properties
+ CompositeConfiguration compositeConfig = new CompositeConfiguration();
+ compositeConfig.addConfiguration(new SystemConfiguration());
+ //Properties from XML file
+ if (System.getProperty(UDDI_CONFIG_FILENAME_PROPERTY) != null) {
log.info("Using system property config override");
configurationFile = System.getProperty(UDDI_CONFIG_FILENAME_PROPERTY);
}
- XMLConfiguration xmlConfig = null;
- if (configurationFile!=null) {
- xmlConfig = new XMLConfiguration(configurationFile);
- } else {
- final String filename = System.getProperty(UDDI_CONFIG_FILENAME_PROPERTY);
- if (filename != null) {
- xmlConfig = new XMLConfiguration(filename);
- } else {
- xmlConfig = new XMLConfiguration(DEFAULT_UDDI_CONFIG);
- }
- }
- log.info("Reading UDDI Client properties file " + xmlConfig.getBasePath() + " use -D"+UDDI_CONFIG_FILENAME_PROPERTY+ " to override");
- this.configurationFile = xmlConfig.getBasePath();
- long refreshDelay = xmlConfig.getLong(Property.UDDI_RELOAD_DELAY, 1000l);
- log.debug("Setting refreshDelay to " + refreshDelay);
- FileChangedReloadingStrategy fileChangedReloadingStrategy = new FileChangedReloadingStrategy();
- fileChangedReloadingStrategy.setRefreshDelay(refreshDelay);
- xmlConfig.setReloadingStrategy(fileChangedReloadingStrategy);
- compositeConfig.addConfiguration(xmlConfig);
- //Making the new configuration globally accessible.
- config = compositeConfig;
- readConfig(properties);
- }
-
- private Map<String,UDDIClerk> readClerkConfig(Configuration config, Map<String,UDDINode> uddiNodes)
- throws ConfigurationException {
- clientName = config.getString("client[@name]");
- clientCallbackUrl = config.getString("client[@callbackUrl]");
- Map<String,UDDIClerk> clerks = new HashMap<String,UDDIClerk>();
- if (config.containsKey("client.clerks.clerk[@name]")) {
- String[] names = config.getStringArray("client.clerks.clerk[@name]");
-
- log.debug("clerk names=" + names.length);
- for (int i=0; i<names.length; i++) {
- UDDIClerk uddiClerk = new UDDIClerk();
- uddiClerk.setManagerName(clientName);
- uddiClerk.setName( config.getString("client.clerks.clerk(" + i + ")[@name]"));
- String nodeRef = config.getString("client.clerks.clerk(" + i + ")[@node]");
- if (!uddiNodes.containsKey(nodeRef)) throw new ConfigurationException("Could not find Node with name=" + nodeRef);
- UDDINode uddiNode = uddiNodes.get(nodeRef);
- uddiClerk.setUDDINode(uddiNode);
- uddiClerk.setPublisher(config.getString("client.clerks.clerk(" + i + ")[@publisher]"));
- uddiClerk.setPassword( config.getString("client.clerks.clerk(" + i + ")[@password]"));
- uddiClerk.setIsPasswordEncrypted(config.getBoolean("client.clerks.clerk(" + i + ")[@isPasswordEncrypted]",false) );
+ XMLConfiguration xmlConfig = null;
+ if (configurationFile != null) {
+ xmlConfig = new XMLConfiguration(configurationFile);
+ } else {
+ final String filename = System.getProperty(UDDI_CONFIG_FILENAME_PROPERTY);
+ if (filename != null) {
+ xmlConfig = new XMLConfiguration(filename);
+ } else {
+ xmlConfig = new XMLConfiguration(DEFAULT_UDDI_CONFIG);
+ }
+ }
+ log.info("Reading UDDI Client properties file " + xmlConfig.getBasePath() + " use -D" + UDDI_CONFIG_FILENAME_PROPERTY + " to override");
+ this.configurationFile = xmlConfig.getBasePath();
+ long refreshDelay = xmlConfig.getLong(Property.UDDI_RELOAD_DELAY, 1000l);
+ log.debug("Setting refreshDelay to " + refreshDelay);
+ FileChangedReloadingStrategy fileChangedReloadingStrategy = new FileChangedReloadingStrategy();
+ fileChangedReloadingStrategy.setRefreshDelay(refreshDelay);
+ xmlConfig.setReloadingStrategy(fileChangedReloadingStrategy);
+ compositeConfig.addConfiguration(xmlConfig);
+ //Making the new configuration globally accessible.
+ config = compositeConfig;
+ readConfig(properties);
+
+ validateConfig();
+ }
+
+ private Map<String, UDDIClerk> readClerkConfig(Configuration config, Map<String, UDDINode> uddiNodes)
+ throws ConfigurationException {
+ clientName = config.getString("client[@name]");
+ clientCallbackUrl = config.getString("client[@callbackUrl]");
+ Map<String, UDDIClerk> clerks = new HashMap<String, UDDIClerk>();
+ if (config.containsKey("client.clerks.clerk[@name]")) {
+ String[] names = config.getStringArray("client.clerks.clerk[@name]");
+
+ log.debug("clerk names=" + names.length);
+ for (int i = 0; i < names.length; i++) {
+ UDDIClerk uddiClerk = new UDDIClerk();
+ uddiClerk.setManagerName(clientName);
+ uddiClerk.setName(config.getString("client.clerks.clerk(" + i + ")[@name]"));
+ String nodeRef = config.getString("client.clerks.clerk(" + i + ")[@node]");
+ if (!uddiNodes.containsKey(nodeRef)) {
+ throw new ConfigurationException("Could not find Node with name=" + nodeRef);
+ }
+ UDDINode uddiNode = uddiNodes.get(nodeRef);
+ uddiClerk.setUDDINode(uddiNode);
+ uddiClerk.setPublisher(config.getString("client.clerks.clerk(" + i + ")[@publisher]"));
+ uddiClerk.setPassword(config.getString("client.clerks.clerk(" + i + ")[@password]"));
+ uddiClerk.setIsPasswordEncrypted(config.getBoolean("client.clerks.clerk(" + i + ")[@isPasswordEncrypted]", false));
uddiClerk.setCryptoProvider(config.getString("client.clerks.clerk(" + i + ")[@cryptoProvider]"));
-
- String clerkBusinessKey = config.getString("client.clerks.clerk(" + i + ")[@businessKey]");
- String clerkBusinessName = config.getString("client.clerks.clerk(" + i + ")[@businessName]");
- String clerkKeyDomain = config.getString("client.clerks.clerk(" + i + ")[@keyDomain]");
-
- String[] classes = config.getStringArray("client.clerks.clerk(" + i + ").class");
- uddiClerk.setClassWithAnnotations(classes);
-
- int numberOfWslds = config.getStringArray("client.clerks.clerk(" + i + ").wsdl").length;
- if (numberOfWslds > 0) {
- UDDIClerk.WSDL[] wsdls = new UDDIClerk.WSDL[numberOfWslds];
- for (int w=0; w<wsdls.length; w++) {
- UDDIClerk.WSDL wsdl = uddiClerk.new WSDL();
- String fileName = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")");
- wsdl.setFileName(fileName);
- String businessKey = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")[@businessKey]");
- String businessName = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")[@businessName]");
- String keyDomain = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")[@keyDomain]");
- if (businessKey==null) businessKey = clerkBusinessKey;
- if (businessKey==null) businessKey = uddiClerk.getUDDINode().getProperties().getProperty("businessKey");
- if (businessKey==null) {
- //use key convention to build the businessKey
- if (businessName==null) businessName = clerkBusinessName;
- if (keyDomain==null) keyDomain = clerkKeyDomain;
- if (keyDomain==null) keyDomain = uddiClerk.getUDDINode().getProperties().getProperty("keyDomain");
- if ((businessName==null && ! uddiClerk.getUDDINode().getProperties().containsKey("businessName"))
- || keyDomain==null && ! uddiClerk.getUDDINode().getProperties().containsKey("keyDomain")) throw new ConfigurationException("Either the wsdl(" + wsdls[w]
- + ") or clerk (" + uddiClerk.name + ") elements require a businessKey, or businessName & keyDomain attributes");
- else {
- Properties properties = new Properties(uddiClerk.getUDDINode().getProperties());
- if (businessName!=null) properties.put("businessName", businessName);
- if (keyDomain!=null) properties.put("keyDomain", keyDomain);
- businessKey = UDDIKeyConvention.getBusinessKey(properties);
- }
- }
- if (! businessKey.toLowerCase().startsWith("uddi:") || ! businessKey.substring(5).contains(":")) {
- throw new ConfigurationException("The businessKey " + businessKey + " does not implement a valid UDDI v3 key format.");
- }
- wsdl.setBusinessKey(businessKey);
- if (keyDomain==null) {
- keyDomain = businessKey.split(":")[1];
- }
- wsdl.setKeyDomain(keyDomain);
- wsdls[w]=wsdl;
- }
- uddiClerk.setWsdls(wsdls);
- }
-
- clerks.put(names[i],uddiClerk);
- }
- }
- return clerks;
- }
-
+
+ String clerkBusinessKey = config.getString("client.clerks.clerk(" + i + ")[@businessKey]");
+ String clerkBusinessName = config.getString("client.clerks.clerk(" + i + ")[@businessName]");
+ String clerkKeyDomain = config.getString("client.clerks.clerk(" + i + ")[@keyDomain]");
+
+ String[] classes = config.getStringArray("client.clerks.clerk(" + i + ").class");
+ uddiClerk.setClassWithAnnotations(classes);
+
+ int numberOfWslds = config.getStringArray("client.clerks.clerk(" + i + ").wsdl").length;
+ if (numberOfWslds > 0) {
+ UDDIClerk.WSDL[] wsdls = new UDDIClerk.WSDL[numberOfWslds];
+ for (int w = 0; w < wsdls.length; w++) {
+ UDDIClerk.WSDL wsdl = uddiClerk.new WSDL();
+ String fileName = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")");
+ wsdl.setFileName(fileName);
+ String businessKey = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")[@businessKey]");
+ String businessName = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")[@businessName]");
+ String keyDomain = config.getString("client.clerks.clerk(" + i + ").wsdl(" + w + ")[@keyDomain]");
+ if (businessKey == null) {
+ businessKey = clerkBusinessKey;
+ }
+ if (businessKey == null) {
+ businessKey = uddiClerk.getUDDINode().getProperties().getProperty("businessKey");
+ }
+ if (businessKey == null) {
+ //use key convention to build the businessKey
+ if (businessName == null) {
+ businessName = clerkBusinessName;
+ }
+ if (keyDomain == null) {
+ keyDomain = clerkKeyDomain;
+ }
+ if (keyDomain == null) {
+ keyDomain = uddiClerk.getUDDINode().getProperties().getProperty("keyDomain");
+ }
+ if ((businessName == null && !uddiClerk.getUDDINode().getProperties().containsKey("businessName"))
+ || keyDomain == null && !uddiClerk.getUDDINode().getProperties().containsKey("keyDomain")) {
+ throw new ConfigurationException("Either the wsdl(" + wsdls[w]
+ + ") or clerk (" + uddiClerk.name + ") elements require a businessKey, or businessName & keyDomain attributes");
+ } else {
+ Properties properties = new Properties(uddiClerk.getUDDINode().getProperties());
+ if (businessName != null) {
+ properties.put("businessName", businessName);
+ }
+ if (keyDomain != null) {
+ properties.put("keyDomain", keyDomain);
+ }
+ businessKey = UDDIKeyConvention.getBusinessKey(properties);
+ }
+ }
+ if (!businessKey.toLowerCase().startsWith("uddi:") || !businessKey.substring(5).contains(":")) {
+ throw new ConfigurationException("The businessKey " + businessKey + " does not implement a valid UDDI v3 key format.");
+ }
+ wsdl.setBusinessKey(businessKey);
+ if (keyDomain == null) {
+ keyDomain = businessKey.split(":")[1];
+ }
+ wsdl.setKeyDomain(keyDomain);
+ wsdls[w] = wsdl;
+ }
+ uddiClerk.setWsdls(wsdls);
+ }
+
+ clerks.put(names[i], uddiClerk);
+ }
+ }
+ return clerks;
+ }
+
/**
- * signals that the specified classes/wsdls are registered with the UDDI server
- * when UDDIClient.start() is called
+ * signals that the specified classes/wsdls are registered with the UDDI
+ * server when UDDIClient.start() is called
* client.clerks[@registerOnStartup]
+ *
* @return true/false
*/
- public boolean isRegisterOnStartup() {
- boolean isRegisterOnStartup = false;
- if (config.containsKey("client.clerks[@registerOnStartup]")) {
- isRegisterOnStartup = config.getBoolean("client.clerks[@registerOnStartup]");
- }
- return isRegisterOnStartup;
- }
-
- private Map<String,UDDINode> readNodeConfig(Configuration config, Properties properties)
- throws ConfigurationException {
- String[] names = config.getStringArray("client.nodes.node.name");
- Map<String,UDDINode> nodes = new HashMap<String,UDDINode>();
- log.debug("node names=" + names.length);
- for (int i=0; i<names.length; i++) {
- UDDINode uddiNode = new UDDINode();
- String nodeName = config.getString("client.nodes.node(" + i +").name");
- String[] propertyKeys = config.getStringArray("client.nodes.node(" + i +").properties.property[@name]");
-
- if (propertyKeys!=null && propertyKeys.length>0) {
- if (properties==null) properties = new Properties();
- for (int p=0; p<propertyKeys.length; p++) {
- String name=config.getString("client.nodes.node(" + i +").properties.property(" + p + ")[@name]");
- String value=config.getString("client.nodes.node(" + i +").properties.property(" + p + ")[@value]");
- log.debug("Property: name=" + name + " value=" + value);
- properties.put(name, value);
- }
- uddiNode.setProperties(properties);
- }
-
- uddiNode.setHomeJUDDI( config.getBoolean("client.nodes.node(" + i +")[@isHomeJUDDI]",false));
- uddiNode.setName( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").name"),properties));
- uddiNode.setClientName( TokenResolver.replaceTokens(config.getString("client[@name]"),properties));
- uddiNode.setDescription( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").description"),properties));
- uddiNode.setProxyTransport( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").proxyTransport"),properties));
- uddiNode.setInquiryUrl( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").inquiryUrl"),properties));
- uddiNode.setInquiryRESTUrl( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").inquiryRESTUrl"),properties));
- uddiNode.setPublishUrl( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").publishUrl"),properties));
- uddiNode.setCustodyTransferUrl( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").custodyTransferUrl"),properties));
- uddiNode.setSecurityUrl( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").securityUrl"),properties));
- uddiNode.setReplicationUrl( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").replicationUrl"),properties));
- uddiNode.setSubscriptionUrl( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").subscriptionUrl"),properties));
- uddiNode.setSubscriptionListenerUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").subscriptionListenerUrl"),properties));
- uddiNode.setJuddiApiUrl( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").juddiApiUrl"),properties));
- uddiNode.setFactoryInitial( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").javaNamingFactoryInitial"),properties));
- uddiNode.setFactoryURLPkgs( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").javaNamingFactoryUrlPkgs"),properties));
- uddiNode.setFactoryNamingProvider( TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i +").javaNamingProviderUrl"),properties));
- nodes.put(nodeName,uddiNode);
- }
- return nodes;
- }
-
- private Set<XRegistration> readXBusinessRegConfig(Configuration config, Map<String,UDDIClerk> clerks)
- throws ConfigurationException {
- return readXRegConfig(config, clerks, "business");
- }
-
- private Set<XRegistration> readXServiceBindingRegConfig(Configuration config, Map<String,UDDIClerk> clerks)
- throws ConfigurationException {
- return readXRegConfig(config, clerks, "servicebinding");
- }
-
- private Set<XRegistration> readXRegConfig(Configuration config, Map<String,UDDIClerk> clerks, String entityType)
- throws ConfigurationException {
- String[] entityKeys = config.getStringArray("client.clerks.xregister." + entityType + "[@entityKey]");
- Set<XRegistration> xRegistrations = new HashSet<XRegistration>();
- if (entityKeys.length > 0) log.info("XRegistration " + entityKeys.length + " " + entityType + "Keys");
- for (int i=0; i<entityKeys.length; i++) {
- XRegistration xRegistration = new XRegistration();
- xRegistration.setEntityKey(config.getString("client.clerks.xregister." + entityType + "(" + i + ")[@entityKey]"));
-
- String fromClerkRef = config.getString("client.clerks.xregister." + entityType + "(" + i + ")[@fromClerk]");
- if (!clerks.containsKey(fromClerkRef)) throw new ConfigurationException("Could not find fromClerk with name=" + fromClerkRef);
- UDDIClerk fromClerk = clerks.get(fromClerkRef);
- xRegistration.setFromClerk(fromClerk);
-
- String toClerkRef = config.getString("client.clerks.xregister." + entityType + "(" + i + ")[@toClerk]");
- if (!clerks.containsKey(toClerkRef)) throw new ConfigurationException("Could not find toClerk with name=" + toClerkRef);
- UDDIClerk toClerk = clerks.get(toClerkRef);
- xRegistration.setToClerk(toClerk);
- log.debug(xRegistration);
-
- xRegistrations.add(xRegistration);
- }
- return xRegistrations;
- }
-
- protected Map<String, UDDINode> getUDDINodes() {
- return uddiNodes;
- }
+ public boolean isRegisterOnStartup() {
+ boolean isRegisterOnStartup = false;
+ if (config.containsKey("client.clerks[@registerOnStartup]")) {
+ isRegisterOnStartup = config.getBoolean("client.clerks[@registerOnStartup]");
+ }
+ return isRegisterOnStartup;
+ }
+
+ private Map<String, UDDINode> readNodeConfig(Configuration config, Properties properties)
+ throws ConfigurationException {
+ String[] names = config.getStringArray("client.nodes.node.name");
+ Map<String, UDDINode> nodes = new HashMap<String, UDDINode>();
+ log.debug("node names=" + names.length);
+ for (int i = 0; i < names.length; i++) {
+ UDDINode uddiNode = new UDDINode();
+ String nodeName = config.getString("client.nodes.node(" + i + ").name");
+ String[] propertyKeys = config.getStringArray("client.nodes.node(" + i + ").properties.property[@name]");
+
+ if (propertyKeys != null && propertyKeys.length > 0) {
+ if (properties == null) {
+ properties = new Properties();
+ }
+ for (int p = 0; p < propertyKeys.length; p++) {
+ String name = config.getString("client.nodes.node(" + i + ").properties.property(" + p + ")[@name]");
+ String value = config.getString("client.nodes.node(" + i + ").properties.property(" + p + ")[@value]");
+ log.debug("Property: name=" + name + " value=" + value);
+ properties.put(name, value);
+ }
+ uddiNode.setProperties(properties);
+ }
+
+ uddiNode.setHomeJUDDI(config.getBoolean("client.nodes.node(" + i + ")[@isHomeJUDDI]", false));
+ uddiNode.setName(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").name"), properties));
+ uddiNode.setClientName(TokenResolver.replaceTokens(config.getString("client[@name]"), properties));
+ uddiNode.setDescription(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").description"), properties));
+ uddiNode.setProxyTransport(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").proxyTransport"), properties));
+ uddiNode.setInquiryUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").inquiryUrl"), properties));
+ uddiNode.setInquiryRESTUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").inquiryRESTUrl"), properties));
+ uddiNode.setPublishUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").publishUrl"), properties));
+ uddiNode.setCustodyTransferUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").custodyTransferUrl"), properties));
+ uddiNode.setSecurityUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").securityUrl"), properties));
+ uddiNode.setReplicationUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").replicationUrl"), properties));
+ uddiNode.setSubscriptionUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").subscriptionUrl"), properties));
+ uddiNode.setSubscriptionListenerUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").subscriptionListenerUrl"), properties));
+ uddiNode.setJuddiApiUrl(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").juddiApiUrl"), properties));
+ uddiNode.setFactoryInitial(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").javaNamingFactoryInitial"), properties));
+ uddiNode.setFactoryURLPkgs(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").javaNamingFactoryUrlPkgs"), properties));
+ uddiNode.setFactoryNamingProvider(TokenResolver.replaceTokens(config.getString("client.nodes.node(" + i + ").javaNamingProviderUrl"), properties));
+ nodes.put(nodeName, uddiNode);
+ }
+ return nodes;
+ }
+
+ private Set<XRegistration> readXBusinessRegConfig(Configuration config, Map<String, UDDIClerk> clerks)
+ throws ConfigurationException {
+ return readXRegConfig(config, clerks, "business");
+ }
+
+ private Set<XRegistration> readXServiceBindingRegConfig(Configuration config, Map<String, UDDIClerk> clerks)
+ throws ConfigurationException {
+ return readXRegConfig(config, clerks, "servicebinding");
+ }
+
+ private Set<XRegistration> readXRegConfig(Configuration config, Map<String, UDDIClerk> clerks, String entityType)
+ throws ConfigurationException {
+ String[] entityKeys = config.getStringArray("client.clerks.xregister." + entityType + "[@entityKey]");
+ Set<XRegistration> xRegistrations = new HashSet<XRegistration>();
+ if (entityKeys.length > 0) {
+ log.info("XRegistration " + entityKeys.length + " " + entityType + "Keys");
+ }
+ for (int i = 0; i < entityKeys.length; i++) {
+ XRegistration xRegistration = new XRegistration();
+ xRegistration.setEntityKey(config.getString("client.clerks.xregister." + entityType + "(" + i + ")[@entityKey]"));
+
+ String fromClerkRef = config.getString("client.clerks.xregister." + entityType + "(" + i + ")[@fromClerk]");
+ if (!clerks.containsKey(fromClerkRef)) {
+ throw new ConfigurationException("Could not find fromClerk with name=" + fromClerkRef);
+ }
+ UDDIClerk fromClerk = clerks.get(fromClerkRef);
+ xRegistration.setFromClerk(fromClerk);
+
+ String toClerkRef = config.getString("client.clerks.xregister." + entityType + "(" + i + ")[@toClerk]");
+ if (!clerks.containsKey(toClerkRef)) {
+ throw new ConfigurationException("Could not find toClerk with name=" + toClerkRef);
+ }
+ UDDIClerk toClerk = clerks.get(toClerkRef);
+ xRegistration.setToClerk(toClerk);
+ log.debug(xRegistration);
+
+ xRegistrations.add(xRegistration);
+ }
+ return xRegistrations;
+ }
+
+ protected Map<String, UDDINode> getUDDINodes() {
+ return uddiNodes;
+ }
/**
- * gets the current configuration's node list
- * only the node name, client name, descriptions and transport class are returned, everything else is nulled out for
- * security reasons. Only a copy of these values are returned
+ * gets the current configuration's node list Only a copy of these
+ * values are returned
+ *
* @return a list of nodes representing the config file as described
+ * @since 3.3 updated to return all fields
+ * @since 3.2
*/
- public List<Node> getUDDINodeList(){
+ public List<Node> getUDDINodeList() {
List<Node> ret = new ArrayList<Node>();
Iterator<UDDINode> it = uddiNodes.values().iterator();
- while (it.hasNext()){
+ while (it.hasNext()) {
UDDINode next = it.next();
Node n = new Node();
n.setClientName(next.getClientName());
n.setDescription(next.getDescription());
n.setName(next.getName());
n.setProxyTransport(next.getProxyTransport());
+ n.setCustodyTransferUrl(next.getCustodyTransferUrl());
+ n.setFactoryInitial(next.getFactoryInitial());
+ n.setFactoryNamingProvider(next.getFactoryNamingProvider());
+ n.setFactoryURLPkgs(next.getFactoryURLPkgs());
+ n.setInquiryUrl(next.getInquiryUrl());
+ n.setJuddiApiUrl(next.getJuddiApiUrl());
+ n.setPublishUrl(next.getPublishUrl());
+ n.setReplicationUrl(next.getReplicationUrl());
+ n.setSecurityUrl(next.getSecurityUrl());
+ n.setSubscriptionListenerUrl(next.getSubscriptionListenerUrl());
+ n.setSubscriptionUrl(next.getSubscriptionUrl());
ret.add(n);
}
return ret;
}
-
- public UDDINode getHomeNode() throws ConfigurationException {
- if (uddiNodes==null) throw new ConfigurationException("The juddi client configuration " +
- "must contain at least one node element.");
- if (uddiNodes.values().size()==1) return uddiNodes.values().iterator().next();
- for (UDDINode uddiNode : uddiNodes.values()) {
- if (uddiNode.isHomeJUDDI()) {
- return uddiNode;
- }
- }
- throw new ConfigurationException("One of the node elements in the client configuration needs to a 'isHomeJUDDI=\"true\"' attribute.");
- }
-
- public UDDINode getUDDINode(String nodeName) throws ConfigurationException {
- if (! uddiNodes.containsKey(nodeName)) {
- throw new ConfigurationException("Node '" + nodeName
- + "' cannot be found in the config '"+ getClientName() + "'" );
- }
- return uddiNodes.get(nodeName);
- }
-
- public Map<String,UDDIClerk> getUDDIClerks() {
- return uddiClerks;
- }
-
- public Set<XRegistration> getXServiceBindingRegistrations() {
- return xServiceBindingRegistrations;
- }
-
- public Set<XRegistration> getXBusinessRegistrations() {
- return xBusinessRegistrations;
- }
-
+
+ public UDDINode getHomeNode() throws ConfigurationException {
+ if (uddiNodes == null) {
+ throw new ConfigurationException("The juddi client configuration "
+ + "must contain at least one node element.");
+ }
+ if (uddiNodes.values().size() == 1) {
+ return uddiNodes.values().iterator().next();
+ }
+ UDDINode ret=null;
+ for (UDDINode uddiNode : uddiNodes.values()) {
+ if (uddiNode.isHomeJUDDI()) {
+ if (ret!=null){
+ throw new ConfigurationException("Only one of the node elements in the client configuration needs to a 'isHomeJUDDI=\"true\"' attribute.");
+ }
+ ret= uddiNode;
+ }
+ }
+ throw new ConfigurationException("One of the node elements in the client configuration needs to a 'isHomeJUDDI=\"true\"' attribute.");
+ }
+
+ public UDDINode getUDDINode(String nodeName) throws ConfigurationException {
+ if (!uddiNodes.containsKey(nodeName)) {
+ throw new ConfigurationException("Node '" + nodeName
+ + "' cannot be found in the config '" + getClientName() + "'");
+ }
+ return uddiNodes.get(nodeName);
+ }
+
+ public Map<String, UDDIClerk> getUDDIClerks() {
+ return uddiClerks;
+ }
+
+ public Set<XRegistration> getXServiceBindingRegistrations() {
+ return xServiceBindingRegistrations;
+ }
+
+ public Set<XRegistration> getXBusinessRegistrations() {
+ return xBusinessRegistrations;
+ }
+
public Configuration getConfiguration() {
- return config;
+ return config;
}
public String getClientName() {
- return clientName;
+ return clientName;
}
-
+
@Deprecated
public String getClientCallbackUrl() {
- return clientCallbackUrl;
+ return clientCallbackUrl;
}
-
public String getConfigurationFile() {
- return configurationFile;
+ return configurationFile;
}
-
+
/**
* Used for WADL/WSDL to WSDL
+ *
* @return true/false
*/
- public boolean isX_To_Wsdl_Ignore_SSL_Errors()
- {
- return this.config.getBoolean("client.XtoWsdl.IgnoreSSLErrors", false);
+ public boolean isX_To_Wsdl_Ignore_SSL_Errors() {
+ return this.config.getBoolean("client.XtoWsdl.IgnoreSSLErrors", false);
}
-
-
/**
- * Fetches all digital signature related properties for the digital signature utility.
- * warning, this will decrypt all passwords
+ * Fetches all digital signature related properties for the digital
+ * signature utility. warning, this will decrypt all passwords
+ *
* @return a properties object
- * @throws Exception
+ * @throws Exception
* @see DigSigUtil
* @see Properties
*/
- public Properties getDigitalSignatureConfiguration() throws Exception {
- Properties p = new Properties();
- p.setProperty(DigSigUtil.CANONICALIZATIONMETHOD, this.config.getString("client.signature.canonicalizationMethod", CanonicalizationMethod.EXCLUSIVE));
- p.setProperty(DigSigUtil.CHECK_TIMESTAMPS, ((Boolean) (this.config.getBoolean("client.signature.checkTimestamps", true))).toString());
- p.setProperty(DigSigUtil.CHECK_REVOCATION_STATUS_CRL, ((Boolean) (this.config.getBoolean("client.signature.checkRevocationCRL", true))).toString());
- p.setProperty(DigSigUtil.CHECK_REVOCATION_STATUS_OCSP, ((Boolean) (this.config.getBoolean("client.signature.checkRevocationOCSP", true))).toString());
- p.setProperty(DigSigUtil.CHECK_TRUST_CHAIN, ((Boolean) (this.config.getBoolean("client.signature.checkTrust", true))).toString());
-
- p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE, this.config.getString("client.signature.signingKeyStorePath",""));
- p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILETYPE, this.config.getString("client.signature.signingKeyStoreType",""));
-
- if (this.config.getBoolean("client.signature.signingKeyPassword[@isPasswordEncrypted]", false)) {
- String enc = this.config.getString("client.signature.signingKeyPassword","");
- String prov = this.config.getString("client.signature.signingKeyPassword[@cryptoProvider]","");
- p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD, CryptorFactory.getCryptor(prov).decrypt(enc));
- } else {
- log.warn("Hey, you should consider encrypting your key password!");
- p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD, this.config.getString("client.signature.signingKeyPassword",""));
- }
- if (this.config.getBoolean("client.signature.signingKeyStoreFilePassword[@isPasswordEncrypted]", false)) {
- String enc = this.config.getString("client.signature.signingKeyStoreFilePassword","");
- String prov = this.config.getString("client.signature.signingKeyStoreFilePassword[@cryptoProvider]","");
- p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD, CryptorFactory.getCryptor(prov).decrypt(enc));
- } else {
- log.warn("Hey, you should consider encrypting your keystore password!");
- p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD, this.config.getString("client.signature.signingKeyStoreFilePassword",""));
- }
-
- p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_ALIAS, this.config.getString("client.signature.signingKeyAlias",""));
- p.setProperty(DigSigUtil.SIGNATURE_METHOD, this.config.getString("client.signature.signatureMethod", "http://www.w3.org/2000/09/xmldsig#rsa-sha1"));
- p.setProperty(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN, this.config.getString("client.signature.keyInfoInclusionSubjectDN","true"));
- p.setProperty(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64, this.config.getString("client.signature.keyInfoInclusionBase64PublicKey","true"));
- p.setProperty(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SERIAL, this.config.getString("client.signature.keyInfoInclusionSerial","true"));
-
- p.setProperty(DigSigUtil.SIGNATURE_OPTION_DIGEST_METHOD, this.config.getString("client.signature.digestMethod", "http://www.w3.org/2000/09/xmldsig#sha1"));
-
- p.setProperty(DigSigUtil.TRUSTSTORE_FILE, this.config.getString("client.signature.trustStorePath",""));
- p.setProperty(DigSigUtil.TRUSTSTORE_FILETYPE, this.config.getString("client.signature.trustStoreType",""));
-
-
- if (this.config.getBoolean("client.signature.trustStorePassword[@isPasswordEncrypted]", false)) {
- String enc = this.config.getString("client.signature.trustStorePassword","");
- String prov = this.config.getString("client.signature.trustStorePassword[@cryptoProvider]","");
- p.setProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD, CryptorFactory.getCryptor(prov).decrypt(enc));
- } else {
- log.warn("Hey, you should consider encrypting your trust store password!");
- p.setProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD, this.config.getString("client.signature.trustStorePassword",""));
- }
-
- return p;
- }
-}
\ No newline at end of file
+ public Properties getDigitalSignatureConfiguration() throws Exception {
+ Properties p = new Properties();
+ p.setProperty(DigSigUtil.CANONICALIZATIONMETHOD, this.config.getString("client.signature.canonicalizationMethod", CanonicalizationMethod.EXCLUSIVE));
+ p.setProperty(DigSigUtil.CHECK_TIMESTAMPS, ((Boolean) (this.config.getBoolean("client.signature.checkTimestamps", true))).toString());
+ p.setProperty(DigSigUtil.CHECK_REVOCATION_STATUS_CRL, ((Boolean) (this.config.getBoolean("client.signature.checkRevocationCRL", true))).toString());
+ p.setProperty(DigSigUtil.CHECK_REVOCATION_STATUS_OCSP, ((Boolean) (this.config.getBoolean("client.signature.checkRevocationOCSP", true))).toString());
+ p.setProperty(DigSigUtil.CHECK_TRUST_CHAIN, ((Boolean) (this.config.getBoolean("client.signature.checkTrust", true))).toString());
+
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE, this.config.getString("client.signature.signingKeyStorePath", ""));
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILETYPE, this.config.getString("client.signature.signingKeyStoreType", ""));
+
+ if (this.config.getBoolean("client.signature.signingKeyPassword[@isPasswordEncrypted]", false)) {
+ String enc = this.config.getString("client.signature.signingKeyPassword", "");
+ String prov = this.config.getString("client.signature.signingKeyPassword[@cryptoProvider]", "");
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD, CryptorFactory.getCryptor(prov).decrypt(enc));
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC, "true");
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_PROVIDER, prov);
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_CIPHER, enc);
+ } else {
+ log.warn("Hey, you should consider encrypting your key password!");
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD, this.config.getString("client.signature.signingKeyPassword", ""));
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC, "false");
+ }
+ if (this.config.getBoolean("client.signature.signingKeyStoreFilePassword[@isPasswordEncrypted]", false)) {
+ String enc = this.config.getString("client.signature.signingKeyStoreFilePassword", "");
+ String prov = this.config.getString("client.signature.signingKeyStoreFilePassword[@cryptoProvider]", "");
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD, CryptorFactory.getCryptor(prov).decrypt(enc));
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_PROVIDER, (prov));
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_CIPHER, (enc));
+ } else {
+ log.warn("Hey, you should consider encrypting your keystore password!");
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD, this.config.getString("client.signature.signingKeyStoreFilePassword", ""));
+ }
+
+ p.setProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_ALIAS, this.config.getString("client.signature.signingKeyAlias", ""));
+ p.setProperty(DigSigUtil.SIGNATURE_METHOD, this.config.getString("client.signature.signatureMethod", "http://www.w3.org/2000/09/xmldsig#rsa-sha1"));
+ p.setProperty(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN, this.config.getString("client.signature.keyInfoInclusionSubjectDN", "true"));
+ p.setProperty(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64, this.config.getString("client.signature.keyInfoInclusionBase64PublicKey", "true"));
+ p.setProperty(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SERIAL, this.config.getString("client.signature.keyInfoInclusionSerial", "true"));
+
+ p.setProperty(DigSigUtil.SIGNATURE_OPTION_DIGEST_METHOD, this.config.getString("client.signature.digestMethod", "http://www.w3.org/2000/09/xmldsig#sha1"));
+
+ p.setProperty(DigSigUtil.TRUSTSTORE_FILE, this.config.getString("client.signature.trustStorePath", ""));
+ p.setProperty(DigSigUtil.TRUSTSTORE_FILETYPE, this.config.getString("client.signature.trustStoreType", ""));
+
+ if (this.config.getBoolean("client.signature.trustStorePassword[@isPasswordEncrypted]", false)) {
+ String enc = this.config.getString("client.signature.trustStorePassword", "");
+ String prov = this.config.getString("client.signature.trustStorePassword[@cryptoProvider]", "");
+ p.setProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD, CryptorFactory.getCryptor(prov).decrypt(enc));
+ p.setProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_PROVIDER, (prov));
+ p.setProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_CIPHER, (enc));
+ } else {
+ log.warn("Hey, you should consider encrypting your trust store password!");
+ p.setProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD, this.config.getString("client.signature.trustStorePassword", ""));
+ }
+
+ return p;
+ }
+
+ /**
+ * adds a new node to the client configuration section. Don't forget to
+ * call save to persist the changes
+ *
+ * @param n
+ * @since 3.3
+ */
+ public void addUDDINode(UDDINode node) throws ConfigurationException {
+ if (node == null) {
+ throw new ConfigurationException("The new node is null");
+ }
+ if (this.uddiNodes.containsKey(node.getName())) {
+ throw new ConfigurationException("Node '" + node.getName() + "' already existings in the collection!");
+ }
+ if (node.getClientName() == null || "".equalsIgnoreCase(node.getClientName())) {
+ log.info("ClientName wasn't specified, I'll configure it with the defaults");
+ node.setClientName(this.clientName);
+ }
+ this.uddiNodes.put(node.getClientName(), node);
+
+
+ }
+
+ /**
+ * removes the named node from the client configuration section. don't
+ * forget to save to persist the changes
+ *
+ * @param name expecting the Node name, not the "clientName"
+ * @throws ConfigurationException
+ */
+ public void removeUDDINode(String name) throws ConfigurationException {
+ if (this.uddiNodes.containsKey(name)) {
+ this.uddiNodes.remove(name);
+ }
+
+ //TODO to configuration xml structure
+ }
+
+ /**
+ * performs some basic validation tests on the config setting that was
+ * read from file
+ */
+ private void validateConfig() throws ConfigurationException {
+ if (config == null) {
+ throw new ConfigurationException("config is null!");
+ }
+ if (uddiNodes == null) {
+ throw new ConfigurationException("nodes is null!");
+ }
+ if (uddiClerks == null) {
+ throw new ConfigurationException("clerks is null!");
+ }
+ Iterator<Map.Entry<String, UDDIClerk>> it = uddiClerks.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, UDDIClerk> next = it.next();
+ if (next.getValue().uddiNode == null) {
+ throw new ConfigurationException("clerk " + next.getValue().name + " references a node that doesn't exist!");
+ }
+ }
+ }
+
+ private void addCurrentNodeConfig(Configuration cc) {
+
+ cc.addProperty("client(0)[@name]",clientName);
+ Iterator<Map.Entry<String, UDDINode>> iterator = uddiNodes.entrySet().iterator();
+ int i = 0;
+ while (iterator.hasNext()) {
+ log.debug("node names=" + uddiNodes.size());
+
+ UDDINode uddiNode = iterator.next().getValue();
+
+ Properties properties = uddiNode.getProperties();
+
+ if (properties == null) {
+ properties = new Properties();
+ }
+ Iterator<Map.Entry<Object, Object>> iterator1 = properties.entrySet().iterator();
+ int x = 0;
+ while (iterator1.hasNext()) {
+ Map.Entry<Object, Object> next = iterator1.next();
+ cc.addProperty("client(0).nodes.node(" + i + ").properties.property(" + x + ")[@name]", next.getKey());
+ cc.addProperty("client(0).nodes.node(" + i + ").properties.property(" + x + ")[@value]", next.getValue());
+
+ log.debug("Property: name=" + next.getKey() + " value=" + next.getValue());
+
+ x++;
+ }
+
+
+ cc.addProperty("client(0).nodes.node(" + i + ")[@isHomeJUDDI]", uddiNode.isHomeJUDDI());
+ cc.addProperty("client(0).nodes.node(" + i + ").name", uddiNode.getName());
+ cc.addProperty("client(0).nodes.node(" + i + ").description", uddiNode.getDescription());
+ cc.addProperty("client(0).nodes.node(" + i + ").proxyTransport", uddiNode.getProxyTransport());
+ cc.addProperty("client(0).nodes.node(" + i + ").inquiryUrl", uddiNode.getInquiryUrl());
+ cc.addProperty("client(0).nodes.node(" + i + ").inquiryRESTUrl", uddiNode.getInquiry_REST_Url());
+ cc.addProperty("client(0).nodes.node(" + i + ").publishUrl", uddiNode.getPublishUrl());
+ cc.addProperty("client(0).nodes.node(" + i + ").custodyTransferUrl", uddiNode.getCustodyTransferUrl());
+ cc.addProperty("client(0).nodes.node(" + i + ").securityUrl", uddiNode.getSecurityUrl());
+ cc.addProperty("client(0).nodes.node(" + i + ").replicationUrl", uddiNode.getReplicationUrl());
+ cc.addProperty("client(0).nodes.node(" + i + ").subscriptionUrl", uddiNode.getSubscriptionUrl());
+ cc.addProperty("client(0).nodes.node(" + i + ").juddiApiUrl", uddiNode.getJuddiApiUrl());
+ cc.addProperty("client(0).nodes.node(" + i + ").subscriptionListenerUrl", uddiNode.getSubscriptionListenerUrl());
+ cc.addProperty("client(0).nodes.node(" + i + ").javaNamingFactoryInitial", uddiNode.getFactoryInitial());
+ cc.addProperty("client(0).nodes.node(" + i + ").javaNamingFactoryUrlPkgs", uddiNode.getFactoryURLPkgs());
+ cc.addProperty("client(0).nodes.node(" + i + ").javaNamingProviderUrl", uddiNode.getFactoryNamingProvider());
+
+ i++;
+ }
+
+ }
+
+ private void addCurrentClerks(Configuration cc) {
+
+ Iterator<Map.Entry<String, UDDIClerk>> iterator = uddiClerks.entrySet().iterator();
+ clientName = config.getString("client[@name]");
+ clientCallbackUrl = config.getString("client(0)[@callbackUrl]");
+
+ cc.addProperty("client(0).clerks[@registerOnStartup", isRegisterOnStartup()) ;
+ int i = 0;
+ while (iterator.hasNext()) {
+
+ UDDIClerk uddiClerk = iterator.next().getValue();
+ cc.addProperty("client(0).clerks.clerk(" + i + ")[@name]", uddiClerk.getName());
+ //registerOnStartup
+ cc.addProperty("client(0).clerks.clerk(" + i + ")[@node]", uddiClerk.getUDDINode().getName());
+
+ cc.addProperty("client(0).clerks.clerk(" + i + ")[@publisher]", uddiClerk.getPublisher());
+ cc.addProperty("client(0).clerks.clerk(" + i + ")[@password]", uddiClerk.getRawPassword());
+
+ cc.addProperty("client(0).clerks.clerk(" + i + ")[@isPasswordEncrypted]", uddiClerk.getIsPasswordEncrypted());
+
+ cc.addProperty("client(0).clerks.clerk(" + i + ")[@cryptoProvider]", uddiClerk.getCryptoProvider());
+
+ String[] classes = uddiClerk.getClassWithAnnotations();
+ if (classes != null) {
+ for (int x = 0; x < classes.length; x++) {
+ cc.addProperty("client(0).clerks.clerk(" + i + ").class(" + x + ")", classes[x]);
+ }
+ }
+
+ UDDIClerk.WSDL[] wsdls = uddiClerk.getWsdls();
+ if (wsdls != null) {
+ for (int w = 0; w < wsdls.length; w++) {
+ cc.addProperty("client(0).clerks.clerk(" + i + ").wsdl(" + w + ")", wsdls[w].getFileName());
+ cc.addProperty("client(0).clerks.clerk(" + i + ").wsdl(" + w + ")[@businessKey]", wsdls[w].getBusinessKey());
+ cc.addProperty("client(0).clerks.clerk(" + i + ").wsdl(" + w + ")[@keyDomain]", wsdls[w].getKeyDomain());
+ }
+ }
+ i++;
+ }
+
+ if (xBusinessRegistrations!=null){
+ Iterator<XRegistration> iterator1 = xBusinessRegistrations.iterator();
+ int x=0;
+ while (iterator1.hasNext()){
+ XRegistration next = iterator1.next();
+ cc.addProperty("client(0).clerks.business("+x+")[@fromClerk]" ,next.getFromClerk().name );
+ cc.addProperty("client(0).clerks.business("+x+")[@toClerk]" ,next.getToClerk().name );
+ cc.addProperty("client(0).clerks.business("+x+")[@entityKey]" ,next.getEntityKey() );
+ x++;
+ }
+ }
+ if (xServiceBindingRegistrations!=null){
+ Iterator<XRegistration> iterator1 = xServiceBindingRegistrations.iterator();
+ int x=0;
+ while (iterator1.hasNext()){
+ XRegistration next = iterator1.next();
+ cc.addProperty("client(0).clerks.servicebinding("+x+")[@fromClerk]" ,next.getFromClerk().name );
+ cc.addProperty("client(0).clerks.servicebinding("+x+")[@toClerk]" ,next.getToClerk().name );
+ cc.addProperty("client(0).clerks.servicebinding("+x+")[@entityKey]" ,next.getEntityKey() );
+ x++;
+ }
+ }
+ }
+
+ private void addSubscriptionCallback(Configuration cc) {
+ if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_AUTOREG_BT)) {
+ cc.addProperty(SubscriptionCallbackListener.PROPERTY_AUTOREG_BT, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_AUTOREG_BT));
+ }
+ if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_AUTOREG_SERVICE_KEY)) {
+ cc.addProperty(SubscriptionCallbackListener.PROPERTY_AUTOREG_SERVICE_KEY, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_AUTOREG_SERVICE_KEY));
+ }
+ if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_KEYDOMAIN)) {
+ cc.addProperty(SubscriptionCallbackListener.PROPERTY_KEYDOMAIN, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_KEYDOMAIN));
+ }
+ if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_LISTENURL)) {
+ cc.addProperty(SubscriptionCallbackListener.PROPERTY_LISTENURL, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_LISTENURL));
+ }
+ if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_NODE)) {
+ cc.addProperty(SubscriptionCallbackListener.PROPERTY_NODE, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_NODE));
+ }
+ if (this.config.containsKey(SubscriptionCallbackListener.PROPERTY_SIGNATURE_BEHAVIOR)) {
+ cc.addProperty(SubscriptionCallbackListener.PROPERTY_SIGNATURE_BEHAVIOR, this.config.getProperty(SubscriptionCallbackListener.PROPERTY_SIGNATURE_BEHAVIOR));
+ }
+ }
+
+ private void addDigitalSubscription(Configuration cc) throws Exception {
+ Properties p = this.getDigitalSignatureConfiguration();
+ Iterator<Map.Entry<Object, Object>> it = p.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<Object, Object> next = it.next();
+ String key = (String) next.getKey();
+ Object val = next.getValue();
+ if (val==null)
+ continue;
+ if (key.equalsIgnoreCase(DigSigUtil.CANONICALIZATIONMETHOD)) {
+ cc.addProperty("client(0).signature.canonicalizationMethod", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.CHECK_TIMESTAMPS)) {
+ cc.addProperty("client(0).signature.checkTimestamps", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.CHECK_REVOCATION_STATUS_CRL)) {
+ cc.addProperty("client(0).signature.checkRevocationCRL", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.CHECK_REVOCATION_STATUS_OCSP)) {
+ cc.addProperty("client(0).signature.checkRevocationOCSP", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.CHECK_TRUST_CHAIN)) {
+ cc.addProperty("client(0).signature.checkTrust", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_FILE)) {
+ cc.addProperty("client(0).signature.signingKeyStorePath", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_FILETYPE)) {
+ cc.addProperty("client(0).signature.signingKeyStoreType", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD)) {
+ cc.addProperty("client(0).signature.signingKeyPassword", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC)) {
+ cc.addProperty("client(0).signature.signingKeyPassword[@isPasswordEncrypted]", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_PROVIDER)) {
+ cc.addProperty("client(0).signature.signingKeyPassword[@cryptoProvider]", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_CIPHER)) {
+ cc.addProperty("client(0).signature.signingKeyPassword", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_KEY_ALIAS)) {
+ cc.addProperty("client(0).signature.signingKeyAlias", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_METHOD)) {
+ cc.addProperty("client(0).signature.signatureMethod", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SUBJECTDN)) {
+ cc.addProperty("client(0).signature.keyInfoInclusionSubjectDN", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_BASE64)) {
+ cc.addProperty("client(0).signature.keyInfoInclusionBase64PublicKey", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_OPTION_CERT_INCLUSION_SERIAL)) {
+ cc.addProperty("client(0).signature.keyInfoInclusionSerial", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_OPTION_DIGEST_METHOD)) {
+ cc.addProperty("client(0).signature.digestMethod", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.TRUSTSTORE_FILE)) {
+ cc.addProperty("client(0).signature.trustStorePath", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.TRUSTSTORE_FILETYPE)) {
+ cc.addProperty("client(0).signature.trustStoreType", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_WASENC)) {
+ cc.addProperty("client(0).signature.signingKeyStoreFilePassword[@isPasswordEncrypted]", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_PROVIDER)) {
+ cc.addProperty("client(0).signature.signingKeyStoreFilePassword[@cryptoProvider]", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_WASENC)) {
+ cc.addProperty("client(0).signature.trustStorePassword[@isPasswordEncrypted]", val);
+ } else if (key.equalsIgnoreCase(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_PROVIDER)) {
+ cc.addProperty("client(0).signature.trustStorePassword[@cryptoProvider]", val);
+ }
+
+ }
+
+
+ if (p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_WASENC, "false").equalsIgnoreCase("true")) {
+ cc.addProperty("client(0).signature.signingKeyStoreFilePassword", p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD_CIPHER));
+ } else {
+ cc.addProperty("client(0).signature.signingKeyStoreFilePassword", p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_FILE_PASSWORD));
+ }
+
+ if (p.getProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_WASENC, "false").equalsIgnoreCase("true")) {
+ cc.addProperty("client(0).signature.trustStorePassword", p.getProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD_CIPHER));
+ } else {
+ cc.addProperty("client(0).signature.trustStorePassword", p.getProperty(DigSigUtil.TRUSTSTORE_FILE_PASSWORD));
+ }
+
+ if (p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC, "false").equalsIgnoreCase("true")) {
+ cc.addProperty("client(0).signature.signingKeyPassword", p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD_CIPHER));
+ } else {
+ cc.addProperty("client(0).signature.signingKeyPassword", p.getProperty(DigSigUtil.SIGNATURE_KEYSTORE_KEY_PASSWORD));
+ }
+
+ }
+
+ private void addXRegistration(Configuration cc) {
+
+ cc.addProperty("client.XtoWsdl.IgnoreSSLErrors", isX_To_Wsdl_Ignore_SSL_Errors());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClient.java
----------------------------------------------------------------------
diff --git a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClient.java b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClient.java
index eaac696..0c9e7d7 100644
--- a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClient.java
+++ b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClient.java
@@ -22,10 +22,10 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
-
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.juddi.api_v3.Node;
import org.apache.juddi.v3.annotations.AnnotationProcessor;
import org.apache.juddi.v3.client.ClassUtil;
import org.apache.juddi.v3.client.Release;
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/DigSigUtil.java
----------------------------------------------------------------------
diff --git a/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/DigSigUtil.java b/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/DigSigUtil.java
index 263a80a..d58bcd7 100644
--- a/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/DigSigUtil.java
+++ b/juddi-client/src/main/java/org/apache/juddi/v3/client/cryptor/DigSigUtil.java
@@ -88,6 +88,16 @@ import sun.security.provider.certpath.OCSP.RevocationStatus;
* @author <a href="mailto:alexoree@apache.org">Alex O'Ree </a>
*/
public class DigSigUtil {
+ public final static String SIGNATURE_KEYSTORE_KEY_PASSWORD_PROVIDER="signatureKeystoreKeyPassENCProvider";
+ public final static String SIGNATURE_KEYSTORE_KEY_PASSWORD_WAS_ENC="signatureKeystoreKeyPassENC";
+ public final static String SIGNATURE_KEYSTORE_KEY_PASSWORD_CIPHER="signatureKeyStoreCipherPass";
+
+ public final static String SIGNATURE_KEYSTORE_FILE_PASSWORD_WASENC="signatureKeystoreFilePassENC";
+ public final static String SIGNATURE_KEYSTORE_FILE_PASSWORD_PROVIDER="signatureKeystoreFileENCProvider";
+ public final static String TRUSTSTORE_FILE_PASSWORD_WASENC="truststoreFilePassENC";
+ public final static String TRUSTSTORE_FILE_PASSWORD_PROVIDER="truststoreFilePassENCProvider";
+ public final static String SIGNATURE_KEYSTORE_FILE_PASSWORD_CIPHER="signatureKeystoreFileKeyPass";
+ public final static String TRUSTSTORE_FILE_PASSWORD_CIPHER="truststoreFilePass";
/**
* Expects a properties object containing the desired configuration
@@ -116,6 +126,9 @@ public class DigSigUtil {
map.clear();
}
private Properties map = new Properties();
+
+
+
/**
* This is the location of the keystore
*
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/test/java/org/apache/juddi/v3/client/config/MisconfigurationTests.java
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/java/org/apache/juddi/v3/client/config/MisconfigurationTests.java b/juddi-client/src/test/java/org/apache/juddi/v3/client/config/MisconfigurationTests.java
deleted file mode 100644
index 5b41f3c..0000000
--- a/juddi-client/src/test/java/org/apache/juddi/v3/client/config/MisconfigurationTests.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2014 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.juddi.v3.client.config;
-
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.juddi.v3.client.transport.Transport;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- *
- * @author Alex O'Ree
- */
-public class MisconfigurationTests {
-
- @Test(expected = ConfigurationException.class)
- public void TestMissingClerk() throws ConfigurationException{
- UDDIClient client = new UDDIClient("META-INF/configtests.xml");
- UDDIClerk clerk = client.getClerk("missingClerk");
- Assert.fail("this should have thrown an exception");
- }
-
- @Test(expected = ConfigurationException.class)
- public void TestMissingTransportClass() throws ConfigurationException{
- UDDIClient client = new UDDIClient("META-INF/configtests.xml");
- UDDIClerk clerk = client.getClerk("missingTransport");
- Transport transport = client.getTransport("missingTransport");
- Assert.fail("this should have thrown an exception");
- }
-}
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/test/resources/META-INF/configtests.xml
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/resources/META-INF/configtests.xml b/juddi-client/src/test/resources/META-INF/configtests.xml
index 6e7dd3a..de58a62 100644
--- a/juddi-client/src/test/resources/META-INF/configtests.xml
+++ b/juddi-client/src/test/resources/META-INF/configtests.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
<reloadDelay>5000</reloadDelay>
<client name="test-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/test/resources/META-INF/subscription.xml
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/resources/META-INF/subscription.xml b/juddi-client/src/test/resources/META-INF/subscription.xml
index 6be8c74..4e8c356 100644
--- a/juddi-client/src/test/resources/META-INF/subscription.xml
+++ b/juddi-client/src/test/resources/META-INF/subscription.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
<reloadDelay>5000</reloadDelay>
<client name="test-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/test/resources/META-INF/uddi-subcallback1.xml
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/resources/META-INF/uddi-subcallback1.xml b/juddi-client/src/test/resources/META-INF/uddi-subcallback1.xml
index 2c72bff..d4d09c5 100644
--- a/juddi-client/src/test/resources/META-INF/uddi-subcallback1.xml
+++ b/juddi-client/src/test/resources/META-INF/uddi-subcallback1.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
<reloadDelay>5000</reloadDelay>
<client name="test-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/test/resources/META-INF/uddi-subcallback2.xml
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/resources/META-INF/uddi-subcallback2.xml b/juddi-client/src/test/resources/META-INF/uddi-subcallback2.xml
index 7664eb5..83709d7 100644
--- a/juddi-client/src/test/resources/META-INF/uddi-subcallback2.xml
+++ b/juddi-client/src/test/resources/META-INF/uddi-subcallback2.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
<reloadDelay>5000</reloadDelay>
<client name="test-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/test/resources/META-INF/uddi-subcallback3.xml
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/resources/META-INF/uddi-subcallback3.xml b/juddi-client/src/test/resources/META-INF/uddi-subcallback3.xml
index a6de1ec..0f8126d 100644
--- a/juddi-client/src/test/resources/META-INF/uddi-subcallback3.xml
+++ b/juddi-client/src/test/resources/META-INF/uddi-subcallback3.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
<reloadDelay>5000</reloadDelay>
<client name="test-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/test/resources/META-INF/uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/resources/META-INF/uddi.xml b/juddi-client/src/test/resources/META-INF/uddi.xml
index b183187..f038891 100644
--- a/juddi-client/src/test/resources/META-INF/uddi.xml
+++ b/juddi-client/src/test/resources/META-INF/uddi.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
<reloadDelay>5000</reloadDelay>
<client name="test-client">
<nodes>
@@ -71,7 +71,7 @@
</clerk>
<clerk name="medroot" node="med" publisher="root" password="root"/>
<xregister>
- <service bindingKey="uddi:juddi.apache.org:servicebindings-subscriptionlistener-ws" fromClerk="default" toClerk="medroot"/>
+ <service entityKey="uddi:juddi.apache.org:servicebindings-subscriptionlistener-ws" fromClerk="default" toClerk="medroot"/>
</xregister>
</clerks>
<signature>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/test/resources/META-INF/uddi2.xml
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/resources/META-INF/uddi2.xml b/juddi-client/src/test/resources/META-INF/uddi2.xml
index bf3f555..84e46fe 100644
--- a/juddi-client/src/test/resources/META-INF/uddi2.xml
+++ b/juddi-client/src/test/resources/META-INF/uddi2.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
<reloadDelay>5000</reloadDelay>
<client name="second-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/test/resources/META-INF/uddi3-enc-aes128.xml
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/resources/META-INF/uddi3-enc-aes128.xml b/juddi-client/src/test/resources/META-INF/uddi3-enc-aes128.xml
index b5320f4..947903a 100644
--- a/juddi-client/src/test/resources/META-INF/uddi3-enc-aes128.xml
+++ b/juddi-client/src/test/resources/META-INF/uddi3-enc-aes128.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
<reloadDelay>5000</reloadDelay>
<client name="second-client">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-client/src/test/resources/META-INF/uddiv2.xml
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/resources/META-INF/uddiv2.xml b/juddi-client/src/test/resources/META-INF/uddiv2.xml
index 85cf260..331f0a8 100644
--- a/juddi-client/src/test/resources/META-INF/uddiv2.xml
+++ b/juddi-client/src/test/resources/META-INF/uddiv2.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- This is how to use the UDDI v2 interfaces from the jUDDI Client-->
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
<reloadDelay>5000</reloadDelay>
<client name="default">
<nodes>
http://git-wip-us.apache.org/repos/asf/juddi/blob/1a894c89/juddi-core-openjpa/src/test/resources/META-INF/uddi.xml
----------------------------------------------------------------------
diff --git a/juddi-core-openjpa/src/test/resources/META-INF/uddi.xml b/juddi-core-openjpa/src/test/resources/META-INF/uddi.xml
index 704bc04..f8a6129 100644
--- a/juddi-core-openjpa/src/test/resources/META-INF/uddi.xml
+++ b/juddi-core-openjpa/src/test/resources/META-INF/uddi.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
-<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
+<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<reloadDelay>5000</reloadDelay>
<client name="juddi-core-unittest-client">
<nodes>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org