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 2013/12/09 01:40:44 UTC
svn commit: r1549363 [4/5] - in /juddi/branches/juddi-3.3.x: ./
juddi-core-openjpa/src/test/resources/
juddi-core/src/main/java/org/apache/juddi/config/
juddi-core/src/main/java/org/apache/juddi/mapping/
juddi-core/src/main/java/org/apache/juddi/valida...
Propchange: juddi/branches/juddi-3.3.x/juddi-core/src/main/resources/juddi_install_data/
------------------------------------------------------------------------------
Merged /juddi/trunk/juddi-core/src/main/resources/juddi_install_data:r1548772-1549358
Modified: juddi/branches/juddi-3.3.x/juddi-core/src/main/resources/juddi_install_data/root_BusinessEntity.xml
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/resources/juddi_install_data/root_BusinessEntity.xml?rev=1549363&r1=1549362&r2=1549363&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/main/resources/juddi_install_data/root_BusinessEntity.xml (original)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/main/resources/juddi_install_data/root_BusinessEntity.xml Mon Dec 9 00:40:43 2013
@@ -82,15 +82,61 @@
<keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
</categoryBag>
</bindingTemplate>
- <bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-inquiry-rest" serviceKey="uddi:juddi.apache.org:services-inquiry">
+
+ <bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-inquiry-ws-ssl" serviceKey="uddi:juddi.apache.org:services-inquiry">
+ <description>UDDI Inquiry API V3 SSL</description>
+ <!-- This should be changed to the WSDL URL of the inquiry API. An access point inside a bindingTemplate will be found for every service
+ in this file. They all must point to their API's WSDL URL -->
+ <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/inquiry?wsdl</accessPoint>
+ <tModelInstanceDetails>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_inquiry">
+ <instanceDetails>
+ <instanceParms>
+ <![CDATA[
+ <?xml version="1.0" encoding="utf-8" ?>
+ <UDDIinstanceParmsContainer xmlns="urn:uddi-org:policy_v3_instanceParms">
+ <defaultSortOrder>
+ uddi:uddi.org:sortorder:binarysort
+ </defaultSortOrder>
+ </UDDIinstanceParmsContainer>
+ ]]>
+ </instanceParms>
+ </instanceDetails>
+ </tModelInstanceInfo>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+ </tModelInstanceDetails>
+ <categoryBag>
+ <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+ </categoryBag>
+ </bindingTemplate>
+ </bindingTemplates>
+
+ </businessService>
+
+ <businessService serviceKey="uddi:juddi.apache.org:services-inquiry-rest" businessKey="uddi:juddi.apache.org:businesses-asf">
+ <name xml:lang="en">UDDI Inquiry REST Service</name>
+ <description xml:lang="en">Web Service supporting UDDI Inquiry API via HTTP GET</description>
+ <bindingTemplates>
+ <bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-inquiry-rest" serviceKey="uddi:juddi.apache.org:services-inquiry-rest">
<description>UDDI Inquiry API V3 REST</description>
<accessPoint useType="wadlDeployment">${juddi.server.baseurl}/services/inquiryRest?_wadl</accessPoint>
<categoryBag>
<keyedReference keyName="uddi-org:types:wadl" keyValue="wadlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
</categoryBag>
</bindingTemplate>
+ <bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-inquiry-rest-ssl" serviceKey="uddi:juddi.apache.org:services-inquiry-rest">
+ <description>UDDI Inquiry API V3 REST SSL</description>
+ <accessPoint useType="wadlDeployment">${juddi.server.baseurlsecure}/services/inquiryRest?_wadl</accessPoint>
+ <tModelInstanceDetails>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+ </tModelInstanceDetails>
+ <categoryBag>
+ <keyedReference keyName="uddi-org:types:wadl" keyValue="wadlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+ </categoryBag>
+ </bindingTemplate>
</bindingTemplates>
</businessService>
+
<businessService serviceKey="uddi:juddi.apache.org:services-publish" businessKey="uddi:juddi.apache.org:businesses-asf">
<name xml:lang="en">UDDI Publish Service</name>
<description xml:lang="en">Web Service supporting UDDI Publish API</description>
@@ -116,6 +162,30 @@
<keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
</categoryBag>
</bindingTemplate>
+
+ <bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-publish-ws-ssl" serviceKey="uddi:juddi.apache.org:services-publish">
+ <description>UDDI Publication API V3 SSL</description>
+ <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/publish?wsdl</accessPoint>
+ <tModelInstanceDetails>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_publication">
+ <instanceDetails>
+ <instanceParms>
+ <![CDATA[
+ <?xml version="1.0" encoding="utf-8" ?>
+ <UDDIinstanceParmsContainer xmlns="urn:uddi-org:policy_v3_instanceParms">
+ <authInfoUse>required</authInfoUse>
+ </UDDIinstanceParmsContainer>
+ ]]>
+ </instanceParms>
+ </instanceDetails>
+ </tModelInstanceInfo>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_security" />
+ </tModelInstanceDetails>
+ <categoryBag>
+ <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+ </categoryBag>
+ </bindingTemplate>
+
</bindingTemplates>
</businessService>
<businessService serviceKey="uddi:juddi.apache.org:services-security" businessKey="uddi:juddi.apache.org:businesses-asf">
@@ -132,6 +202,16 @@
<keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
</categoryBag>
</bindingTemplate>
+ <bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-security-ws-ssl" serviceKey="uddi:juddi.apache.org:services-security">
+ <description>UDDI Security API V3 SSL</description>
+ <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/security?wsdl</accessPoint>
+ <tModelInstanceDetails>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_security" />
+ </tModelInstanceDetails>
+ <categoryBag>
+ <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+ </categoryBag>
+ </bindingTemplate>
</bindingTemplates>
</businessService>
<businessService serviceKey="uddi:juddi.apache.org:services-custodytransfer" businessKey="uddi:juddi.apache.org:businesses-asf">
@@ -160,6 +240,33 @@
<keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
</categoryBag>
</bindingTemplate>
+
+
+ <bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-custodytransfer-ws-ssl" serviceKey="uddi:juddi.apache.org:services-custodytransfer">
+ <description>UDDI Custody and Ownership Transfer API V3 SSL</description>
+ <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/custody-transfer?wsdl</accessPoint>
+ <tModelInstanceDetails>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_ownership_transfer">
+ <instanceDetails>
+ <instanceParms>
+ <![CDATA[
+ <?xml version="1.0" encoding="utf-8" ?>
+ <UDDIinstanceParmsContainer
+ xmlns="urn:uddi-org:policy_v3_instanceParms">
+ <authInfoUse>required</authInfoUse>
+ </UDDIinstanceParmsContainer>
+ ]]>
+ </instanceParms>
+ </instanceDetails>
+ </tModelInstanceInfo>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+ </tModelInstanceDetails>
+ <categoryBag>
+ <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+ </categoryBag>
+ </bindingTemplate>
+
+
</bindingTemplates>
</businessService>
<businessService serviceKey="uddi:juddi.apache.org:services-subscription" businessKey="uddi:juddi.apache.org:businesses-asf">
@@ -189,6 +296,33 @@
<keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
</categoryBag>
</bindingTemplate>
+
+ <bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-subscription-ws-ssl" serviceKey="uddi:juddi.apache.org:services-subscription">
+ <description>UDDI Subscription API V3 SSL</description>
+ <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/subscription?wsdl</accessPoint>
+ <tModelInstanceDetails>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_subscription">
+ <instanceDetails>
+ <instanceParms>
+ <![CDATA[
+ <?xml version="1.0" encoding="utf-8" ?>
+ <UDDIinstanceParmsContainer
+ xmlns="urn:uddi-org:policy_v3_instanceParms">
+ <authInfoUse>required</authInfoUse>
+ <filterUsingFindAPI>supported</filterUsingFindAPI>
+ </UDDIinstanceParmsContainer>
+ ]]>
+ </instanceParms>
+ </instanceDetails>
+ </tModelInstanceInfo>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+ </tModelInstanceDetails>
+ <categoryBag>
+ <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+ </categoryBag>
+ </bindingTemplate>
+
+
</bindingTemplates>
</businessService>
<businessService serviceKey="uddi:juddi.apache.org:services-subscriptionlistener" businessKey="uddi:juddi.apache.org:businesses-asf">
@@ -200,11 +334,25 @@
<accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/subscription-listener?wsdl</accessPoint>
<tModelInstanceDetails>
<tModelInstanceInfo tModelKey="uddi:uddi.org:v3_subscriptionlistener" />
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
</tModelInstanceDetails>
<categoryBag>
<keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
</categoryBag>
</bindingTemplate>
+
+ <bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-subscriptionlistener-ws-ssl" serviceKey="uddi:juddi.apache.org:services-subscriptionlistener">
+ <description>UDDI Subscription Listener API V3 SSL</description>
+ <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/subscription-listener?wsdl</accessPoint>
+ <tModelInstanceDetails>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_subscriptionlistener" />
+ </tModelInstanceDetails>
+ <categoryBag>
+ <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+ </categoryBag>
+ </bindingTemplate>
+
+
</bindingTemplates>
</businessService>
@@ -262,6 +410,16 @@
<keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
</categoryBag>
</bindingTemplate>
+ <bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-publisher-ws-ssl" serviceKey="uddi:juddi.apache.org:services-publisher">
+ <description>jUDDI Publisher Service API V3 SSL</description>
+ <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/publisher?wsdl</accessPoint>
+ <tModelInstanceDetails>
+ <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+ </tModelInstanceDetails>
+ <categoryBag>
+ <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+ </categoryBag>
+ </bindingTemplate>
</bindingTemplates>
</businessService>
</businessServices>
Added: juddi/branches/juddi-3.3.x/juddi-core/src/test/java/org/apache/juddi/api/impl/API_150_ValueSetValidationTest.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/test/java/org/apache/juddi/api/impl/API_150_ValueSetValidationTest.java?rev=1549363&view=auto
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/test/java/org/apache/juddi/api/impl/API_150_ValueSetValidationTest.java (added)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/test/java/org/apache/juddi/api/impl/API_150_ValueSetValidationTest.java Mon Dec 9 00:40:43 2013
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2013 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.api.impl;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.juddi.Registry;
+import org.apache.juddi.v3.client.UDDIConstants;
+import org.apache.juddi.v3.tck.TckPublisher;
+import org.apache.juddi.v3.tck.TckSecurity;
+import org.apache.juddi.v3.tck.TckTModel;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.uddi.api_v3.CategoryBag;
+import org.uddi.api_v3.Description;
+import org.uddi.api_v3.KeyedReference;
+import org.uddi.api_v3.Name;
+import org.uddi.api_v3.SaveTModel;
+import org.uddi.api_v3.TModel;
+import org.uddi.v3_service.UDDIInquiryPortType;
+import org.uddi.v3_service.UDDIPublicationPortType;
+import org.uddi.v3_service.UDDISecurityPortType;
+
+/**
+ *
+ * @author Alex O'Ree
+ */
+public class API_150_ValueSetValidationTest {
+
+ private static Log logger = LogFactory.getLog(API_141_JIRATest.class);
+ static UDDISecurityPortType security = new UDDISecurityImpl();
+ static UDDIInquiryPortType inquiry = new UDDIInquiryImpl();
+ static UDDIPublicationPortType publication = new UDDIPublicationImpl();
+ static JUDDIApiImpl juddi = new JUDDIApiImpl();
+ static UDDIValueSetValidationImpl vsv = new UDDIValueSetValidationImpl();
+ static TckTModel tckTModel = new TckTModel(new UDDIPublicationImpl(), new UDDIInquiryImpl());
+ protected static String authInfoJoe = null;
+ protected static String authInfoSam = null;
+ protected static String authInfoRoot = null;
+ protected static String authInfoUDDI = null;
+
+ @AfterClass
+ public static void stopManager() throws ConfigurationException {
+ Registry.stop();
+ }
+
+ @BeforeClass
+ public static void startManager() throws ConfigurationException {
+ Registry.start();
+
+ logger.debug("Getting auth tokens..");
+ try {
+ authInfoJoe = TckSecurity.getAuthToken(security, TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword());
+ authInfoSam = TckSecurity.getAuthToken(security, TckPublisher.getSamPublisherId(), TckPublisher.getSamPassword());
+ authInfoRoot = TckSecurity.getAuthToken(security, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
+ authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
+ Assert.assertNotNull(authInfoJoe);
+ Assert.assertNotNull(authInfoSam);
+ String authInfoUDDI = TckSecurity.getAuthToken(security, TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword());
+ tckTModel.saveUDDIPublisherTmodel(authInfoUDDI);
+ tckTModel.saveTModels(authInfoUDDI, TckTModel.TMODELS_XML);
+ tckTModel.saveJoePublisherTmodel(authInfoJoe);
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ Assert.fail("Could not obtain authInfo token.");
+ }
+ }
+ final static String VSV_KEY = "uddi:juddi.apache.org:businesses-asf";
+ final static String VSV_BT_KEY = "uddi:juddi.apache.org:servicebindings-valueset-ws";
+ final static String TMODEL = "validated.checked.tmodel";
+
+ /**
+ * scenario 1
+ * <ul>
+ * <ol>create checked tmodel x</ol>
+ * <ol>register business/service/bt for validatevalues service</ol>
+ * <ol>add/alter BT to include instance info for ref to tmodel
+ * checked</ol>
+ * <ol>alter checked tmodel x, add reference to the BT for the
+ * validator</ol>
+ * <ol>someone tries to use the checked tmodel as a KR from some other
+ * entity</ol>
+ * <ol>on publish, the server attempts to validate the KR's value
+ * against the VV service via the binding Template</ol>
+ * </ul>
+ *
+ * @throws Exception
+ */
+ @Test
+ public void Scenario1() throws Exception {
+ //create checked tmodel x
+ //SaveCheckedTModel(TckTModel.JOE_PUBLISHER_KEY_PREFIX + TMODEL);
+ //register business/service/bt for validatevalues service
+ //this is done by the install process using the built in vsv
+
+ //add/alter BT to include instance info for ref to tmodel checked
+ //AlterRootBusiness();
+ }
+
+ private void SaveCheckedTModel(String key) throws Exception{
+ TModel tm = new TModel();
+ tm.setTModelKey(key);
+ tm.setCategoryBag(new CategoryBag());
+ tm.setName(new Name("My Custom validated key","en"));
+ tm.getDescription().add(new Description("valid values include 'one', 'two', 'three'", "en"));
+ tm.getCategoryBag().getKeyedReference().add(
+ new KeyedReference(UDDIConstants.IS_VALIDATED_BY, UDDIConstants.IS_VALIDATED_BY_KEY_NAME, VSV_BT_KEY));
+ SaveTModel stm = new SaveTModel();
+ stm.setAuthInfo(authInfoJoe);
+ publication.saveTModel(stm);
+ }
+
+ private void AlterRootBusiness() {
+
+ }
+}
Modified: juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-3des.xml
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-3des.xml?rev=1549363&r1=1549362&r2=1549363&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-3des.xml (original)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-3des.xml Mon Dec 9 00:40:43 2013
@@ -13,6 +13,7 @@
<!-- The ${juddi.server.baseurl} token can be referenced in accessPoints and will be resolved at runtime. -->
<server>
<baseurl>http://localhost:8080/juddiv3</baseurl>
+ <baseurlsecure>https://localhost:8443/juddiv3</baseurlsecure>
</server>
<!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API
don't worry, jUDDI doesn't implement it right now, but it may come in the future -->
Modified: juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-aes128.xml
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-aes128.xml?rev=1549363&r1=1549362&r2=1549363&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-aes128.xml (original)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-aes128.xml Mon Dec 9 00:40:43 2013
@@ -13,6 +13,7 @@
<!-- The ${juddi.server.baseurl} token can be referenced in accessPoints and will be resolved at runtime. -->
<server>
<baseurl>http://localhost:8080/juddiv3</baseurl>
+ <baseurlsecure>https://localhost:8443/juddiv3</baseurlsecure>
</server>
<!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API
don't worry, jUDDI doesn't implement it right now, but it may come in the future -->
Modified: juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-aes256.xml
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-aes256.xml?rev=1549363&r1=1549362&r2=1549363&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-aes256.xml (original)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-aes256.xml Mon Dec 9 00:40:43 2013
@@ -13,6 +13,7 @@
<!-- The ${juddi.server.baseurl} token can be referenced in accessPoints and will be resolved at runtime. -->
<server>
<baseurl>http://localhost:8080/juddiv3</baseurl>
+ <baseurlsecure>https://localhost:8443/juddiv3</baseurlsecure>
</server>
<!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API
don't worry, jUDDI doesn't implement it right now, but it may come in the future -->
Modified: juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-default.xml
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-default.xml?rev=1549363&r1=1549362&r2=1549363&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-default.xml (original)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3-enc-default.xml Mon Dec 9 00:40:43 2013
@@ -13,6 +13,7 @@
<!-- The ${juddi.server.baseurl} token can be referenced in accessPoints and will be resolved at runtime. -->
<server>
<baseurl>http://localhost:8080/juddiv3</baseurl>
+ <baseurlsecure>https://localhost:8443/juddiv3</baseurlsecure>
</server>
<!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API
don't worry, jUDDI doesn't implement it right now, but it may come in the future -->
Modified: juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3.xml
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3.xml?rev=1549363&r1=1549362&r2=1549363&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3.xml (original)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/test/resources/juddiv3.xml Mon Dec 9 00:40:43 2013
@@ -13,6 +13,7 @@
<!-- The ${juddi.server.baseurl} token can be referenced in accessPoints and will be resolved at runtime. -->
<server>
<baseurl>http://localhost:8080/juddiv3</baseurl>
+ <baseurlsecure>https://localhost:8443/juddiv3</baseurlsecure>
</server>
<!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API
don't worry, jUDDI doesn't implement it right now, but it may come in the future -->
Modified: juddi/branches/juddi-3.3.x/juddi-examples/hello-world-embedded/src/main/resources/juddiv3.xml
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-examples/hello-world-embedded/src/main/resources/juddiv3.xml?rev=1549363&r1=1549362&r2=1549363&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-examples/hello-world-embedded/src/main/resources/juddiv3.xml (original)
+++ juddi/branches/juddi-3.3.x/juddi-examples/hello-world-embedded/src/main/resources/juddiv3.xml Mon Dec 9 00:40:43 2013
@@ -13,6 +13,7 @@
<!-- The ${juddi.server.baseurl} token can be referenced in accessPoints and will be resolved at runtime. -->
<server>
<baseurl>http://localhost:8080/juddiv3</baseurl>
+ <baseurlsecure>https://localhost:8443/juddiv3</baseurlsecure>
</server>
<!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API
don't worry, jUDDI doesn't implement it right now, but it may come in the future -->
Modified: juddi/branches/juddi-3.3.x/juddi-examples/uddi-annotations/src/main/webapp/WEB-INF/classes/juddiv3.xml
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-examples/uddi-annotations/src/main/webapp/WEB-INF/classes/juddiv3.xml?rev=1549363&r1=1549362&r2=1549363&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-examples/uddi-annotations/src/main/webapp/WEB-INF/classes/juddiv3.xml (original)
+++ juddi/branches/juddi-3.3.x/juddi-examples/uddi-annotations/src/main/webapp/WEB-INF/classes/juddiv3.xml Mon Dec 9 00:40:43 2013
@@ -13,6 +13,7 @@
<!-- The ${juddi.server.baseurl} token can be referenced in accessPoints and will be resolved at runtime. -->
<server>
<baseurl>http://localhost:8080/juddiv3</baseurl>
+ <baseurlsecure>https://localhost:8443/juddiv3</baseurlsecure>
</server>
<!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API
don't worry, jUDDI doesn't implement it right now, but it may come in the future -->
Modified: juddi/branches/juddi-3.3.x/juddi-rest-cxf/pom.xml
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-rest-cxf/pom.xml?rev=1549363&r1=1549362&r2=1549363&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-rest-cxf/pom.xml (original)
+++ juddi/branches/juddi-3.3.x/juddi-rest-cxf/pom.xml Mon Dec 9 00:40:43 2013
@@ -1,121 +1,259 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.juddi</groupId>
- <artifactId>juddi-parent</artifactId>
- <version>3.3.0-SNAPSHOT</version>
- </parent>
- <groupId>org.apache.juddi</groupId>
- <artifactId>juddi-rest-cxf</artifactId>
- <packaging>bundle</packaging>
- <name>jUDDI REST Services using Apache CXF</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.juddi</groupId>
- <artifactId>uddi-ws</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.juddi</groupId>
- <artifactId>juddi-client</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.juddi</groupId>
- <artifactId>juddi-core</artifactId>
- <version>${project.parent.version}</version>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.juddi</groupId>
+ <artifactId>juddi-parent</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.apache.juddi</groupId>
+ <artifactId>juddi-rest-cxf</artifactId>
+ <packaging>bundle</packaging>
+ <name>jUDDI REST Services using Apache CXF</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.juddi</groupId>
+ <artifactId>uddi-ws</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juddi</groupId>
+ <artifactId>juddi-client</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juddi</groupId>
+ <artifactId>juddi-core</artifactId>
+ <version>${project.parent.version}</version>
<scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.juddi</groupId>
- <artifactId>uddi-tck-base</artifactId>
- <version>${project.parent.version}</version>
- <scope>test</scope>
- </dependency>
-<dependency>
- <groupId>commons-configuration</groupId>
- <artifactId>commons-configuration</artifactId>
- <version>1.9</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>3.1</version>
-</dependency>
-<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-bundle-jaxrs</artifactId>
- <version>2.7.5</version>
- <scope>provided</scope>
- </dependency>
-
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juddi</groupId>
+ <artifactId>uddi-tck-base</artifactId>
+ <version>${project.parent.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>1.4.0</version>
- <configuration>
- <instructions>
- <Export-Package>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-bundle-jaxrs</artifactId>
+ <version>2.7.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juddi</groupId>
+ <artifactId>uddi-ws</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juddi</groupId>
+ <artifactId>juddi-client</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>3.2.2.RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>3.2.2.RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juddi</groupId>
+ <artifactId>uddi-tck-base</artifactId>
+ <version>${project.parent.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>3.2.5.ga</version>
+ <exclusions>
+ <exclusion>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>3.3.1.ga</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>2.1_3</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ <version>1.1.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.javamail</groupId>
+ <artifactId>geronimo-javamail_1.4_mail</artifactId>
+ <version>1.8.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jaxrs_1.1_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.5.3.0_1</version>
+ <scope>test</scope>
+
+ </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.2-504.jdbc3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockejb</groupId>
+ <artifactId>mockejb</artifactId>
+ <version>0.6-beta2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-rs-extension-providers</artifactId>
+ <version>2.7.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.jettison</groupId>
+ <artifactId>jettison</artifactId>
+ <version>1.3.4</version>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>1.4.0</version>
+ <configuration>
+ <instructions>
+ <Export-Package>
+
org.apache.juddi.api.impl.rest
-
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.3</version>
- <executions>
- <execution>
- <phase>generate-resources</phase>
- <configuration>
- <tasks>
- <delete dir="juddi-derby-test-db" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>hibernate3-maven-plugin</artifactId>
- <version>2.2</version>
- <!-- <executions> <execution> <phase>process-classes</phase> <goals>
+
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <configuration>
+ <tasks>
+ <delete dir="juddi-derby-test-db" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>hibernate3-maven-plugin</artifactId>
+ <version>2.2</version>
+ <!-- <executions> <execution> <phase>process-classes</phase> <goals>
<goal>hbm2ddl</goal> </goals> </execution> </executions> -->
- <configuration>
- <components>
- <component>
- <name>hbm2ddl</name>
- <implementation>jpaconfiguration</implementation>
- </component>
- </components>
- <componentProperties>
- <persistenceunit>juddiDatabase</persistenceunit>
- <outputfilename>schema.ddl</outputfilename>
- <drop>false</drop>
- <create>true</create>
- <export>false</export>
- <format>true</format>
- </componentProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <configuration>
+ <components>
+ <component>
+ <name>hbm2ddl</name>
+ <implementation>jpaconfiguration</implementation>
+ </component>
+ </components>
+ <componentProperties>
+ <persistenceunit>juddiDatabase</persistenceunit>
+ <outputfilename>schema.ddl</outputfilename>
+ <drop>false</drop>
+ <create>true</create>
+ <export>false</export>
+ <format>true</format>
+ </componentProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: juddi/branches/juddi-3.3.x/juddi-rest-cxf/src/main/java/org/apache/juddi/api/impl/rest/UDDIInquiryJAXRS.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-rest-cxf/src/main/java/org/apache/juddi/api/impl/rest/UDDIInquiryJAXRS.java?rev=1549363&r1=1549362&r2=1549363&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-rest-cxf/src/main/java/org/apache/juddi/api/impl/rest/UDDIInquiryJAXRS.java (original)
+++ juddi/branches/juddi-3.3.x/juddi-rest-cxf/src/main/java/org/apache/juddi/api/impl/rest/UDDIInquiryJAXRS.java Mon Dec 9 00:40:43 2013
@@ -15,8 +15,6 @@
*/
package org.apache.juddi.api.impl.rest;
-import java.net.URI;
-import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -27,11 +25,14 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.juddi.api.impl.UDDIInquiryImpl;
import org.apache.juddi.api_v3.AccessPointType;
+import org.apache.juddi.api_v3.rest.UriContainer;
+import org.apache.juddi.v3.client.UDDIConstants;
import org.apache.juddi.v3.client.mapping.ReadWSDL;
import org.apache.juddi.v3.client.mapping.URLLocalizerDefaultImpl;
import org.apache.juddi.v3.client.mapping.WSDL2UDDI;
import org.apache.juddi.v3.error.UDDIErrorHelper;
import org.uddi.api_v3.*;
+import org.uddi.sub_v3.KeyBag;
import org.uddi.v3_service.DispositionReportFaultMessage;
/**
@@ -42,437 +43,596 @@ import org.uddi.v3_service.DispositionRe
* @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
*/
@Path("/")
-@Produces("application/xml")
+@Produces({"application/xml", "application/json"})
@org.apache.cxf.jaxrs.model.wadl.Description("This service provides access to UDDI data via a REST interface")
public class UDDIInquiryJAXRS {
- private static org.apache.juddi.api.impl.UDDIInquiryImpl inquiry = new UDDIInquiryImpl();
- private static Log log = LogFactory.getLog(UDDIInquiryJAXRS.class);
+ private static org.apache.juddi.api.impl.UDDIInquiryImpl inquiry = new UDDIInquiryImpl();
+ private static Log log = LogFactory.getLog(UDDIInquiryJAXRS.class);
- /**
- * Returns the details of a business entity in JSON
- *
- * @param id
- * @return
- */
- @GET
- @Path("/JSON/businessDetail/{id}")
- @Produces("application/json")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a business entity in JSON")
- public org.uddi.api_v3.BusinessEntity getBusinessDetailJSON(@PathParam("id") String id) throws WebApplicationException {
- return getBusinessDetail(id);
- }
-
- /**
- * Returns the details of a business entity in XML
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/XML/businessDetail/{id}")
- @Produces("application/xml")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a business entity in XML")
- public org.uddi.api_v3.BusinessEntity getBusinessDetailXML(@PathParam("id") String id) throws WebApplicationException {
- return getBusinessDetail(id);
- }
-
- private org.uddi.api_v3.BusinessEntity getBusinessDetail(String id) {
- GetBusinessDetail gbd = new GetBusinessDetail();
- gbd.getBusinessKey().add(id);
- BusinessDetail businessDetail;
- try {
- businessDetail = inquiry.getBusinessDetail(gbd);
- return businessDetail.getBusinessEntity().get(0);
- } catch (DispositionReportFaultMessage ex) {
- HandleException(ex);
- }
- return null;
- }
-
- /**
- * Returns the details of a tModel entity in XML
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/XML/tModelDetail/{id}")
- @Produces("application/xml")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a tModel entity in XML")
- public org.uddi.api_v3.TModel getTModelDetailXML(@PathParam("id") String id) throws WebApplicationException {
- return getTModelDetail(id);
- }
-
- /**
- * Returns the details of a tModel entity in JSON
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/JSON/tModelDetail/{id}")
- @Produces("application/json")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a tModel entity in JSON")
- public org.uddi.api_v3.TModel getTModelDetailJSON(@PathParam("id") String id) throws WebApplicationException {
- return getTModelDetail(id);
- }
-
- private org.uddi.api_v3.TModel getTModelDetail(String id) {
- GetTModelDetail gbd = new GetTModelDetail();
- gbd.getTModelKey().add(id);
-
- try {
- TModelDetail tModelDetail = inquiry.getTModelDetail(gbd);
- return tModelDetail.getTModel().get(0);
- } catch (DispositionReportFaultMessage ex) {
- HandleException(ex);
- }
- return null;
- }
-
- /**
- * Returns the details of a service entity in JSON
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/XML/serviceDetail/{id}")
- @Produces("application/json")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a service entity in JSON")
- public org.uddi.api_v3.BusinessService getServiceDetailJSON(@PathParam("id") String id) throws WebApplicationException {
- return getServiceDetail(id);
- }
-
- /**
- * Returns the details of a service entity in XML
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/XML/serviceDetail/{id}")
- @Produces("application/xml")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a service entity in XML")
- public org.uddi.api_v3.BusinessService getServiceDetailXML(@PathParam("id") String id) throws WebApplicationException {
- return getServiceDetail(id);
- }
-
- private BusinessService getServiceDetail(String id) {
- GetServiceDetail gbd = new GetServiceDetail();
- gbd.getServiceKey().add(id);
-
- try {
- ServiceDetail serviceDetail = inquiry.getServiceDetail(gbd);
- return serviceDetail.getBusinessService().get(0);
- } catch (DispositionReportFaultMessage ex) {
- HandleException(ex);
- }
- return null;
- }
-
- /**
- * Returns the operational details of a given entity in JSON
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/XML/opInfo/{id}")
- @Produces("application/json")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the operational details of a given entity in JSON")
- public org.uddi.api_v3.OperationalInfo getOpInfoJSON(@PathParam("id") String id) throws WebApplicationException {
- return getOpInfoDetail(id);
- }
-
- /**
- * Returns the operational details of a given entity in XML
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/XML/opInfo/{id}")
- @Produces("application/xml")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the operational details of a given entity in XML")
- public org.uddi.api_v3.OperationalInfo getOpInfoXML(@PathParam("id") String id) throws WebApplicationException {
- return getOpInfoDetail(id);
- }
-
- private OperationalInfo getOpInfoDetail(String id) {
- GetOperationalInfo req = new GetOperationalInfo();
- req.getEntityKey().add(id);
- try {
- OperationalInfos operationalInfo = inquiry.getOperationalInfo(req);
- return operationalInfo.getOperationalInfo().get(0);
- } catch (DispositionReportFaultMessage ex) {
- HandleException(ex);
- }
- return null;
- }
-
- /**
- * Returns the binding details of a given entity in JSON
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/XML/bindingDetail/{id}")
- @Produces("application/json")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the binding details of a given entity in JSON")
- public org.uddi.api_v3.BindingTemplate getBindingDetailJSON(@PathParam("id") String id) throws WebApplicationException {
- return getBindingDetail(id);
- }
-
- /**
- * Returns the binding details of a given entity in XML
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/XML/bindingDetail/{id}")
- @Produces("application/xml")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the binding details of a given entity in XML")
- public org.uddi.api_v3.BindingTemplate getBindingDetailXML(@PathParam("id") String id) throws WebApplicationException {
- return getBindingDetail(id);
- }
-
- private BindingTemplate getBindingDetail(String id) {
- GetBindingDetail req = new GetBindingDetail();
- req.getBindingKey().add(id);
- try {
- BindingDetail bindingDetail = inquiry.getBindingDetail(req);
- return bindingDetail.getBindingTemplate().get(0);
- } catch (DispositionReportFaultMessage ex) {
- HandleException(ex);
- }
- return null;
- }
-
- /**
- * Returns the binding details of a given entity in JSON
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/XML/endpointsByService/{id}")
- @Produces("application/json")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the binding details of a given entity in JSON")
- public List<URI> geEndpointsByServiceJSON(@PathParam("id") String id) throws WebApplicationException {
- return getEndpointsByService(id);
- }
-
- /**
- * Returns the binding details of a given entity in XML
- *
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/XML/endpointsByService/{id}")
- @Produces("application/xml")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the binding details of a given entity in XML")
- public List<URI> getEndpointsByServiceXML(@PathParam("id") String id) throws WebApplicationException {
- return getEndpointsByService(id);
- }
-
- /**
- * 6.5 HTTP GET Services for UDDI Data Structures
-A node may offer an HTTP GET service for access to the XML representations of UDDI data structures. If a node offers this service, the URLs should be in a format that is predictable and uses the entity key as a URL parameter.
-
-The RECOMMENDED syntax for the URLs for such a service is as follows:
-
-If a UDDI nodeâs base URI is http://uddi.example.org/mybase, then the URI http://uddi.example.org/mybase?<entity>Key=uddiKey would retrieve the XML for the data structure whose type is <entity> and whose key is uddiKey. For example, the XML representation of a tModel whose key is "uddi:tempuri.com:fish:interface" can be retrieved by using the URL http://uddi.example.org/mybase?tModelKey=uddi:tempuri.com:fish:interface.
-
-In the case of businessEntities, the node MAY add these URIs to the businessEntityâs discoveryURLs structure, though this is NOT RECOMMENDED behavior as it complicates the use of digital signatures.
-
-
-
- * @param id
- * @return
- * @throws WebApplicationException
- */
- @GET
- @Path("/base?{entity}Key={key}")
- @Produces("application/xml")
- @org.apache.cxf.jaxrs.model.wadl.Description("Returns the selected UDDI entity as XML per section 6.5 of the UDDIv3 specification. Use businessKey, tmodelKey, bindingKey or serviceKey ")
- public Object getEntityAsXML(@PathParam("entity") String entity,@PathParam("key") String key) throws WebApplicationException {
- if (entity.equalsIgnoreCase("business"))
- return getBusinessDetailXML(key);
- if (entity.equalsIgnoreCase("tmodel"))
- return getTModelDetailXML(key);
- if (entity.equalsIgnoreCase("binding"))
- return getBindingDetailXML(key);
- if (entity.equalsIgnoreCase("service"))
- return getServiceDetailXML(key);
- throw new WebApplicationException(400);
- }
-
- private List<URI> getEndpointsByService(String id) throws WebApplicationException {
- List<URI> ret = new ArrayList<URI>();
- GetServiceDetail fs = new GetServiceDetail();
-
- fs.getServiceKey().add(id);
- try {
- ServiceDetail serviceDetail = inquiry.getServiceDetail(fs);
- if (serviceDetail == null || serviceDetail.getBusinessService().isEmpty()) {
+ /**
+ * Returns the details of a business entity in JSON
+ *
+ * @param id
+ * @return
+ */
+ @GET
+ @Path("/JSON/businessKey/{id}")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a business entity in JSON")
+ public org.uddi.api_v3.BusinessEntity getBusinessDetailJSON(@PathParam("id") String id) throws WebApplicationException {
+ return getBusinessDetail(id);
+ }
+
+ /**
+ * Returns the details of a business entity in XML
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/XML/businessKey/{id}")
+ @Produces("application/xml")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a business entity in XML")
+ public org.uddi.api_v3.BusinessEntity getBusinessDetailXML(@PathParam("id") String id) throws WebApplicationException {
+ return getBusinessDetail(id);
+ }
+
+ private org.uddi.api_v3.BusinessEntity getBusinessDetail(String id) {
+ GetBusinessDetail gbd = new GetBusinessDetail();
+ gbd.getBusinessKey().add(id);
+ BusinessDetail businessDetail;
+ try {
+ businessDetail = inquiry.getBusinessDetail(gbd);
+ return businessDetail.getBusinessEntity().get(0);
+ } catch (DispositionReportFaultMessage ex) {
+ HandleException(ex);
+ }
+ return null;
+ }
+
+ /**
+ * Returns the details of a tModel entity in XML
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/XML/tModelKey/{id}")
+ @Produces("application/xml")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a tModel entity in XML")
+ public org.uddi.api_v3.TModel getTModelDetailXML(@PathParam("id") String id) throws WebApplicationException {
+ return getTModelDetail(id);
+ }
+
+ /**
+ * Returns the details of a tModel entity in JSON
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/JSON/tModelKey/{id}")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a tModel entity in JSON")
+ public org.uddi.api_v3.TModel getTModelDetailJSON(@PathParam("id") String id) throws WebApplicationException {
+ return getTModelDetail(id);
+ }
+
+ private org.uddi.api_v3.TModel getTModelDetail(String id) {
+ GetTModelDetail gbd = new GetTModelDetail();
+ gbd.getTModelKey().add(id);
+
+ try {
+ TModelDetail tModelDetail = inquiry.getTModelDetail(gbd);
+ return tModelDetail.getTModel().get(0);
+ } catch (DispositionReportFaultMessage ex) {
+ HandleException(ex);
+ }
+ return null;
+ }
+
+ /**
+ * Returns the details of a service entity in JSON
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/JSON/serviceKey/{id}")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a service entity in JSON")
+ public org.uddi.api_v3.BusinessService getServiceDetailJSON(@PathParam("id") String id) throws WebApplicationException {
+ return getServiceDetail(id);
+ }
+
+ @GET
+ @Path("/JSON/getDetail")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a UDDI entity in JSON, use query parameters"
+ + "serviceKey,businessKey,tModelKey, bindingKey")
+ public Object getDetailJSON(@QueryParam("serviceKey") String serviceKey,
+ @QueryParam("businessKey") String businessKey,
+ @QueryParam("tModelKey") String tModelKey,
+ @QueryParam("bindingKey") String bindingKey) throws WebApplicationException {
+ int params = 0;
+ if (businessKey != null) {
+ params++;
+ }
+ if (tModelKey != null) {
+ params++;
+ }
+ if (bindingKey != null) {
+ params++;
+ }
+ if (serviceKey != null) {
+ params++;
+ }
+ if (params != 1) {
+ throw new WebApplicationException(400);
+ }
+
+ if (businessKey != null) {
+ return getBusinessDetail(businessKey);
+ }
+ if (tModelKey != null) {
+ return getTModelDetail(tModelKey);
+ }
+ if (bindingKey != null) {
+ return getBindingDetail(bindingKey);
+ }
+ if (serviceKey != null) {
+ return getServiceDetail(serviceKey);
+ }
throw new WebApplicationException(400);
- } else {
- List<URI> endpoints = GetEndpoints(serviceDetail, null);
- ret.addAll(endpoints);
- }
- } catch (DispositionReportFaultMessage ex) {
- HandleException(ex);
- }
- return ret;
- }
-
-
-
- private List<URI> GetEndpoints(ServiceDetail serviceDetail, String authInfo) throws DispositionReportFaultMessage {
- List<URI> items = new ArrayList<URI>();
- if (serviceDetail == null) {
- return items;
- }
- for (int i = 0; i < serviceDetail.getBusinessService().size(); i++) {
- if (serviceDetail.getBusinessService().get(i).getBindingTemplates() != null) {
- for (int k = 0; k < serviceDetail.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) {
- items.addAll(ParseBinding(serviceDetail.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k), authInfo));
- }
- }
- }
- return items;
- }
-
- private List<URI> GetBindingInfo(String value, String cred) throws DispositionReportFaultMessage {
- List<URI> items = new ArrayList<URI>();
- if (value == null) {
- return items;
- }
- GetBindingDetail b = new GetBindingDetail();
- b.setAuthInfo(cred);
- b.getBindingKey().add(value);
- BindingDetail bindingDetail = inquiry.getBindingDetail(b);
- for (int i = 0; i < bindingDetail.getBindingTemplate().size(); i++) {
- items.addAll(ParseBinding(bindingDetail.getBindingTemplate().get(i), cred));
- }
- return items;
- }
-
- private List<URI> FetchWSDL(String value) {
- List<URI> items = new ArrayList<URI>();
-
- if (value.startsWith("http://") || value.startsWith("https://")) {
- //here, we need an HTTP Get for WSDLs
- org.apache.juddi.v3.client.mapping.ReadWSDL r = new ReadWSDL();
- r.setIgnoreSSLErrors(true);
- try {
- Definition wsdlDefinition = r.readWSDL(new URL(value));
- Properties properties = new Properties();
-
-
- properties.put("keyDomain", "domain");
- properties.put("businessName", "biz");
- properties.put("serverName", "localhost");
- properties.put("serverPort", "80");
-
- WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
- BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinition);
- for (int i = 0; i < businessServices.getBusinessService().size(); i++) {
- if (businessServices.getBusinessService().get(i).getBindingTemplates() != null) {
- for (int k = 0; k < businessServices.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) {
- items.addAll(ParseBinding(businessServices.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k), null));
- }
- }
- }
- } catch (Exception ex) {
- }
-
- }
- return items;
- }
-
- private List<URI> ParseBinding(BindingTemplate get, String authInfo) throws DispositionReportFaultMessage {
- List<URI> items = new ArrayList<URI>();
- if (get == null || get.getAccessPoint() == null) {
- return items;
- }
- if (get.getHostingRedirector() != null) {
- //hosting Redirector is the same as "reference this other binding template". It's actually deprecated so
- //don't expect to see this too often
- items.addAll(GetBindingInfo(get.getHostingRedirector().getBindingKey(), authInfo));
- }
- if (get.getAccessPoint() != null) {
- String usetype = get.getAccessPoint().getUseType();
- if (usetype == null) {
+ }
+
+ @GET
+ @Path("/XML/getDetail")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a UDDI entity in XML, use query parameters"
+ + "serviceKey,businessKey,tModelKey, bindingKey")
+ public Object getDetailXML(@QueryParam("serviceKey") String serviceKey,
+ @QueryParam("businessKey") String businessKey,
+ @QueryParam("tModelKey") String tModelKey,
+ @QueryParam("bindingKey") String bindingKey) throws WebApplicationException {
+ int params = 0;
+ if (businessKey != null) {
+ params++;
+ }
+ if (tModelKey != null) {
+ params++;
+ }
+ if (bindingKey != null) {
+ params++;
+ }
+ if (serviceKey != null) {
+ params++;
+ }
+ if (params != 1) {
+ throw new WebApplicationException(400);
+ }
+ if (businessKey != null) {
+ return getBusinessDetail(businessKey);
+ }
+ if (tModelKey != null) {
+ return getTModelDetail(tModelKey);
+ }
+ if (bindingKey != null) {
+ return getBindingDetail(bindingKey);
+ }
+ if (serviceKey != null) {
+ return getServiceDetail(serviceKey);
+ }
+ throw new WebApplicationException(400);
+ }
+
+ /**
+ * Returns the details of a service entity in XML
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/XML/serviceKey/{id}")
+ @Produces("application/xml")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details of a service entity in XML")
+ public org.uddi.api_v3.BusinessService getServiceDetailXML(@PathParam("id") String id) throws WebApplicationException {
+ return getServiceDetail(id);
+ }
+
+ private BusinessService getServiceDetail(String id) {
+ GetServiceDetail gbd = new GetServiceDetail();
+ gbd.getServiceKey().add(id);
+
try {
- //this is unexpected, usetype is a required field
- items.add(new URI(get.getAccessPoint().getValue()));
- } catch (URISyntaxException ex) {
- log.warn(ex);
- }
- } else if (usetype.equalsIgnoreCase(AccessPointType.BINDING_TEMPLATE.toString())) {
- //referencing another binding template
- items.addAll(GetBindingInfo(get.getAccessPoint().getValue(), authInfo));
- } else if (usetype.equalsIgnoreCase(AccessPointType.HOSTING_REDIRECTOR.toString())) {
- //this one is a bit strange. the value should be a binding template
-
- items.addAll(GetBindingInfo(get.getAccessPoint().getValue(), authInfo));
-
- } else if (usetype.equalsIgnoreCase(AccessPointType.WSDL_DEPLOYMENT.toString())) {
- //fetch wsdl and parse
- items.addAll(FetchWSDL(get.getAccessPoint().getValue()));
- } else if (usetype.equalsIgnoreCase(AccessPointType.END_POINT.toString())) {
+ ServiceDetail serviceDetail = inquiry.getServiceDetail(gbd);
+ return serviceDetail.getBusinessService().get(0);
+ } catch (DispositionReportFaultMessage ex) {
+ HandleException(ex);
+ }
+ return null;
+ }
+
+ /**
+ * Returns the operational details of a given entity in JSON
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/JSON/opInfo/{id}")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the operational details of a given entity in JSON")
+ public org.uddi.api_v3.OperationalInfo getOpInfoJSON(@PathParam("id") String id) throws WebApplicationException {
+ return getOpInfoDetail(id);
+ }
+
+ /**
+ * Returns the operational details of a given entity in XML
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/XML/opInfo/{id}")
+ @Produces("application/xml")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the operational details of a given entity in XML")
+ public org.uddi.api_v3.OperationalInfo getOpInfoXML(@PathParam("id") String id) throws WebApplicationException {
+ return getOpInfoDetail(id);
+ }
+
+ private OperationalInfo getOpInfoDetail(String id) {
+ GetOperationalInfo req = new GetOperationalInfo();
+ req.getEntityKey().add(id);
try {
- items.add(new URI(get.getAccessPoint().getValue()));
- } catch (URISyntaxException ex) {
- log.warn(ex);
+ OperationalInfos operationalInfo = inquiry.getOperationalInfo(req);
+ return operationalInfo.getOperationalInfo().get(0);
+ } catch (DispositionReportFaultMessage ex) {
+ HandleException(ex);
}
- } else {
+ return null;
+ }
+
+ /**
+ * Returns the binding details of a given entity in JSON
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/JSON/bindingKey/{id}")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the binding details of a given entity in JSON")
+ public org.uddi.api_v3.BindingTemplate getBindingDetailJSON(@PathParam("id") String id) throws WebApplicationException {
+ return getBindingDetail(id);
+ }
+
+ /**
+ * Returns the binding details of a given entity in XML
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/XML/bindingKey/{id}")
+ @Produces("application/xml")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the binding details of a given entity in XML")
+ public org.uddi.api_v3.BindingTemplate getBindingDetailXML(@PathParam("id") String id) throws WebApplicationException {
+ return getBindingDetail(id);
+ }
+
+ private BindingTemplate getBindingDetail(String id) {
+ GetBindingDetail req = new GetBindingDetail();
+ req.getBindingKey().add(id);
try {
- //treat it has an extension or whatever
- items.add(new URI(get.getAccessPoint().getValue()));
- } catch (URISyntaxException ex) {
- log.warn(ex);
+ BindingDetail bindingDetail = inquiry.getBindingDetail(req);
+ return bindingDetail.getBindingTemplate().get(0);
+ } catch (DispositionReportFaultMessage ex) {
+ HandleException(ex);
}
- }
+ return null;
+ }
+ /**
+ * Returns the binding details of a given entity in JSON
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/JSON/endpointsByService/{id}")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the service access points of a given service in JSON")
+ public UriContainer geEndpointsByServiceJSON(@PathParam("id") String id) throws WebApplicationException {
+ return getEndpointsByService(id);
+ }
+
+ /**
+ * Returns the binding details of a given entity in XML
+ *
+ * @param id
+ * @return
+ * @throws WebApplicationException
+ */
+ @GET
+ @Path("/XML/endpointsByService/{id}")
+ @Produces("application/xml")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the service access points of a given service in XML")
+ public UriContainer getEndpointsByServiceXML(@PathParam("id") String id) throws WebApplicationException {
+ return getEndpointsByService(id);
+ }
+
+ @GET
+ @Path("/XML/businessList")
+ @Produces("application/xml")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the business keys of the first 100 registered businesses in XML")
+ public KeyBag getBusinessListXML() throws WebApplicationException {
+ return getBusinessListData();
+ }
+
+ @GET
+ @Path("/JSON/businessList")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the business keys of the first 100 registered businesses in JSON")
+ public KeyBag getBusinessListJSON() throws WebApplicationException {
+ return getBusinessListData();
+ }
+
+ @GET
+ @Path("/XML/serviceList")
+ @Produces("application/xml")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the Service keys of the first 100 registered services in XML")
+ public KeyBag getServiceListXML() throws WebApplicationException {
+ return getServiceListData();
+ }
+
+ @GET
+ @Path("/JSON/serviceList")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the Service keys of the first 100 registered services in JSON")
+ public KeyBag getServiceListJSON() throws WebApplicationException {
+ return getServiceListData();
+ }
+
+ @GET
+ @Path("/XML/tModelList")
+ @Produces("application/xml")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the tModel keys of the first 100 registered services in XML")
+ public KeyBag getTModelListXML() throws WebApplicationException {
+ return getTmodelListData();
+ }
+
+ @GET
+ @Path("/JSON/tModelList")
+ @Produces("application/json")
+ @org.apache.cxf.jaxrs.model.wadl.Description("Returns the tModel keys of the first 100 registered services in JSON")
+ public KeyBag getTModelListJSON() throws WebApplicationException {
+ return getTmodelListData();
+ }
+
+ private UriContainer getEndpointsByService(String id) throws WebApplicationException {
+ UriContainer c = new UriContainer();
+ List<String> ret = new ArrayList<String>();
+ GetServiceDetail fs = new GetServiceDetail();
+
+ fs.getServiceKey().add(id);
+ try {
+ ServiceDetail serviceDetail = inquiry.getServiceDetail(fs);
+ if (serviceDetail == null || serviceDetail.getBusinessService().isEmpty()) {
+ throw new WebApplicationException(400);
+ } else {
+ List<String> endpoints = GetEndpoints(serviceDetail, null);
+ ret.addAll(endpoints);
+ }
+ } catch (DispositionReportFaultMessage ex) {
+ HandleException(ex);
+ }
+ c.setUriList(ret);
+ return c;
}
- return items;
- }
- private static void HandleException(DispositionReportFaultMessage ex) throws WebApplicationException {
- if (ex == null) {
- throw new WebApplicationException(500);
+ private List<String> GetEndpoints(ServiceDetail serviceDetail, String authInfo) throws DispositionReportFaultMessage {
+ List<String> items = new ArrayList<String>();
+ if (serviceDetail == null) {
+ return items;
+ }
+ for (int i = 0; i < serviceDetail.getBusinessService().size(); i++) {
+ if (serviceDetail.getBusinessService().get(i).getBindingTemplates() != null) {
+ for (int k = 0; k < serviceDetail.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) {
+ items.addAll(ParseBinding(serviceDetail.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k), authInfo));
+ }
+ }
+ }
+ return items;
}
- log.error(ex);
- if (ex.getFaultInfo() == null) {
- throw new WebApplicationException(500);
+
+ private List<String> GetBindingInfo(String value, String cred) throws DispositionReportFaultMessage {
+ List<String> items = new ArrayList<String>();
+ if (value == null) {
+ return items;
+ }
+ GetBindingDetail b = new GetBindingDetail();
+ b.setAuthInfo(cred);
+ b.getBindingKey().add(value);
+ BindingDetail bindingDetail = inquiry.getBindingDetail(b);
+ for (int i = 0; i < bindingDetail.getBindingTemplate().size(); i++) {
+ items.addAll(ParseBinding(bindingDetail.getBindingTemplate().get(i), cred));
+ }
+ return items;
+ }
+
+ private List<String> FetchWSDL(String value) {
+ List<String> items = new ArrayList<String>();
+
+ if (value.startsWith("http://") || value.startsWith("https://")) {
+ //here, we need an HTTP Get for WSDLs
+ org.apache.juddi.v3.client.mapping.ReadWSDL r = new ReadWSDL();
+ r.setIgnoreSSLErrors(true);
+ try {
+ Definition wsdlDefinition = r.readWSDL(new URL(value));
+ Properties properties = new Properties();
+
+
+ properties.put("keyDomain", "domain");
+ properties.put("businessName", "biz");
+ properties.put("serverName", "localhost");
+ properties.put("serverPort", "80");
+
+ WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
+ BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinition);
+ for (int i = 0; i < businessServices.getBusinessService().size(); i++) {
+ if (businessServices.getBusinessService().get(i).getBindingTemplates() != null) {
+ for (int k = 0; k < businessServices.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) {
+ items.addAll(ParseBinding(businessServices.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k), null));
+ }
+ }
+ }
+ } catch (Exception ex) {
+ }
+
+ }
+ return items;
+ }
+
+ private List<String> ParseBinding(BindingTemplate get, String authInfo) throws DispositionReportFaultMessage {
+ List<String> items = new ArrayList<String>();
+ if (get == null || get.getAccessPoint() == null) {
+ return items;
+ }
+ if (get.getHostingRedirector() != null) {
+ //hosting Redirector is the same as "reference this other binding template". It's actually deprecated so
+ //don't expect to see this too often
+ items.addAll(GetBindingInfo(get.getHostingRedirector().getBindingKey(), authInfo));
+ }
+ if (get.getAccessPoint() != null) {
+ String usetype = get.getAccessPoint().getUseType();
+ if (usetype == null) {
+
+ //this is unexpected, usetype is a required field
+ items.add((get.getAccessPoint().getValue()));
+
+ } else if (usetype.equalsIgnoreCase(AccessPointType.BINDING_TEMPLATE.toString())) {
+ //referencing another binding template
+ items.addAll(GetBindingInfo(get.getAccessPoint().getValue(), authInfo));
+ } else if (usetype.equalsIgnoreCase(AccessPointType.HOSTING_REDIRECTOR.toString())) {
+ //this one is a bit strange. the value should be a binding template
+
+ items.addAll(GetBindingInfo(get.getAccessPoint().getValue(), authInfo));
+
+ } else if (usetype.equalsIgnoreCase(AccessPointType.WSDL_DEPLOYMENT.toString())) {
+ //fetch wsdl and parse
+ items.addAll(FetchWSDL(get.getAccessPoint().getValue()));
+ } else if (usetype.equalsIgnoreCase(AccessPointType.END_POINT.toString())) {
+
+ items.add((get.getAccessPoint().getValue()));
+
+ } else {
+
+ //treat it has an extension or whatever
+ items.add((get.getAccessPoint().getValue()));
+
+ }
+
+ }
+ return items;
}
- if (ex.getFaultInfo().countainsErrorCode(UDDIErrorHelper.lookupErrCode(UDDIErrorHelper.E_AUTH_TOKEN_EXPIRED))) {
- throw new WebApplicationException(ex, 401);
+
+ private static void HandleException(Exception ex) throws WebApplicationException {
+ if (ex == null) {
+ throw new WebApplicationException(500);
+ }
+ log.error(ex.getMessage());
+ log.debug(ex);
+ if (ex instanceof DispositionReportFaultMessage) {
+ DispositionReportFaultMessage dr = (DispositionReportFaultMessage) ex;
+ if (dr.getFaultInfo() == null) {
+ throw new WebApplicationException(500);
+ }
+ if (dr.getFaultInfo().countainsErrorCode(UDDIErrorHelper.lookupErrCode(UDDIErrorHelper.E_AUTH_TOKEN_EXPIRED))) {
+ throw new WebApplicationException(ex, 401);
+ }
+ if (dr.getFaultInfo().countainsErrorCode(UDDIErrorHelper.lookupErrCode(UDDIErrorHelper.E_AUTH_TOKEN_REQUIRED))) {
+ throw new WebApplicationException(ex, 401);
+ }
+ if (dr.getFaultInfo().countainsErrorCode(UDDIErrorHelper.lookupErrCode(UDDIErrorHelper.E_FATAL_ERROR))) {
+ throw new WebApplicationException(ex, 500);
+ }
+ }
+ throw new WebApplicationException(ex, 400);
}
- if (ex.getFaultInfo().countainsErrorCode(UDDIErrorHelper.lookupErrCode(UDDIErrorHelper.E_AUTH_TOKEN_REQUIRED))) {
- throw new WebApplicationException(ex, 401);
+ private final int MAX_ROWS = 100;
+
+ private KeyBag getBusinessListData() {
+ FindBusiness fb = new FindBusiness();
+ fb.getName().add(new Name(UDDIConstants.WILDCARD, null));
+ fb.setFindQualifiers(new FindQualifiers());
+ fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ fb.setMaxRows(MAX_ROWS);
+ BusinessList findBusiness = null;
+ try {
+ findBusiness = inquiry.findBusiness(fb);
+ } catch (Exception ex) {
+ HandleException(ex);
+ }
+ KeyBag kb = new KeyBag();
+ if (findBusiness != null && findBusiness.getBusinessInfos() != null) {
+ for (int i = 0; i < findBusiness.getBusinessInfos().getBusinessInfo().size(); i++) {
+ kb.getBusinessKey().add(findBusiness.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey());
+ }
+ }
+ return kb;
}
- if (ex.getFaultInfo().countainsErrorCode(UDDIErrorHelper.lookupErrCode(UDDIErrorHelper.E_FATAL_ERROR))) {
- throw new WebApplicationException(ex, 500);
+
+ private KeyBag getServiceListData() {
+ FindService fb = new FindService();
+ fb.getName().add(new Name(UDDIConstants.WILDCARD, null));
+ fb.setFindQualifiers(new FindQualifiers());
+ fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ fb.setMaxRows(MAX_ROWS);
+ ServiceList findBusiness = null;
+ try {
+ findBusiness = inquiry.findService(fb);
+ } catch (Exception ex) {
+ HandleException(ex);
+ }
+ KeyBag kb = new KeyBag();
+ if (findBusiness != null && findBusiness.getServiceInfos() != null) {
+ for (int i = 0; i < findBusiness.getServiceInfos().getServiceInfo().size(); i++) {
+ kb.getServiceKey().add(findBusiness.getServiceInfos().getServiceInfo().get(i).getServiceKey());
+ }
+ }
+ return kb;
+ }
+
+ private KeyBag getTmodelListData() {
+ FindTModel fb = new FindTModel();
+ fb.setName(new Name(UDDIConstants.WILDCARD, null));
+ fb.setFindQualifiers(new FindQualifiers());
+ fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
+ fb.setMaxRows(MAX_ROWS);
+ TModelList findBusiness = null;
+ try {
+ findBusiness = inquiry.findTModel(fb);
+ } catch (Exception ex) {
+ HandleException(ex);
+ }
+ KeyBag kb = new KeyBag();
+ if (findBusiness != null && findBusiness.getTModelInfos() != null) {
+ for (int i = 0; i < findBusiness.getTModelInfos().getTModelInfo().size(); i++) {
+ kb.getTModelKey().add(findBusiness.getTModelInfos().getTModelInfo().get(i).getTModelKey());
+ }
+ }
+ return kb;
}
- throw new WebApplicationException(ex, 400);
- }
-}
+}
\ No newline at end of file
Modified: juddi/branches/juddi-3.3.x/juddi-rest-cxf/src/test/java/org/apache/juddi/api/impl/rest/UDDIInquiryJAXRSTest.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-rest-cxf/src/test/java/org/apache/juddi/api/impl/rest/UDDIInquiryJAXRSTest.java?rev=1549363&r1=1549358&r2=1549363&view=diff
==============================================================================
(empty)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org