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/01/21 20:59:15 UTC
svn commit: r1560160 - in /juddi/trunk:
juddi-client/src/main/java/org/apache/juddi/v3/client/
juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/
juddi-client/src/main/java/org/apache/juddi/v3/client/transport/
juddi-gui/src/main/java/org/a...
Author: alexoree
Date: Tue Jan 21 19:59:14 2014
New Revision: 1560160
URL: http://svn.apache.org/r1560160
Log:
JUDDI-782 updating mapping classes and transport classes to make it possible for the transport adapter to work
Modified:
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/UDDIServiceV2.java
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/MapUDDIv2Tov3.java
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/MapUDDIv3Tov2.java
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSTransport.java
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSv2TranslationTransport.java
juddi/trunk/juddi-gui/src/main/java/org/apache/juddi/webconsole/hub/UddiHub.java
juddi/trunk/juddi-gui/src/main/resources/META-INF/uddi.xml
juddi/trunk/juddi-gui/src/main/webapp/ajax/loginpost.jsp
Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/UDDIServiceV2.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/UDDIServiceV2.java?rev=1560160&r1=1560159&r2=1560160&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/UDDIServiceV2.java (original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/UDDIServiceV2.java Tue Jan 21 19:59:14 2014
@@ -20,7 +20,6 @@ import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
-import javax.xml.ws.WebServiceFeature;
import org.uddi.v2_service.Inquire;
import org.uddi.v2_service.Publish;
Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/MapUDDIv2Tov3.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/MapUDDIv2Tov3.java?rev=1560160&r1=1560159&r2=1560160&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/MapUDDIv2Tov3.java (original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/MapUDDIv2Tov3.java Tue Jan 21 19:59:14 2014
@@ -15,16 +15,16 @@
*/
package org.apache.juddi.v3.client.mapping;
-import java.util.AbstractSequentialList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.soap.SOAPFaultException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.juddi.api_v3.AccessPointType;
-import org.uddi.api_v2.BindingDetail;
-import org.uddi.api_v2.FindBusiness;
-import org.uddi.api_v2.PublisherAssertions;
+import org.apache.juddi.v3.client.transport.JAXWSv2TranslationTransport;
import org.uddi.api_v2.Truncated;
-import org.uddi.api_v2.URLType;
import org.uddi.api_v3.AccessPoint;
import org.uddi.api_v3.BindingTemplate;
import org.uddi.api_v3.BindingTemplates;
@@ -43,6 +43,7 @@ import org.uddi.api_v3.IdentifierBag;
import org.uddi.api_v3.InstanceDetails;
import org.uddi.api_v3.KeyType;
import org.uddi.api_v3.KeyedReference;
+import org.uddi.api_v3.ListDescription;
import org.uddi.api_v3.Name;
import org.uddi.api_v3.OverviewDoc;
import org.uddi.api_v3.OverviewURL;
@@ -288,7 +289,13 @@ public class MapUDDIv2Tov3 {
public static BusinessList MapBusinessList(org.uddi.api_v2.BusinessList findBinding) {
org.uddi.api_v3.BusinessList r = new org.uddi.api_v3.BusinessList();
+ r.setListDescription(new ListDescription());
+ r.getListDescription().setActualCount(0);
+ r.getListDescription().setIncludeCount(0);
+ r.getListDescription().setListHead(0);
if (findBinding.getBusinessInfos() != null) {
+ r.getListDescription().setIncludeCount(findBinding.getBusinessInfos().getBusinessInfo().size());
+ r.getListDescription().setActualCount(findBinding.getBusinessInfos().getBusinessInfo().size());
r.setBusinessInfos(new BusinessInfos());
r.getBusinessInfos().getBusinessInfo().addAll(MapBusinessInfo(findBinding.getBusinessInfos().getBusinessInfo()));
@@ -315,8 +322,15 @@ public class MapUDDIv2Tov3 {
return null;
}
ServiceList r = new ServiceList();
+ r.setListDescription(new ListDescription());
+ r.getListDescription().setActualCount(0);
+ r.getListDescription().setIncludeCount(0);
+ r.getListDescription().setListHead(0);
+
if (serviceDetail.getServiceInfos() != null) {
r.setServiceInfos(new ServiceInfos());
+ r.getListDescription().setIncludeCount(serviceDetail.getServiceInfos().getServiceInfo().size());
+ r.getListDescription().setActualCount(serviceDetail.getServiceInfos().getServiceInfo().size());
for (int i = 0; i < serviceDetail.getServiceInfos().getServiceInfo().size(); i++) {
ServiceInfo x = new ServiceInfo();
x.setBusinessKey(serviceDetail.getServiceInfos().getServiceInfo().get(i).getBusinessKey());
@@ -367,8 +381,15 @@ public class MapUDDIv2Tov3 {
public static TModelList MapTModelList(org.uddi.api_v2.TModelList findTModel) {
org.uddi.api_v3.TModelList r = new org.uddi.api_v3.TModelList();
+ r.setListDescription(new ListDescription());
+ r.getListDescription().setActualCount(0);
+ r.getListDescription().setIncludeCount(0);
+ r.getListDescription().setListHead(0);
+
if (findTModel.getTModelInfos() != null) {
r.setTModelInfos(new TModelInfos());
+ r.getListDescription().setIncludeCount(findTModel.getTModelInfos().getTModelInfo().size());
+ r.getListDescription().setActualCount(findTModel.getTModelInfos().getTModelInfo().size());
for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
TModelInfo x = new TModelInfo();
x.setName(new Name(findTModel.getTModelInfos().getTModelInfo().get(i).getName().getValue(), findTModel.getTModelInfos().getTModelInfo().get(i).getName().getLang()));
@@ -382,7 +403,6 @@ public class MapUDDIv2Tov3 {
return r;
}
-
public static List<PublisherAssertion> MapListPublisherAssertion(org.uddi.api_v2.PublisherAssertions publisherAssertions) {
List<PublisherAssertion> r = new ArrayList<PublisherAssertion>();
if (publisherAssertions == null) {
@@ -493,6 +513,32 @@ public class MapUDDIv2Tov3 {
return r;
}
-
+ public static DispositionReportFaultMessage MapException(SOAPFaultException ex) {
+ org.uddi.api_v3.DispositionReport r = new org.uddi.api_v3.DispositionReport();
+ r.setTruncated(false);
+ r.getResult().addAll(MapFault(ex.getFault()));
+
+ DispositionReportFaultMessage x = new DispositionReportFaultMessage(ex.getMessage(), r);
+ return x;
+ }
+ private static List<Result> MapFault(SOAPFault result) {
+ List<Result> r = new ArrayList<Result>();
+ if (result == null) {
+ return r;
+ }
+ while (result.getDetail().getDetailEntries().hasNext()) {
+ Object next = result.getDetail().getDetailEntries().next();
+ if (next instanceof DispositionReport) {
+
+ DispositionReport z = (DispositionReport)next;
+ Result x = new Result();
+ r.addAll(MapResult(z.getFaultInfo().getResult()));
+
+ }
+ logger.warn("unable to parse fault detail, type:" + next.getClass().getCanonicalName()+" " + next.toString());
+ }
+ return r;
+ }
+ private static Log logger = LogFactory.getLog(MapUDDIv2Tov3.class);
}
Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/MapUDDIv3Tov2.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/MapUDDIv3Tov2.java?rev=1560160&r1=1560159&r2=1560160&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/MapUDDIv3Tov2.java (original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/MapUDDIv3Tov2.java Tue Jan 21 19:59:14 2014
@@ -16,7 +16,6 @@
package org.apache.juddi.v3.client.mapping;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
import javax.xml.ws.Holder;
import org.apache.juddi.v3.client.UDDIConstants;
@@ -158,7 +157,7 @@ public class MapUDDIv3Tov2 {
private static List<Name> MapName(List<org.uddi.api_v3.Name> name) {
List<Name> items = new ArrayList<Name>();
for (int i = 0; i < name.size(); i++) {
- Name n = new Name(name.get(i).getValue(), name.get(i).getValue());
+ Name n = new Name(name.get(i).getValue(), name.get(i).getLang());
items.add(n);
}
return items;
@@ -534,6 +533,51 @@ public class MapUDDIv3Tov2 {
if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase("uddi:uddi.org:categorization:types")) {
r.getFindQualifier().add("uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4");
}
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.EXACT_MATCH)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.EXACT_MATCH_TMODEL)) {
+ r.getFindQualifier().add("exactNameMatch");
+ }
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.CASE_SENSITIVE_MATCH)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.CASE_SENSITIVE_MATCH_TMODEL)) {
+ r.getFindQualifier().add("caseSensitiveMatch");
+ }
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.OR_ALL_KEYS)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.OR_ALL_KEYS_TMODEL)) {
+ r.getFindQualifier().add("orAllKeys");
+ }
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.OR_LIKE_KEYS)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.OR_LIKE_KEYS_TMODEL)) {
+ r.getFindQualifier().add("orLikeKeys");
+ }
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.AND_ALL_KEYS)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.AND_ALL_KEYS_TMODEL)) {
+ r.getFindQualifier().add("andAllKeys");
+ }
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.SORT_BY_DATE_ASC)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.SORT_BY_DATE_ASC_TMODEL)) {
+ r.getFindQualifier().add(UDDIConstants.SORT_BY_DATE_ASC);
+ }
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.SORT_BY_DATE_DESC)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.SORT_BY_DATE_DESC_TMODEL)) {
+ r.getFindQualifier().add(UDDIConstants.SORT_BY_DATE_DESC);
+ }
+
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.SORT_BY_NAME_ASC)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.SORT_BY_NAME_ASC_TMODEL)) {
+ r.getFindQualifier().add(UDDIConstants.SORT_BY_NAME_ASC);
+ }
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.SORT_BY_NAME_DESC)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.SORT_BY_NAME_DESC_TMODEL)) {
+ r.getFindQualifier().add(UDDIConstants.SORT_BY_NAME_DESC);
+ }
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.SERVICE_SUBSET)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.SERVICE_SUBSET_TMODEL)) {
+ r.getFindQualifier().add(UDDIConstants.SERVICE_SUBSET);
+ }
+ if (findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.COMBINE_CATEGORY_BAGS)
+ || findQualifiers.getFindQualifier().get(i).equalsIgnoreCase(UDDIConstants.COMBINE_CATEGORY_BAGS_TMODEL)) {
+ r.getFindQualifier().add(UDDIConstants.COMBINE_CATEGORY_BAGS);
+ }
}
return r;
}
Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSTransport.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSTransport.java?rev=1560160&r1=1560159&r2=1560160&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSTransport.java (original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSTransport.java Tue Jan 21 19:59:14 2014
@@ -38,225 +38,232 @@ import org.uddi.v3_service.UDDISecurityP
import org.uddi.v3_service.UDDISubscriptionListenerPortType;
import org.uddi.v3_service.UDDISubscriptionPortType;
-
public class JAXWSTransport extends Transport {
- private static Log logger = LogFactory.getLog(JAXWSTransport.class);
-
- String nodeName = null;
- String clientName = null;
- UDDIInquiryPortType inquiryService = null;
- UDDISecurityPortType securityService = null;
- UDDIPublicationPortType publishService = null;
- UDDISubscriptionPortType subscriptionService = null;
- UDDISubscriptionListenerPortType subscriptionListenerService = null;
- UDDICustodyTransferPortType custodyTransferService = null;
- JUDDIApiPortType publisherService = null;
-
- public JAXWSTransport() {
- super();
- this.nodeName = Transport.DEFAULT_NODE_NAME;
- }
-
- public JAXWSTransport(String nodeName) {
- super();
- this.nodeName = nodeName;
- }
-
- public JAXWSTransport(String clientName, String nodeName) {
- super();
- this.clientName = clientName;
- this.nodeName = nodeName;
- }
-
- public UDDIInquiryPortType getUDDIInquiryService(String endpointURL) throws TransportException {
- try {
- if (inquiryService==null) {
- if (endpointURL==null) {
- UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
- endpointURL = client.getClientConfig().getUDDINode(nodeName).getInquiryUrl();
- }
- UDDIService service = new UDDIService();
- inquiryService = service.getUDDIInquiryPort();
- }
- Map<String, Object> requestContext = ((BindingProvider) inquiryService).getRequestContext();
- requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
- setCredentials(requestContext);
- } catch (Exception e) {
- throw new TransportException(e.getMessage(), e);
- }
- return inquiryService;
- }
-
- public UDDISecurityPortType getUDDISecurityService(String endpointURL) throws TransportException {
- try {
- if (securityService==null) {
- if (endpointURL==null) {
- UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
- endpointURL = client.getClientConfig().getUDDINode(nodeName).getSecurityUrl();
- }
- UDDIService service = new UDDIService();
- securityService = service.getUDDISecurityPort();
- }
- Map<String, Object> requestContext = ((BindingProvider) securityService).getRequestContext();
- requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
- setCredentials(requestContext);
- } catch (Exception e) {
- throw new TransportException(e.getMessage(), e);
- }
- return securityService;
- }
-
- public UDDIPublicationPortType getUDDIPublishService(String endpointURL) throws TransportException {
- try {
- if (publishService==null) {
-
- if (endpointURL==null) {
- UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
- endpointURL = client.getClientConfig().getUDDINode(nodeName).getPublishUrl();
- }
- UDDIService service = new UDDIService();
- publishService = service.getUDDIPublicationPort();
- }
- Map<String, Object> requestContext = ((BindingProvider) publishService).getRequestContext();
- requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
- setCredentials(requestContext);
- } catch (Exception e) {
- throw new TransportException(e.getMessage(), e);
- }
- return publishService;
- }
-
- public UDDISubscriptionPortType getUDDISubscriptionService(String endpointURL) throws TransportException {
- try {
- if (subscriptionService==null) {
- if (endpointURL==null) {
- UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
- endpointURL = client.getClientConfig().getUDDINode(nodeName).getSubscriptionUrl();
- }
- UDDIService service = new UDDIService();
- subscriptionService = service.getUDDISubscriptionPort();
- }
- Map<String, Object> requestContext = ((BindingProvider) subscriptionService).getRequestContext();
- requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
- setCredentials(requestContext);
- } catch (Exception e) {
- throw new TransportException(e.getMessage(), e);
- }
- return subscriptionService;
- }
-
- public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService(String endpointURL) throws TransportException {
- try {
- if (subscriptionListenerService == null) {
- if (endpointURL==null) {
- UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
- endpointURL = client.getClientConfig().getUDDINode(nodeName).getSubscriptionListenerUrl();
- }
- UDDIService service = new UDDIService();
- subscriptionListenerService = service.getUDDISubscriptionListenerPort();
- }
- Map<String, Object> requestContext = ((BindingProvider) subscriptionListenerService).getRequestContext();
- requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
- setCredentials(requestContext);
- } catch (Exception e) {
- throw new TransportException(e.getMessage(), e);
- }
- return subscriptionListenerService;
- }
-
- public UDDICustodyTransferPortType getUDDICustodyTransferService(String endpointURL) throws TransportException {
- try {
- if (custodyTransferService == null) {
- if (endpointURL==null) {
- UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
- endpointURL = client.getClientConfig().getUDDINode(nodeName).getCustodyTransferUrl();
- }
- UDDIService service = new UDDIService();
- custodyTransferService = service.getUDDICustodyPort();
- }
- Map<String, Object> requestContext = ((BindingProvider) custodyTransferService).getRequestContext();
- requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
- setCredentials(requestContext);
- } catch (Exception e) {
- throw new TransportException(e.getMessage(), e);
- }
- return custodyTransferService;
- }
-
- /**
- * This is a jUDDI specific API
- */
- public JUDDIApiPortType getJUDDIApiService(String endpointURL) throws TransportException {
- try {
- if (publisherService == null) {
- if (endpointURL==null) {
- UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
- endpointURL = client.getClientConfig().getUDDINode(nodeName).getJuddiApiUrl();
- }
- JUDDIApiService service = new JUDDIApiService();
- publisherService = (JUDDIApiPortType) service.getPort(JUDDIApiPortType.class);
- }
- Map<String, Object> requestContext = ((BindingProvider) publisherService).getRequestContext();
- requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
- setCredentials(requestContext);
- } catch (Exception e) {
- throw new TransportException(e.getMessage(), e);
- }
- return publisherService;
- }
-
- public String getNodeName() {
- return nodeName;
- }
-
- public void setNodeName(String nodeName) {
- this.nodeName = nodeName;
- }
-
- /**
- * Sets the credentials on the RequestContext if the services are protected
- * by Basic Authentication. The username and password are obtained from the
- * uddi.xml.
- *
- * @param requestContext
- * @throws ConfigurationException
- */
- private void setCredentials(Map<String, Object> requestContext) throws ConfigurationException {
- UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
- Properties properties = client.getClientConfig().getUDDINode(nodeName).getProperties();
- if (properties!=null) {
- String username = null;
- String password = null;
- if (properties.containsKey(Property.BASIC_AUTH_USERNAME)) {
- username = properties.getProperty(Property.BASIC_AUTH_USERNAME);
- }
- if (properties.containsKey(Property.BASIC_AUTH_PASSWORD)) {
- password = properties.getProperty(Property.BASIC_AUTH_PASSWORD);
- }
- String cipher=null;
- boolean isEncrypted=false;
- if (properties.containsKey(Property.BASIC_AUTH_PASSWORD_CP)) {
- cipher = properties.getProperty(Property.BASIC_AUTH_PASSWORD_CP);
- }
- if (properties.containsKey(Property.BASIC_AUTH_PASSWORD_IS_ENC)) {
- isEncrypted = Boolean.parseBoolean(properties.getProperty(Property.BASIC_AUTH_PASSWORD_IS_ENC));
- }
- if (username!=null && password!=null) {
- requestContext.put(BindingProvider.USERNAME_PROPERTY, username);
- if (isEncrypted)
- {
- try {
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, CryptorFactory.getCryptor(cipher).decrypt(password));
- } catch (Exception ex) {
- logger.error("Unable to decrypt password!", ex);
- }
- }
- else
- {
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, password);
- }
- }
+
+ private static Log logger = LogFactory.getLog(JAXWSTransport.class);
+
+ String nodeName = null;
+ String clientName = null;
+ UDDIInquiryPortType inquiryService = null;
+ UDDISecurityPortType securityService = null;
+ UDDIPublicationPortType publishService = null;
+ UDDISubscriptionPortType subscriptionService = null;
+ UDDISubscriptionListenerPortType subscriptionListenerService = null;
+ UDDICustodyTransferPortType custodyTransferService = null;
+ JUDDIApiPortType publisherService = null;
+
+ public JAXWSTransport() {
+ super();
+ this.nodeName = Transport.DEFAULT_NODE_NAME;
+ }
+
+ public JAXWSTransport(String nodeName) {
+ super();
+ this.nodeName = nodeName;
+ }
+
+ public JAXWSTransport(String clientName, String nodeName) {
+ super();
+ this.clientName = clientName;
+ this.nodeName = nodeName;
+ }
+
+ public UDDIInquiryPortType getUDDIInquiryService(String endpointURL) throws TransportException {
+ try {
+ if (inquiryService == null) {
+ if (endpointURL == null) {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ endpointURL = client.getClientConfig().getUDDINode(nodeName).getInquiryUrl();
+ }
+ UDDIService service = new UDDIService();
+ inquiryService = service.getUDDIInquiryPort();
+ }
+ Map<String, Object> requestContext = ((BindingProvider) inquiryService).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
+ setCredentials(requestContext);
+ } catch (Exception e) {
+ throw new TransportException(e.getMessage(), e);
+ }
+ return inquiryService;
+ }
+
+ public UDDISecurityPortType getUDDISecurityService(String endpointURL) throws TransportException {
+ try {
+ if (securityService == null) {
+ if (endpointURL == null) {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ endpointURL = client.getClientConfig().getUDDINode(nodeName).getSecurityUrl();
+ }
+ UDDIService service = new UDDIService();
+ securityService = service.getUDDISecurityPort();
+ }
+ if (endpointURL != null) {
+ Map<String, Object> requestContext = ((BindingProvider) securityService).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
+ setCredentials(requestContext);
+ }
+ } catch (Exception e) {
+ throw new TransportException(e.getMessage(), e);
+ }
+ return securityService;
+ }
+
+ public UDDIPublicationPortType getUDDIPublishService(String endpointURL) throws TransportException {
+ try {
+ if (publishService == null) {
+
+ if (endpointURL == null) {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ endpointURL = client.getClientConfig().getUDDINode(nodeName).getPublishUrl();
+ }
+ UDDIService service = new UDDIService();
+ publishService = service.getUDDIPublicationPort();
+ }
+ Map<String, Object> requestContext = ((BindingProvider) publishService).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
+ setCredentials(requestContext);
+ } catch (Exception e) {
+ throw new TransportException(e.getMessage(), e);
+ }
+ return publishService;
+ }
+
+ public UDDISubscriptionPortType getUDDISubscriptionService(String endpointURL) throws TransportException {
+ try {
+ if (subscriptionService == null) {
+ if (endpointURL == null) {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ endpointURL = client.getClientConfig().getUDDINode(nodeName).getSubscriptionUrl();
+ }
+ UDDIService service = new UDDIService();
+ subscriptionService = service.getUDDISubscriptionPort();
+ }
+ if (endpointURL != null) {
+ Map<String, Object> requestContext = ((BindingProvider) subscriptionService).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
+ setCredentials(requestContext);
+ }
+ } catch (Exception e) {
+ throw new TransportException(e.getMessage(), e);
+ }
+ return subscriptionService;
+ }
+
+ public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService(String endpointURL) throws TransportException {
+ try {
+ if (subscriptionListenerService == null) {
+ if (endpointURL == null) {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ endpointURL = client.getClientConfig().getUDDINode(nodeName).getSubscriptionListenerUrl();
+ }
+ UDDIService service = new UDDIService();
+ subscriptionListenerService = service.getUDDISubscriptionListenerPort();
+ }
+ if (endpointURL != null) {
+ Map<String, Object> requestContext = ((BindingProvider) subscriptionListenerService).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
+ setCredentials(requestContext);
+ }
+ } catch (Exception e) {
+ throw new TransportException(e.getMessage(), e);
+ }
+ return subscriptionListenerService;
+ }
+
+ public UDDICustodyTransferPortType getUDDICustodyTransferService(String endpointURL) throws TransportException {
+ try {
+ if (custodyTransferService == null) {
+ if (endpointURL == null) {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ endpointURL = client.getClientConfig().getUDDINode(nodeName).getCustodyTransferUrl();
+ }
+ UDDIService service = new UDDIService();
+ custodyTransferService = service.getUDDICustodyPort();
+ }
+ if (endpointURL != null) {
+ Map<String, Object> requestContext = ((BindingProvider) custodyTransferService).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
+ setCredentials(requestContext);
+ }
+ } catch (Exception e) {
+ throw new TransportException(e.getMessage(), e);
+ }
+ return custodyTransferService;
+ }
+
+ /**
+ * This is a jUDDI specific API
+ */
+ public JUDDIApiPortType getJUDDIApiService(String endpointURL) throws TransportException {
+ try {
+ if (publisherService == null) {
+ if (endpointURL == null) {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ endpointURL = client.getClientConfig().getUDDINode(nodeName).getJuddiApiUrl();
+ }
+ JUDDIApiService service = new JUDDIApiService();
+ publisherService = (JUDDIApiPortType) service.getPort(JUDDIApiPortType.class);
+ }
+ if (endpointURL != null) {
+ Map<String, Object> requestContext = ((BindingProvider) publisherService).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
+ setCredentials(requestContext);
+ }
+ } catch (Exception e) {
+ throw new TransportException(e.getMessage(), e);
+ }
+ return publisherService;
+ }
+
+ public String getNodeName() {
+ return nodeName;
+ }
+
+ public void setNodeName(String nodeName) {
+ this.nodeName = nodeName;
+ }
+
+ /**
+ * Sets the credentials on the RequestContext if the services are
+ * protected by Basic Authentication. The username and password are
+ * obtained from the uddi.xml.
+ *
+ * @param requestContext
+ * @throws ConfigurationException
+ */
+ private void setCredentials(Map<String, Object> requestContext) throws ConfigurationException {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ Properties properties = client.getClientConfig().getUDDINode(nodeName).getProperties();
+ if (properties != null) {
+ String username = null;
+ String password = null;
+ if (properties.containsKey(Property.BASIC_AUTH_USERNAME)) {
+ username = properties.getProperty(Property.BASIC_AUTH_USERNAME);
+ }
+ if (properties.containsKey(Property.BASIC_AUTH_PASSWORD)) {
+ password = properties.getProperty(Property.BASIC_AUTH_PASSWORD);
+ }
+ String cipher = null;
+ boolean isEncrypted = false;
+ if (properties.containsKey(Property.BASIC_AUTH_PASSWORD_CP)) {
+ cipher = properties.getProperty(Property.BASIC_AUTH_PASSWORD_CP);
+ }
+ if (properties.containsKey(Property.BASIC_AUTH_PASSWORD_IS_ENC)) {
+ isEncrypted = Boolean.parseBoolean(properties.getProperty(Property.BASIC_AUTH_PASSWORD_IS_ENC));
+ }
+ if (username != null && password != null) {
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, username);
+ if (isEncrypted) {
+ try {
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, CryptorFactory.getCryptor(cipher).decrypt(password));
+ } catch (Exception ex) {
+ logger.error("Unable to decrypt password!", ex);
+ }
+ } else {
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, password);
+ }
+ }
}
- }
+ }
}
Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSv2TranslationTransport.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSv2TranslationTransport.java?rev=1560160&r1=1560159&r2=1560160&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSv2TranslationTransport.java (original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/transport/JAXWSv2TranslationTransport.java Tue Jan 21 19:59:14 2014
@@ -16,75 +16,24 @@
*/
package org.apache.juddi.v3.client.transport;
-import java.rmi.RemoteException;
-import java.util.List;
-import org.apache.juddi.v3.client.transport.*;
import java.util.Map;
import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.swing.text.DefaultEditorKit;
import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Holder;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.juddi.v3.client.UDDIServiceV2;
import org.apache.juddi.v3.client.config.Property;
import org.apache.juddi.v3.client.config.UDDIClient;
import org.apache.juddi.v3.client.config.UDDIClientContainer;
import org.apache.juddi.v3.client.cryptor.CryptorFactory;
-import org.apache.juddi.v3.client.mapping.MapUDDIv2Tov3;
-import org.apache.juddi.v3.client.mapping.MapUDDIv3Tov2;
-import org.apache.juddi.v3_service.JUDDIApiPortType;
-import org.uddi.api_v2.PublisherAssertions;
-import org.uddi.api_v2.SetPublisherAssertions;
-import org.uddi.api_v3.AddPublisherAssertions;
-import org.uddi.api_v3.AssertionStatusItem;
-import org.uddi.api_v3.BindingDetail;
-import org.uddi.api_v3.BusinessDetail;
-import org.uddi.api_v3.BusinessList;
-import org.uddi.api_v3.CompletionStatus;
-import org.uddi.api_v3.DeleteBinding;
-import org.uddi.api_v3.DeleteBusiness;
-import org.uddi.api_v3.DeletePublisherAssertions;
-import org.uddi.api_v3.DeleteService;
-import org.uddi.api_v3.DeleteTModel;
-import org.uddi.api_v3.FindBinding;
-import org.uddi.api_v3.FindBusiness;
-import org.uddi.api_v3.FindRelatedBusinesses;
-import org.uddi.api_v3.FindService;
-import org.uddi.api_v3.FindTModel;
-import org.uddi.api_v3.GetBindingDetail;
-import org.uddi.api_v3.GetBusinessDetail;
-import org.uddi.api_v3.GetOperationalInfo;
-import org.uddi.api_v3.GetRegisteredInfo;
-import org.uddi.api_v3.GetServiceDetail;
-import org.uddi.api_v3.GetTModelDetail;
-import org.uddi.api_v3.OperationalInfos;
-import org.uddi.api_v3.PublisherAssertion;
-import org.uddi.api_v3.RegisteredInfo;
-import org.uddi.api_v3.RelatedBusinessesList;
-import org.uddi.api_v3.SaveBinding;
-import org.uddi.api_v3.SaveBusiness;
-import org.uddi.api_v3.SaveService;
-import org.uddi.api_v3.SaveTModel;
-import org.uddi.api_v3.ServiceDetail;
-import org.uddi.api_v3.ServiceList;
-import org.uddi.api_v3.TModelDetail;
-import org.uddi.api_v3.TModelList;
-import org.uddi.v2_service.DispositionReport;
-import org.uddi.v2_service.Inquire;
-import org.uddi.v2_service.Publish;
-import org.uddi.v3_service.DispositionReportFaultMessage;
-import org.uddi.v3_service.UDDICustodyTransferPortType;
+import org.apache.juddi.v3.client.transport.wrapper.Inquiry3to2;
+import org.apache.juddi.v3.client.transport.wrapper.Publish3to2;
+import org.apache.juddi.v3.client.transport.wrapper.Security3to2;
import org.uddi.v3_service.UDDIInquiryPortType;
import org.uddi.v3_service.UDDIPublicationPortType;
import org.uddi.v3_service.UDDISecurityPortType;
-import org.uddi.v3_service.UDDISubscriptionListenerPortType;
-import org.uddi.v3_service.UDDISubscriptionPortType;
/**
* JAXWS Transport for UDDIv2 bindings. Use this class for accessing UDDIv2
@@ -93,15 +42,13 @@ import org.uddi.v3_service.UDDISubscript
* @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
* @since 3.2
*/
-public class JAXWSv2TranslationTransport extends JAXWSTransport implements UDDIInquiryPortType, UDDIPublicationPortType {
+public class JAXWSv2TranslationTransport extends JAXWSTransport {
private static Log logger = LogFactory.getLog(JAXWSv2TranslationTransport.class);
- String nodeName = null;
- String clientName = null;
- Inquire inquiryService = null;
-
- Publish publishService = null;
+ Inquiry3to2 inquiryv2 = null;
+ Security3to2 securityv2 = null;
+ Publish3to2 publishv2 = null;
public JAXWSv2TranslationTransport() {
super();
@@ -119,45 +66,6 @@ public class JAXWSv2TranslationTransport
this.nodeName = nodeName;
}
- public Inquire getUDDIInquiryv2Service(String endpointURL) throws TransportException {
- try {
- if (inquiryService == null) {
- if (endpointURL == null) {
- UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
- endpointURL = client.getClientConfig().getUDDINode(nodeName).getInquiryUrl();
- }
- UDDIServiceV2 service = new UDDIServiceV2();
- inquiryService = service.getInquire();
- }
- Map<String, Object> requestContext = ((BindingProvider) inquiryService).getRequestContext();
- requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
- setCredentials(requestContext);
- } catch (Exception e) {
- throw new TransportException(e.getMessage(), e);
- }
- return inquiryService;
- }
-
- public Publish getUDDIPublishv2Service(String endpointURL) throws TransportException {
- try {
- if (publishService == null) {
-
- if (endpointURL == null) {
- UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
- endpointURL = client.getClientConfig().getUDDINode(nodeName).getPublishUrl();
- }
- UDDIServiceV2 service = new UDDIServiceV2();
- publishService = service.getPublish();
- }
- Map<String, Object> requestContext = ((BindingProvider) publishService).getRequestContext();
- requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
- setCredentials(requestContext);
- } catch (Exception e) {
- throw new TransportException(e.getMessage(), e);
- }
- return publishService;
- }
-
public String getNodeName() {
return nodeName;
}
@@ -211,248 +119,66 @@ public class JAXWSv2TranslationTransport
@Override
public UDDIInquiryPortType getUDDIInquiryService(String endpointURL) throws TransportException {
- getUDDIInquiryv2Service(endpointURL);
- return this;
- }
-
- @Override
- public UDDISecurityPortType getUDDISecurityService(String endpointURL) throws TransportException {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- public UDDIPublicationPortType getUDDIPublishService(String endpointURL) throws TransportException {
- getUDDIPublishv2Service(endpointURL);
- return this;
- }
-
- @Override
- public UDDISubscriptionPortType getUDDISubscriptionService(String enpointURL) throws TransportException {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- public UDDICustodyTransferPortType getUDDICustodyTransferService(String enpointURL) throws TransportException {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- public UDDISubscriptionListenerPortType getUDDISubscriptionListenerService(String enpointURL) throws TransportException {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- public BindingDetail findBinding(FindBinding body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapBindingDetail(inquiryService.findBinding(MapUDDIv3Tov2.MapFindBinding(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public BusinessList findBusiness(FindBusiness body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapBusinessList(inquiryService.findBusiness(MapUDDIv3Tov2.MapFindBusiness(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public RelatedBusinessesList findRelatedBusinesses(FindRelatedBusinesses body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapRelatedBusinessesList(inquiryService.findRelatedBusinesses(MapUDDIv3Tov2.MapFindRelatedBusiness(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public ServiceList findService(FindService body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapServiceList(inquiryService.findService(MapUDDIv3Tov2.MapFindService(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public TModelList findTModel(FindTModel body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapTModelList(inquiryService.findTModel(MapUDDIv3Tov2.MapFindTModel(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public BindingDetail getBindingDetail(GetBindingDetail body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapBindingDetail(inquiryService.getBindingDetail(MapUDDIv3Tov2.MapGetBindingDetail(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public BusinessDetail getBusinessDetail(GetBusinessDetail body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapBusinessDetail(inquiryService.getBusinessDetail(MapUDDIv3Tov2.MapGetBusinessDetail(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public OperationalInfos getOperationalInfo(GetOperationalInfo body) throws DispositionReportFaultMessage, RemoteException {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- public ServiceDetail getServiceDetail(GetServiceDetail body) throws DispositionReportFaultMessage, RemoteException {
try {
- return MapUDDIv2Tov3.MapServiceDetail(inquiryService.getServiceDetail(MapUDDIv3Tov2.MapGetServiceDetail(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
+ if (inquiryv2 == null) {
+ inquiryv2 = new Inquiry3to2();
- @Override
- public TModelDetail getTModelDetail(GetTModelDetail body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapTModelDetail(inquiryService.getTModelDetail(MapUDDIv3Tov2.MapGetTModelDetail(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public void addPublisherAssertions(AddPublisherAssertions body) throws DispositionReportFaultMessage, RemoteException {
- try {
- publishService.addPublisherAssertions(MapUDDIv3Tov2.MapAddPublisherAssertions(body));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
+ }
+ if (endpointURL == null) {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ endpointURL = client.getClientConfig().getUDDINode(nodeName).getInquiryUrl();
+ }
+ Map<String, Object> requestContext = ((BindingProvider) inquiryv2).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
+ setCredentials(requestContext);
+ } catch (Exception e) {
+ throw new TransportException(e.getMessage(), e);
}
- }
+ return inquiryv2;
- @Override
- public void deleteBinding(DeleteBinding body) throws DispositionReportFaultMessage, RemoteException {
- try {
- publishService.deleteBinding(MapUDDIv3Tov2.MapDeleteBinding(body));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
}
@Override
- public void deleteBusiness(DeleteBusiness body) throws DispositionReportFaultMessage, RemoteException {
+ public UDDISecurityPortType getUDDISecurityService(String endpointURL) throws TransportException {
try {
- publishService.deleteBusiness(MapUDDIv3Tov2.MapDeleteBusiness(body));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public void deletePublisherAssertions(DeletePublisherAssertions body) throws DispositionReportFaultMessage, RemoteException {
- try {
- publishService.deletePublisherAssertions(MapUDDIv3Tov2.MapDeletePublisherAssertions(body));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public void deleteService(DeleteService body) throws DispositionReportFaultMessage, RemoteException {
- try {
- publishService.deleteService(MapUDDIv3Tov2.MapDeleteService(body));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public void deleteTModel(DeleteTModel body) throws DispositionReportFaultMessage, RemoteException {
- try {
- publishService.deleteTModel(MapUDDIv3Tov2.MapDeleteTModel(body));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
+ if (securityv2 == null) {
+ securityv2 = new Security3to2();
- @Override
- public List<AssertionStatusItem> getAssertionStatusReport(String authInfo, CompletionStatus completionStatus) throws DispositionReportFaultMessage, RemoteException {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- public List<PublisherAssertion> getPublisherAssertions(String authInfo) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapListPublisherAssertion(publishService.getPublisherAssertions(MapUDDIv3Tov2.MapGetPublisherAssertions(authInfo)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
+ }
- @Override
- public RegisteredInfo getRegisteredInfo(GetRegisteredInfo body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapListRegisteredInfo(publishService.getRegisteredInfo(MapUDDIv3Tov2.MapGetRegisteredInfo(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
+ if (endpointURL == null) {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ endpointURL = client.getClientConfig().getUDDINode(nodeName).getPublishUrl();
+ }
+ Map<String, Object> requestContext = ((BindingProvider) securityv2).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
+ setCredentials(requestContext);
+ } catch (Exception e) {
+ throw new TransportException(e.getMessage(), e);
}
-
-
-
- }
+ return securityv2;
- @Override
- public BindingDetail saveBinding(SaveBinding body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapBindingDetail(publishService.saveBinding(MapUDDIv3Tov2.MapSaveBinding(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
}
@Override
- public BusinessDetail saveBusiness(SaveBusiness body) throws DispositionReportFaultMessage, RemoteException {
+ public UDDIPublicationPortType getUDDIPublishService(String endpointURL) throws TransportException {
try {
- return MapUDDIv2Tov3.MapBusinessDetail(publishService.saveBusiness(MapUDDIv3Tov2.MapSaveBusiness(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public ServiceDetail saveService(SaveService body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapServiceDetail(publishService.saveService(MapUDDIv3Tov2.MapSaveService(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
-
- @Override
- public TModelDetail saveTModel(SaveTModel body) throws DispositionReportFaultMessage, RemoteException {
- try {
- return MapUDDIv2Tov3.MapTModelDetail(publishService.saveTModel(MapUDDIv3Tov2.MapSaveTModel(body)));
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
- }
- }
+ if (publishv2 == null) {
+ publishv2 = new Publish3to2();
- @Override
- public void setPublisherAssertions(String authInfo, Holder<List<PublisherAssertion>> publisherAssertion) throws DispositionReportFaultMessage, RemoteException {
- try {
- SetPublisherAssertions req = MapUDDIv3Tov2.MapSetPublisherAssertions(publisherAssertion.value);
- PublisherAssertions setPublisherAssertions = publishService.setPublisherAssertions(req);
- publisherAssertion.value = MapUDDIv2Tov3.MapListPublisherAssertion(setPublisherAssertions);
+ }
+ if (endpointURL == null) {
+ UDDIClient client = UDDIClientContainer.getUDDIClient(clientName);
+ endpointURL = client.getClientConfig().getUDDINode(nodeName).getPublishUrl();
+ }
- } catch (DispositionReport ex) {
- throw MapUDDIv2Tov3.MapException(ex);
+ Map<String, Object> requestContext = ((BindingProvider) publishv2).getRequestContext();
+ requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
+ setCredentials(requestContext);
+ } catch (Exception e) {
+ throw new TransportException(e.getMessage(), e);
}
+ return publishv2;
}
}
Modified: juddi/trunk/juddi-gui/src/main/java/org/apache/juddi/webconsole/hub/UddiHub.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-gui/src/main/java/org/apache/juddi/webconsole/hub/UddiHub.java?rev=1560160&r1=1560159&r2=1560160&view=diff
==============================================================================
--- juddi/trunk/juddi-gui/src/main/java/org/apache/juddi/webconsole/hub/UddiHub.java (original)
+++ juddi/trunk/juddi-gui/src/main/java/org/apache/juddi/webconsole/hub/UddiHub.java Tue Jan 21 19:59:14 2014
@@ -115,23 +115,23 @@ public class UddiHub implements Serializ
*/
public static final String PROP_CONFIG_NODE = "config.props.node";
/**
- *"config.props.authtype"
+ * "config.props.authtype"
*/
public static final String PROP_AUTH_TYPE = "config.props.authtype";
/**
- *"config.props.automaticLogouts.enable"
+ * "config.props.automaticLogouts.enable"
*/
public static final String PROP_AUTO_LOGOUT = "config.props.automaticLogouts.enable";
/**
- *"config.props.automaticLogouts.duration"
+ * "config.props.automaticLogouts.duration"
*/
public static final String PROP_AUTO_LOGOUT_TIMER = "config.props.automaticLogouts.duration";
/**
- *"config.props."
+ * "config.props."
*/
public static final String PROP_PREFIX = "config.props.";
/**
- *"config.props.configLocalHostOnly"
+ * "config.props.configLocalHostOnly"
*
*/
public static final String PROP_ADMIN_LOCALHOST_ONLY = "config.props.configLocalHostOnly";
@@ -313,6 +313,7 @@ public class UddiHub implements Serializ
private void EnsureConfig() {
if (clientConfig == null) {
+ String clazz = null;
try {
UDDIClient client = new UDDIClient();
clientConfig = client.getClientConfig();
@@ -330,33 +331,31 @@ public class UddiHub implements Serializ
}
UDDINode uddiNode = clientConfig.getUDDINode(nodename);
- String clazz = uddiNode.getProxyTransport();
- if (clazz.contains("JAXWSTransport")) {
+ clazz = uddiNode.getProxyTransport();
+ if (clazz.contains("JAXWS")) {
WS_Transport = true;
}
- Class<?> transportClass = ClassUtil.forName(clazz, Transport.class);
- if (transportClass != null) {
- transport = client.getTransport(nodename);
- security = transport.getUDDISecurityService();
- inquiry = transport.getUDDIInquiryService();
- subscription = transport.getUDDISubscriptionService();
- publish = transport.getUDDIPublishService();
- custody = transport.getUDDICustodyTransferService();
-
- if (WS_Transport) {
- if (uddiNode.getPublishUrl().toLowerCase().startsWith("https://")
- && (uddiNode.getSecurityUrl() != null && uddiNode.getSecurityUrl().toLowerCase().startsWith("https://"))
- && uddiNode.getInquiryUrl().toLowerCase().startsWith("https://")
- && (uddiNode.getCustodyTransferUrl() != null && uddiNode.getCustodyTransferUrl().toLowerCase().startsWith("https://"))
- && uddiNode.getSubscriptionUrl().toLowerCase().startsWith("https://")) {
- WS_securePorts = true;
- }
- }
+ transport = client.getTransport(nodename);
+ security = transport.getUDDISecurityService();
+ inquiry = transport.getUDDIInquiryService();
+ subscription = transport.getUDDISubscriptionService();
+ publish = transport.getUDDIPublishService();
+ custody = transport.getUDDICustodyTransferService();
+
+ if (WS_Transport) {
+ if (uddiNode.getPublishUrl().toLowerCase().startsWith("https://")
+ && (uddiNode.getSecurityUrl() != null && uddiNode.getSecurityUrl().toLowerCase().startsWith("https://"))
+ && uddiNode.getInquiryUrl().toLowerCase().startsWith("https://")
+ && (uddiNode.getCustodyTransferUrl() != null && uddiNode.getCustodyTransferUrl().toLowerCase().startsWith("https://"))
+ && (uddiNode.getSubscriptionUrl() != null && uddiNode.getSubscriptionUrl().toLowerCase().startsWith("https://"))) {
+ WS_securePorts = true;
+ }
}
} catch (Exception ex) {
HandleException(ex);
+ log.info("DEBUG info node=" + nodename + " transport=" + clazz);
}
}
@@ -571,9 +570,15 @@ public class UddiHub implements Serializ
if (findBusiness == null || findBusiness.getBusinessInfos() == null) {
ret.renderedHtml = (ResourceLoader.GetResource(session, "errors.nodatareturned"));
} else {
- ret.displaycount = findBusiness.getListDescription().getIncludeCount();
- ret.offset = findBusiness.getListDescription().getListHead();
- ret.totalrecords = findBusiness.getListDescription().getActualCount();
+ if (findBusiness.getListDescription() != null) {
+ ret.displaycount = findBusiness.getListDescription().getIncludeCount();
+ ret.offset = findBusiness.getListDescription().getListHead();
+ ret.totalrecords = findBusiness.getListDescription().getActualCount();
+ } else {
+ ret.displaycount = findBusiness.getBusinessInfos().getBusinessInfo().size();
+ ret.offset = offset;
+ ret.totalrecords = findBusiness.getBusinessInfos().getBusinessInfo().size();
+ }
ret.renderedHtml = Printers.BusinessListAsTable(findBusiness, session, isChooser);
}
@@ -1020,7 +1025,6 @@ public class UddiHub implements Serializ
return SaveBusinessDetails(be);
}
-
/**
* Gets a business's details used for the businessEditor
*
@@ -1218,20 +1222,32 @@ public class UddiHub implements Serializ
DispositionReportFaultMessage f = (DispositionReportFaultMessage) ex;
log.error(ex.getMessage() + (f.detail != null && f.detail.getMessage() != null ? StringEscapeUtils.escapeHtml(f.detail.getMessage()) : ""));
log.debug(ex.getMessage(), ex);
- return ResourceLoader.GetResource(session, "errors.uddi") + " " + StringEscapeUtils.escapeHtml(ex.getMessage()) + " " + (f.detail != null && f.detail.getMessage() != null ? StringEscapeUtils.escapeHtml(f.detail.getMessage()) : "");
+ return ResourceLoader.GetResource(session, "errors.uddi") + " " + StringEscapeUtils.escapeHtml(ex.getMessage()) + " " + (f.detail != null && f.detail.getMessage() != null ? StringEscapeUtils.escapeHtml(f.detail.getMessage()) : "") + " " + ex.getClass().getCanonicalName();
} else if (ex instanceof RemoteException) {
RemoteException f = (RemoteException) ex;
log.error("RemoteException " + ex.getMessage());
log.debug("RemoteException " + ex.getMessage(), ex);
- return ResourceLoader.GetResource(session, "errors.generic") + " " + StringEscapeUtils.escapeHtml(ex.getMessage()) + " " + (f.detail != null && f.detail.getMessage() != null ? StringEscapeUtils.escapeHtml(f.detail.getMessage()) : "");
+ return ResourceLoader.GetResource(session, "errors.generic") + " " + StringEscapeUtils.escapeHtml(ex.getMessage()) + " " + (f.detail != null && f.detail.getMessage() != null ? StringEscapeUtils.escapeHtml(f.detail.getMessage()) : "") + " " + ex.getClass().getCanonicalName();
} else if (ex instanceof NullPointerException) {
log.error("NPE! Please report! " + ex.getMessage(), ex);
- log.debug("NPE! Please report! " + ex.getMessage(), ex);
- return ResourceLoader.GetResource(session, "errors.generic") + " " + StringEscapeUtils.escapeHtml(ex.getMessage());
+ return ResourceLoader.GetResource(session, "errors.generic") + " " + StringEscapeUtils.escapeHtml(ex.getMessage()) + " " + ex.getClass().getCanonicalName();
+ } else if (ex instanceof javax.xml.ws.soap.SOAPFaultException) {
+ javax.xml.ws.soap.SOAPFaultException x = (javax.xml.ws.soap.SOAPFaultException) ex;
+
+ log.error("SOAP Fault returned: " + x.getMessage() + (x.getFault()!=null ? x.getFault().getFaultString() : ""));
+ String err = null;
+ if (x.getFault() != null
+ && x.getFault().getDetail() != null) {
+ while (x.getFault().getDetail().getDetailEntries().hasNext()) {
+ err += x.getFault().getDetail().getDetailEntries().next().toString();
+ }
+ }
+ return ResourceLoader.GetResource(session, "errors.generic") + " " + StringEscapeUtils.escapeHtml(ex.getMessage() + " " + err) + " " + ex.getClass().getCanonicalName();
+
} else {
log.error("Unexpected error " + ex.getMessage(), ex);
//log.debug(ex.getMessage(), ex);
- return ResourceLoader.GetResource(session, "errors.generic") + " " + StringEscapeUtils.escapeHtml(ex.getMessage());
+ return ResourceLoader.GetResource(session, "errors.generic") + " " + StringEscapeUtils.escapeHtml(ex.getMessage()) + " " + ex.getClass().getCanonicalName();
}
}
@@ -2244,7 +2260,8 @@ public class UddiHub implements Serializ
}
/**
- *gets all of my subscriptions
+ * gets all of my subscriptions
+ *
* @return null if there's an error
*/
public List<Subscription> GetSubscriptions() {
@@ -2329,6 +2346,7 @@ public class UddiHub implements Serializ
/**
* gets the opinfo on an item
+ *
* @param id
* @return null if theres an error
*/
@@ -2364,7 +2382,7 @@ public class UddiHub implements Serializ
* GetOperationalInfo
*
* @param info
- * @return formatted html
+ * @return formatted html
*/
public String GetOperationalInfo(List<OperationalInfo> info) {
StringBuilder sb = new StringBuilder();
@@ -2546,7 +2564,7 @@ public class UddiHub implements Serializ
* @param tmodelkey
* @param keyname
* @param keyvalue
- * @return status msg
+ * @return status msg
*/
public String DeletePublisherAssertion(String tokey, String fromkey, String tmodelkey, String keyname, String keyvalue) {
DeletePublisherAssertions dp = new DeletePublisherAssertions();
@@ -2949,7 +2967,7 @@ public class UddiHub implements Serializ
* @param nodeid
* @param outExpires
* @param outToken
- * @return status
+ * @return status
*/
public String GetCustodyTransferToken(org.uddi.custody_v3.KeyBag keys, Holder<String> nodeid, Holder<XMLGregorianCalendar> outExpires, Holder<byte[]> outToken) {
Modified: juddi/trunk/juddi-gui/src/main/resources/META-INF/uddi.xml
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-gui/src/main/resources/META-INF/uddi.xml?rev=1560160&r1=1560159&r2=1560160&view=diff
==============================================================================
--- juddi/trunk/juddi-gui/src/main/resources/META-INF/uddi.xml (original)
+++ juddi/trunk/juddi-gui/src/main/resources/META-INF/uddi.xml Tue Jan 21 19:59:14 2014
@@ -8,6 +8,7 @@ It currently does not use the ValueSet,
<reloadDelay>5000</reloadDelay>
<client name="juddigui">
<nodes>
+
<node>
<!-- required 'default' node -->
<name>default</name>
@@ -20,6 +21,16 @@ It currently does not use the ValueSet,
<securityUrl>http://localhost:8080/juddiv3/services/security</securityUrl>
<subscriptionUrl>http://localhost:8080/juddiv3/services/subscription</subscriptionUrl>
</node>
+ <node>
+ <!-- for jUDDI v0.9 to 2.0.1 -->
+ <name>juddiv2</name>
+ <description>UDDIv2 Node</description>
+ <!-- JAX-WS Transport -->
+ <proxyTransport>org.apache.juddi.v3.client.transport.JAXWSv2TranslationTransport</proxyTransport>
+ <inquiryUrl>http://localhost:9080/juddi/inquiry</inquiryUrl>
+ <publishUrl>http://localhost:9080/juddi/publish</publishUrl>
+
+ </node>
<node>
<name>default-ssl</name>
<description>Main UDDI Node using SSL</description>
Modified: juddi/trunk/juddi-gui/src/main/webapp/ajax/loginpost.jsp
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-gui/src/main/webapp/ajax/loginpost.jsp?rev=1560160&r1=1560159&r2=1560160&view=diff
==============================================================================
--- juddi/trunk/juddi-gui/src/main/webapp/ajax/loginpost.jsp (original)
+++ juddi/trunk/juddi-gui/src/main/webapp/ajax/loginpost.jsp Tue Jan 21 19:59:14 2014
@@ -64,6 +64,8 @@
String msg = x.verifyLogin();
if (msg != null) {
+ session.removeAttribute("username");
+ session.removeAttribute("password");
response.setStatus(406);
out.write(msg);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org