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/02 01:51:48 UTC
svn commit: r1546875 [2/10] - in /juddi/branches/juddi-3.3.x: ./
juddi-client/src/main/java/org/apache/juddi/v3/client/config/
juddi-console/ juddi-core-openjpa/ juddi-core/src/main/java/org/apache/juddi/
juddi-core/src/main/java/org/apache/juddi/api/i...
Modified: juddi/branches/juddi-3.3.x/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java?rev=1546875&r1=1546874&r2=1546875&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java (original)
+++ juddi/branches/juddi-3.3.x/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java Mon Dec 2 00:51:47 2013
@@ -41,8 +41,8 @@ import org.apache.juddi.api_v3.Clerk;
import org.apache.juddi.api_v3.ClerkDetail;
import org.apache.juddi.api_v3.Node;
import org.apache.juddi.api_v3.NodeDetail;
-import org.apache.juddi.api_v3.SaveClerk;
-import org.apache.juddi.api_v3.SaveNode;
+import org.apache.juddi.api_v3.SaveClerkInfo;
+import org.apache.juddi.api_v3.SaveNodeInfo;
import org.apache.juddi.v3.client.UDDIConstants;
import org.apache.juddi.v3.client.cryptor.CryptorFactory;
import org.apache.juddi.v3.client.mapping.ReadWSDL;
@@ -92,1179 +92,1200 @@ import org.uddi.v3_service.DispositionRe
public class UDDIClerk implements Serializable {
- private static final long serialVersionUID = -8597375975981358134L;
-
- private Log log = LogFactory.getLog(this.getClass());
- protected String name;
- protected UDDINode uddiNode;
- protected String publisher;
- protected String password;
- private Date tokenBirthDate;
- private String authToken;
- private String cryptoProvider;
- private boolean isencrypted=false;
- private String[] classWithAnnotations;
- private WSDL[] wsdls;
- private String managerName;
- private Map<String, Properties> services = new HashMap<String, Properties>();
-
- public UDDIClerk() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- public UDDIClerk(Clerk clerk) {
- super();
- this.name = clerk.getName();
- this.password = clerk.getPassword();
- this.publisher = clerk.getPublisher();
- this.uddiNode = new UDDINode(clerk.getNode());
- }
-
- public String[] getClassWithAnnotations() {
- return classWithAnnotations;
- }
-
- public UDDINode getUDDINode()
- {
- return this.uddiNode;
- }
-
- public void setClassWithAnnotations(String[] classWithAnnotations) {
- this.classWithAnnotations = classWithAnnotations;
- }
-
- public Map<String, Properties> getServices() {
- return services;
- }
-
- public void setServices(Map<String, Properties> services) {
- this.services = services;
- }
-
- public String getManagerName() {
- return managerName;
- }
-
- public void setManagerName(String managerName) {
- this.managerName = managerName;
- }
-
- public void registerWsdls() {
- if (this.getWsdls() != null) {
- Properties properties = new Properties();
- properties.putAll(this.getUDDINode().getProperties());
-
- for (WSDL wsdl : this.getWsdls()) {
- try {
- URL wsdlUrl = this.getClass().getClassLoader().getResource(wsdl.getFileName());
- ReadWSDL rw = new ReadWSDL();
- Definition wsdlDefinition = rw.readWSDL(wsdlUrl);
- if (wsdl.keyDomain != null) {
- properties.setProperty("keyDomain", wsdl.keyDomain);
- }
- if (wsdl.businessKey != null) {
- properties.setProperty("businessKey", wsdl.getBusinessKey());
- }
+ private static final long serialVersionUID = -8597375975981358134L;
+ private Log log = LogFactory.getLog(this.getClass());
+ protected String name;
+ protected UDDINode uddiNode;
+ protected String publisher;
+ protected String password;
+ private Date tokenBirthDate;
+ private String authToken;
+ private String cryptoProvider;
+ private boolean isencrypted = false;
+ private String[] classWithAnnotations;
+ private WSDL[] wsdls;
+ private String managerName;
+ private Map<String, Properties> services = new HashMap<String, Properties>();
- WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(this, new URLLocalizerDefaultImpl(), properties);
- wsdl2UDDI.registerBusinessServices(wsdlDefinition);
+ public UDDIClerk() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ public UDDIClerk(Clerk clerk) {
+ super();
+ this.name = clerk.getName();
+ this.password = clerk.getPassword();
+ this.publisher = clerk.getPublisher();
+ this.uddiNode = new UDDINode(clerk.getNode());
+ }
+
+ public String[] getClassWithAnnotations() {
+ return classWithAnnotations;
+ }
+
+ public UDDINode getUDDINode() {
+ return this.uddiNode;
+ }
+
+ public void setClassWithAnnotations(String[] classWithAnnotations) {
+ this.classWithAnnotations = classWithAnnotations;
+ }
+
+ public Map<String, Properties> getServices() {
+ return services;
+ }
+
+ public void setServices(Map<String, Properties> services) {
+ this.services = services;
+ }
+
+ public String getManagerName() {
+ return managerName;
+ }
+
+ public void setManagerName(String managerName) {
+ this.managerName = managerName;
+ }
+
+ public void registerWsdls() {
+ if (this.getWsdls() != null) {
+ Properties properties = new Properties();
+ properties.putAll(this.getUDDINode().getProperties());
+
+ for (WSDL wsdl : this.getWsdls()) {
+ try {
+ URL wsdlUrl = this.getClass().getClassLoader().getResource(wsdl.getFileName());
+ ReadWSDL rw = new ReadWSDL();
+ Definition wsdlDefinition = rw.readWSDL(wsdlUrl);
+ if (wsdl.keyDomain != null) {
+ properties.setProperty("keyDomain", wsdl.keyDomain);
+ }
+ if (wsdl.businessKey != null) {
+ properties.setProperty("businessKey", wsdl.getBusinessKey());
+ }
+
+ WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(this, new URLLocalizerDefaultImpl(), properties);
+ wsdl2UDDI.registerBusinessServices(wsdlDefinition);
+ } catch (Exception e) {
+ log.error("Unable to register wsdl " + wsdl.getFileName() + " ." + e.getMessage(), e);
+ } catch (Throwable t) {
+ log.error("Unable to register wsdl " + wsdl.getFileName() + " ." + t.getMessage(), t);
+ }
+ }
+ }
+ }
+
+ public void registerWsdls(Definition wsdlDefinition, String keyDomain, String businessKey) {
+
+ try {
+ Properties properties = new Properties();
+ properties.putAll(this.getUDDINode().getProperties());
+ //Definition wsdlDefinition = rw.readWSDL(wsdlUrl);
+ if (keyDomain != null) {
+ properties.setProperty("keyDomain", keyDomain);
+ }
+ if (businessKey != null) {
+ properties.setProperty("businessKey", businessKey);
+ }
+
+ WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(this, new URLLocalizerDefaultImpl(), properties);
+ wsdl2UDDI.registerBusinessServices(wsdlDefinition);
+ } catch (Exception e) {
+ log.error("Unable to register wsdl " + " ." + e.getMessage(), e);
+ } catch (Throwable t) {
+ log.error("Unable to register wsdl " + " ." + t.getMessage(), t);
+ }
+ }
+
+ public void unRegisterWsdls() {
+ if (this.getWsdls() != null) {
+ Properties properties = new Properties();
+ properties.putAll(this.getUDDINode().getProperties());
+
+ for (WSDL wsdl : this.getWsdls()) {
+ try {
+ URL wsdlUrl = this.getClass().getClassLoader().getResource(wsdl.getFileName());
+ ReadWSDL rw = new ReadWSDL();
+ Definition wsdlDefinition = rw.readWSDL(wsdlUrl);
+ if (wsdl.keyDomain != null) {
+ properties.setProperty("keyDomain", wsdl.keyDomain);
+ }
+ if (wsdl.businessKey != null) {
+ properties.setProperty("businessKey", wsdl.getBusinessKey());
+ }
+
+ WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(this, new URLLocalizerDefaultImpl(), properties);
+ wsdl2UDDI.unRegisterBusinessServices(wsdlDefinition);
+ } catch (Exception e) {
+ log.error("Unable to register wsdl " + wsdl.getFileName() + " ." + e.getMessage(), e);
+ } catch (Throwable t) {
+ log.error("Unable to register wsdl " + wsdl.getFileName() + " ." + t.getMessage(), t);
+ }
+ }
+ }
+ }
+
+ public Subscription register(Subscription subscription) {
+ return register(subscription, this.getUDDINode().getApiNode());
+ }
+
+ /**
+ * Register a Subscription.
+ */
+ public Subscription register(Subscription subscription, Node node) {
+
+ log.info("Registering subscription with key " + subscription.getSubscriptionKey());
+ Holder<List<Subscription>> holder = new Holder<List<Subscription>>();
+ try {
+ List<Subscription> subscriptions = new ArrayList<Subscription>();
+ subscriptions.add(subscription);
+ holder.value = subscriptions;
+ getUDDINode().getTransport().getUDDISubscriptionService(node.getSubscriptionUrl()).
+ saveSubscription(getAuthToken(node.getSecurityUrl()), holder);
+ if (log.isDebugEnabled()) {
+ log.debug("Registering subscription " + subscription.getSubscriptionKey() + " completed.");
+ }
+ } catch (Exception e) {
+ log.error("Unable to register subscription " + subscription.getSubscriptionKey()
+ + " ." + e.getMessage(), e);
+ } catch (Throwable t) {
+ log.error("Unable to register subscriptionl " + subscription.getSubscriptionKey()
+ + " ." + t.getMessage(), t);
+ }
+ subscription = holder.value.get(0);
+ return subscription;
+ }
+
+ /**
+ * Register a tModel, using the node of current clerk ('this').
+ *
+ * @param tModel
+ * @return the TModelDetail of the newly registered TModel
+ */
+ public TModelDetail register(TModel tModel) {
+ return register(tModel, this.getUDDINode().getApiNode());
+ }
+
+ /**
+ * Register a tModel.
+ */
+ public TModelDetail register(TModel tModel, Node node) {
+ TModelDetail tModelDetail = null;
+ log.info("Registering tModel with key " + tModel.getTModelKey());
+ try {
+ SaveTModel saveTModel = new SaveTModel();
+ saveTModel.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ saveTModel.getTModel().add(tModel);
+ tModelDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveTModel(saveTModel);
+ if (log.isDebugEnabled()) {
+ log.debug("Registering tModel " + tModel.getTModelKey() + " completed.");
+ }
} catch (Exception e) {
- log.error("Unable to register wsdl " + wsdl.getFileName() + " ." + e.getMessage(), e);
+ log.error("Unable to register tModel " + tModel.getTModelKey()
+ + " ." + e.getMessage(), e);
} catch (Throwable t) {
- log.error("Unable to register wsdl " + wsdl.getFileName() + " ." + t.getMessage(), t);
+ log.error("Unable to register tModel " + tModel.getTModelKey()
+ + " ." + t.getMessage(), t);
}
- }
+ return tModelDetail;
}
- }
- public void registerWsdls(Definition wsdlDefinition, String keyDomain, String businessKey) {
+ /**
+ * Register a BindingTemplate, using the node of current clerk ('this').
+ *
+ */
+ public BindingTemplate register(BindingTemplate binding) {
+ return register(binding, this.getUDDINode().getApiNode());
+ }
+
+ /**
+ * Register a BindingTemplate.
+ *
+ */
+ public BindingTemplate register(BindingTemplate binding, Node node) {
- try {
- Properties properties = new Properties();
- properties.putAll(this.getUDDINode().getProperties());
- //Definition wsdlDefinition = rw.readWSDL(wsdlUrl);
- if (keyDomain != null) {
- properties.setProperty("keyDomain", keyDomain);
- }
- if (businessKey != null) {
- properties.setProperty("businessKey", businessKey);
- }
-
- WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(this, new URLLocalizerDefaultImpl(), properties);
- wsdl2UDDI.registerBusinessServices(wsdlDefinition);
- } catch (Exception e) {
- log.error("Unable to register wsdl " + " ." + e.getMessage(), e);
- } catch (Throwable t) {
- log.error("Unable to register wsdl " + " ." + t.getMessage(), t);
- }
- }
-
- public void unRegisterWsdls() {
- if (this.getWsdls() != null) {
- Properties properties = new Properties();
- properties.putAll(this.getUDDINode().getProperties());
-
- for (WSDL wsdl : this.getWsdls()) {
- try {
- URL wsdlUrl = this.getClass().getClassLoader().getResource(wsdl.getFileName());
- ReadWSDL rw = new ReadWSDL();
- Definition wsdlDefinition = rw.readWSDL(wsdlUrl);
- if (wsdl.keyDomain != null) {
- properties.setProperty("keyDomain", wsdl.keyDomain);
- }
- if (wsdl.businessKey != null) {
- properties.setProperty("businessKey", wsdl.getBusinessKey());
- }
+ BindingTemplate bindingTemplate = null;
+ log.info("Registering bindingTemplate with key " + binding.getBindingKey());
+ try {
+ SaveBinding saveBinding = new SaveBinding();
+ saveBinding.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ saveBinding.getBindingTemplate().add(binding);
+ BindingDetail bindingDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveBinding(saveBinding);
+ bindingTemplate = bindingDetail.getBindingTemplate().get(0);
+ if (log.isDebugEnabled()) {
+ log.debug("Registering template binding " + bindingTemplate.getBindingKey() + " completed.");
+ }
+ } catch (Exception e) {
+ log.error("Unable to register template binding " + binding.getBindingKey()
+ + " ." + e.getMessage(), e);
+ } catch (Throwable t) {
+ log.error("Unable to register template binding " + binding.getBindingKey()
+ + " ." + t.getMessage(), t);
+ }
+ return bindingTemplate;
+ }
- WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(this, new URLLocalizerDefaultImpl(), properties);
- wsdl2UDDI.unRegisterBusinessServices(wsdlDefinition);
+ /**
+ * Register a service, using the node of current clerk ('this').
+ *
+ */
+ public BusinessService register(BusinessService service) {
+ return register(service, this.getUDDINode().getApiNode());
+ }
+
+ /**
+ * Register a service.
+ *
+ */
+ public BusinessService register(BusinessService service, Node node) {
+
+ BusinessService businessService = null;
+ log.info("Registering service " + service.getName().get(0).getValue()
+ + " with key " + service.getServiceKey());
+ try {
+ SaveService saveService = new SaveService();
+ saveService.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ saveService.getBusinessService().add(service);
+ ServiceDetail serviceDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveService(saveService);
+ businessService = serviceDetail.getBusinessService().get(0);
+ if (log.isDebugEnabled()) {
+ log.debug("Registering service " + service.getName().get(0).getValue() + " completed.");
+ }
} catch (Exception e) {
- log.error("Unable to register wsdl " + wsdl.getFileName() + " ." + e.getMessage(), e);
+ log.error("Unable to register service " + service.getName().get(0).getValue()
+ + " ." + e.getMessage(), e);
} catch (Throwable t) {
- log.error("Unable to register wsdl " + wsdl.getFileName() + " ." + t.getMessage(), t);
+ log.error("Unable to register service " + service.getName().get(0).getValue()
+ + " ." + t.getMessage(), t);
}
- }
+ return businessService;
+ }
+
+ public BusinessEntity register(BusinessEntity business) {
+ return register(business, this.getUDDINode().getApiNode());
}
- }
- public Subscription register(Subscription subscription) {
- return register(subscription, this.getUDDINode().getApiNode());
- }
-
- /**
- * Register a Subscription.
- */
- public Subscription register(Subscription subscription, Node node) {
-
- log.info("Registering subscription with key " + subscription.getSubscriptionKey());
- Holder<List<Subscription>> holder = new Holder<List<Subscription>>();
- try {
- List<Subscription> subscriptions = new ArrayList<Subscription>();
- subscriptions.add(subscription);
- holder.value = subscriptions;
- getUDDINode().getTransport().getUDDISubscriptionService(node.getSubscriptionUrl()).
- saveSubscription(getAuthToken(node.getSecurityUrl()), holder);
- if (log.isDebugEnabled()) {
- log.debug("Registering subscription " + subscription.getSubscriptionKey() + " completed.");
- }
- } catch (Exception e) {
- log.error("Unable to register subscription " + subscription.getSubscriptionKey()
- + " ." + e.getMessage(), e);
- } catch (Throwable t) {
- log.error("Unable to register subscriptionl " + subscription.getSubscriptionKey()
- + " ." + t.getMessage(), t);
- }
- subscription = holder.value.get(0);
- return subscription;
- }
-
- /**
- * Register a tModel, using the node of current clerk ('this').
- *
- * @param tModel
- * @return the TModelDetail of the newly registered TModel
- */
- public TModelDetail register(TModel tModel) {
- return register(tModel, this.getUDDINode().getApiNode());
- }
-
- /**
- * Register a tModel.
- */
- public TModelDetail register(TModel tModel, Node node) {
- TModelDetail tModelDetail = null;
- log.info("Registering tModel with key " + tModel.getTModelKey());
- try {
- SaveTModel saveTModel = new SaveTModel();
- saveTModel.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- saveTModel.getTModel().add(tModel);
- tModelDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveTModel(saveTModel);
- if (log.isDebugEnabled()) {
- log.debug("Registering tModel " + tModel.getTModelKey() + " completed.");
- }
- } catch (Exception e) {
- log.error("Unable to register tModel " + tModel.getTModelKey()
- + " ." + e.getMessage(), e);
- } catch (Throwable t) {
- log.error("Unable to register tModel " + tModel.getTModelKey()
- + " ." + t.getMessage(), t);
- }
- return tModelDetail;
- }
-
- /**
- * Register a BindingTemplate, using the node of current clerk ('this').
- *
- */
- public BindingTemplate register(BindingTemplate binding) {
- return register(binding, this.getUDDINode().getApiNode());
- }
-
- /**
- * Register a BindingTemplate.
- *
- */
- public BindingTemplate register(BindingTemplate binding, Node node) {
-
- BindingTemplate bindingTemplate = null;
- log.info("Registering bindingTemplate with key " + binding.getBindingKey());
- try {
- SaveBinding saveBinding = new SaveBinding();
- saveBinding.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- saveBinding.getBindingTemplate().add(binding);
- BindingDetail bindingDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveBinding(saveBinding);
- bindingTemplate = bindingDetail.getBindingTemplate().get(0);
- if (log.isDebugEnabled()) {
- log.debug("Registering template binding " + bindingTemplate.getBindingKey() + " completed.");
- }
- } catch (Exception e) {
- log.error("Unable to register template binding " + binding.getBindingKey()
- + " ." + e.getMessage(), e);
- } catch (Throwable t) {
- log.error("Unable to register template binding " + binding.getBindingKey()
- + " ." + t.getMessage(), t);
- }
- return bindingTemplate;
- }
-
- /**
- * Register a service, using the node of current clerk ('this').
- *
- */
- public BusinessService register(BusinessService service) {
- return register(service, this.getUDDINode().getApiNode());
- }
-
- /**
- * Register a service.
- *
- */
- public BusinessService register(BusinessService service, Node node) {
-
- BusinessService businessService = null;
- log.info("Registering service " + service.getName().get(0).getValue()
- + " with key " + service.getServiceKey());
- try {
- SaveService saveService = new SaveService();
- saveService.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- saveService.getBusinessService().add(service);
- ServiceDetail serviceDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveService(saveService);
- businessService = serviceDetail.getBusinessService().get(0);
- if (log.isDebugEnabled()) {
- log.debug("Registering service " + service.getName().get(0).getValue() + " completed.");
- }
- } catch (Exception e) {
- log.error("Unable to register service " + service.getName().get(0).getValue()
- + " ." + e.getMessage(), e);
- } catch (Throwable t) {
- log.error("Unable to register service " + service.getName().get(0).getValue()
- + " ." + t.getMessage(), t);
- }
- return businessService;
- }
-
- public BusinessEntity register(BusinessEntity business) {
- return register(business, this.getUDDINode().getApiNode());
- }
-
- /**
- * Register a service. returns null if not successful
- */
- public BusinessEntity register(BusinessEntity business, Node node) {
-
- if (business.getName().get(0)==null){
- log.error("Unable to register business because no Name elements have been added.");
- return null;
- }
- BusinessEntity businessEntity = null;
- log.info("Registering business " + business.getName().get(0).getValue()
- + " with key " + business.getBusinessKey());
- try {
- SaveBusiness saveBusiness = new SaveBusiness();
- saveBusiness.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- saveBusiness.getBusinessEntity().add(business);
- BusinessDetail businessDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveBusiness(saveBusiness);
- businessEntity = businessDetail.getBusinessEntity().get(0);
- if (log.isDebugEnabled()) {
- log.debug("Registering businessEntity " + businessEntity.getName().get(0).getValue() + " completed.");
- }
- } catch (Exception e) {
- log.error("Unable to register business " + business.getName().get(0).getValue()
- + " ." + e.getMessage(), e);
- } catch (Throwable t) {
- log.error("Unable to register business " + business.getName().get(0).getValue()
- + " ." + t.getMessage(), t);
- }
- return businessEntity;
- }
-
- public void unRegisterBusiness(String businessKey) {
- unRegisterBusiness(businessKey, this.getUDDINode().getApiNode());
- }
-
- /**
- * Unregisters the service with specified serviceKey.
- *
- * @param service
- */
- public void unRegisterBusiness(String businessKey, Node node) {
- log.info("UnRegistering the business " + businessKey);
- try {
- DeleteBusiness deleteBusiness = new DeleteBusiness();
- deleteBusiness.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- deleteBusiness.getBusinessKey().add(businessKey);
- getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).deleteBusiness(deleteBusiness);
- } catch (Exception e) {
- log.error("Unable to register service " + businessKey
- + " ." + e.getMessage(), e);
- }
- }
-
- public void unRegisterService(String serviceKey) {
- unRegisterService(serviceKey, this.getUDDINode().getApiNode());
- }
-
- /**
- * Unregisters the service with specified serviceKey.
- *
- * @param service
- */
- public void unRegisterService(String serviceKey, Node node) {
- log.info("UnRegistering the service " + serviceKey);
- try {
- DeleteService deleteService = new DeleteService();
- deleteService.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- deleteService.getServiceKey().add(serviceKey);
- getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).deleteService(deleteService);
- } catch (Exception e) {
- log.error("Unable to register service " + serviceKey
- + " ." + e.getMessage(), e);
- }
- }
-
- public void unRegisterBinding(String bindingKey) {
- unRegisterBinding(bindingKey, this.getUDDINode().getApiNode());
- }
-
- /**
- * Unregisters the BindingTemplate with specified bindingKey.
- *
- * @param bindingTemplate
- * @param node
- */
- public void unRegisterBinding(String bindingKey, Node node) {
- log.info("UnRegistering binding key " + bindingKey);
- try {
- DeleteBinding deleteBinding = new DeleteBinding();
- deleteBinding.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- deleteBinding.getBindingKey().add(bindingKey);
- getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).deleteBinding(deleteBinding);
- } catch (Exception e) {
- log.error("Unable to unregister bindingkey " + bindingKey
- + " ." + e.getMessage(), e);
- }
- }
-
- public void unRegisterTModel(String tModelKey) {
- unRegisterTModel(tModelKey, this.getUDDINode().getApiNode());
- }
-
- /**
- * Unregisters the BindingTemplate with specified bindingKey.
- *
- * @param bindingTemplate
- * @param node
- */
- public void unRegisterTModel(String tModelKey, Node node) {
- log.info("UnRegistering tModel key " + tModelKey);
- try {
- String authToken = getAuthToken(node.getSecurityUrl());
- DeleteTModel deleteTModel = new DeleteTModel();
- deleteTModel.setAuthInfo(authToken);
- deleteTModel.getTModelKey().add(tModelKey);
- getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).deleteTModel(deleteTModel);
- } catch (Exception e) {
- log.error("Unable to unregister tModelkey " + tModelKey
- + " ." + e.getMessage(), e);
- }
- }
-
- public void unRegisterSubscription(String subscriptionKey) {
- unRegisterSubscription(subscriptionKey, this.getUDDINode().getApiNode());
- }
-
- public void unRegisterSubscription(String subscriptionKey, Node node) {
- log.info("UnRegistering subscription with key " + subscriptionKey);
- try {
- String authToken = getAuthToken(node.getSecurityUrl());
- DeleteSubscription deleteSubscription = new DeleteSubscription();
- deleteSubscription.setAuthInfo(authToken);
- deleteSubscription.getSubscriptionKey().add(subscriptionKey);
- getUDDINode().getTransport().getUDDISubscriptionService(node.getSubscriptionUrl()).deleteSubscription(deleteSubscription);
- } catch (Exception e) {
- log.error("Unable to unregister subscription key " + subscriptionKey
- + " ." + e.getMessage(), e);
- }
- }
-
- public TModelList findTModel(FindTModel findTModel) throws RemoteException, ConfigurationException, TransportException {
- return findTModel(findTModel, this.getUDDINode().getApiNode());
- }
-
- public TModelList findTModel(FindTModel findTModel, Node node) throws RemoteException,
- TransportException, ConfigurationException {
-
- findTModel.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- try {
- TModelList tModelList = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).findTModel(findTModel);
- return tModelList;
- } catch (DispositionReportFaultMessage dr) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
- checkForErrorInDispositionReport(report, null, null);
- } catch (SOAPFaultException sfe) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
- checkForErrorInDispositionReport(report, null, null);
- } catch (UndeclaredThrowableException ute) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
- checkForErrorInDispositionReport(report, null, null);
- }
- return null;
- }
-
- public TModelDetail getTModelDetail(String tModelKey) throws RemoteException, ConfigurationException, TransportException {
- GetTModelDetail getTModelDetail = new GetTModelDetail();
- getTModelDetail.getTModelKey().add(tModelKey);
- return getTModelDetail(getTModelDetail);
- }
-
- public TModelDetail getTModelDetail(GetTModelDetail getTModelDetail) throws RemoteException, ConfigurationException, TransportException {
- return getTModelDetail(getTModelDetail, this.getUDDINode().getApiNode());
- }
-
- public TModelDetail getTModelDetail(GetTModelDetail getTModelDetail, Node node) throws RemoteException,
- TransportException, ConfigurationException {
-
- getTModelDetail.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- try {
- TModelDetail tModelDetail = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getTModelDetail(getTModelDetail);
- return tModelDetail;
- } catch (DispositionReportFaultMessage dr) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
- checkForErrorInDispositionReport(report, null, null);
- } catch (SOAPFaultException sfe) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
- checkForErrorInDispositionReport(report, null, null);
- } catch (UndeclaredThrowableException ute) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
- checkForErrorInDispositionReport(report, null, null);
- }
- return null;
- }
-
- public BusinessService findService(String serviceKey) throws RemoteException,
- TransportException, ConfigurationException {
- return findService(serviceKey, this.getUDDINode().getApiNode());
- }
-
- public BusinessService findService(String serviceKey, Node node) throws RemoteException,
- TransportException, ConfigurationException {
- GetServiceDetail getServiceDetail = new GetServiceDetail();
- getServiceDetail.getServiceKey().add(serviceKey);
- getServiceDetail.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- try {
- ServiceDetail sd = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getServiceDetail(getServiceDetail);
- List<BusinessService> businessServiceList = sd.getBusinessService();
- if (businessServiceList.size() == 0) {
- throw new ConfigurationException("Could not find Service with key=" + serviceKey);
- }
- return businessServiceList.get(0);
- } catch (DispositionReportFaultMessage dr) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, serviceKey);
- } catch (SOAPFaultException sfe) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, serviceKey);
- } catch (UndeclaredThrowableException ute) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, serviceKey);
- }
- return null;
- }
-
- public BindingTemplate findServiceBinding(String bindingKey) throws DispositionReportFaultMessage, RemoteException,
- TransportException, ConfigurationException {
- return findServiceBinding(bindingKey, this.getUDDINode().getApiNode());
- }
-
- public BindingTemplate findServiceBinding(String bindingKey, Node node) throws DispositionReportFaultMessage, RemoteException,
- TransportException, ConfigurationException {
- GetBindingDetail getBindingDetail = new GetBindingDetail();
- getBindingDetail.getBindingKey().add(bindingKey);
- getBindingDetail.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- try {
- BindingDetail bd = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getBindingDetail(getBindingDetail);
- List<BindingTemplate> bindingTemplateList = bd.getBindingTemplate();
- if (bindingTemplateList.size() == 0) {
- throw new ConfigurationException("Could not find ServiceBinding with key=" + bindingKey);
- }
- return bindingTemplateList.get(0);
- } catch (DispositionReportFaultMessage dr) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, bindingKey);
- } catch (SOAPFaultException sfe) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, bindingKey);
- } catch (UndeclaredThrowableException ute) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, bindingKey);
- }
- return null;
- }
-
- public BusinessEntity findBusiness(String businessKey) throws RemoteException,
- TransportException, ConfigurationException {
- return findBusiness(businessKey, this.getUDDINode().getApiNode());
- }
-
- /**
- * Looks up the BusinessEntiry in the registry, will return null if is not
- * found.
- *
- * @param businessKey - the key we are looking for
- * @param node - the node which is going to be queried
- * @return BusinessEntity is found, or null if not found.
- * @throws RemoteException
- * @throws TransportException
- * @throws ConfigurationException
- */
- public BusinessEntity findBusiness(String businessKey, Node node) throws RemoteException,
- TransportException, ConfigurationException {
- GetBusinessDetail getBusinessDetail = new GetBusinessDetail();
- getBusinessDetail.getBusinessKey().add(businessKey);
- getBusinessDetail.setAuthInfo(node.getSecurityUrl());
- try {
- BusinessDetail bd = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getBusinessDetail(getBusinessDetail);
- return bd.getBusinessEntity().get(0);
- } catch (DispositionReportFaultMessage dr) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
- } catch (SOAPFaultException sfe) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
- } catch (UndeclaredThrowableException ute) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
- }
- return null;
- }
-
- /**
- * Looks up the BusinessEntiry in the registry, will return null if is not
- * found.
- *
- * @param businessKey - the key we are looking for
- * @param node - the node which is going to be queried
- * @return BusinessEntity is found, or null if not found.
- * @throws RemoteException
- * @throws TransportException
- * @throws ConfigurationException
- */
- public RelatedBusinessesList findRelatedBusinesses(String businessKey, Node node) throws RemoteException,
- TransportException, ConfigurationException {
- FindRelatedBusinesses findRelatedBusinesses = new FindRelatedBusinesses();
- findRelatedBusinesses.setBusinessKey(businessKey);
- findRelatedBusinesses.setAuthInfo(node.getSecurityUrl());
- try {
- RelatedBusinessesList rbl = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).findRelatedBusinesses(findRelatedBusinesses);
- return rbl;
- } catch (DispositionReportFaultMessage dr) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
- } catch (SOAPFaultException sfe) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
- } catch (UndeclaredThrowableException ute) {
- DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
- checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
- }
- return null;
- }
-
- private void checkForErrorInDispositionReport(DispositionReport report, String Error, String entityKey) {
-
- if (entityKey != null && report != null && report.countainsErrorCode(DispositionReport.E_INVALID_KEY_PASSED)) {
- log.info("entityKey " + entityKey + " was not found in the registry");
- } else {
- if (report == null) {
- log.info("Missing DispositionReport");
- } else {
- for (Result result : report.getResult()) {
- log.error(result.getErrInfo().getErrCode() + " " + result.getErrInfo().getValue());
- }
- }
- }
- }
-
- /**
- * Gets an auth token from the uddi server using the uddi auth token
- * <br>
- * Notice: never log auth tokens! Treat it like a password
- *
- * notes: changed to public to have access from the subscription callback API 8/20/2013 AO
- * @param endpointURL
- * @return
- * @throws TransportException
- * @throws DispositionReportFaultMessage
- * @throws RemoteException
- */
- public String getAuthToken(String endpointURL) throws TransportException, DispositionReportFaultMessage, RemoteException {
- //if the token is older then 10 minutes discard it, and create a new one.
- if ((authToken != null && !"".equals(authToken)) && (tokenBirthDate != null && System.currentTimeMillis() > tokenBirthDate.getTime() + 600000)) {
- DiscardAuthToken discardAuthToken = new DiscardAuthToken();
- discardAuthToken.setAuthInfo(authToken);
- getUDDINode().getTransport().getUDDISecurityService(endpointURL).discardAuthToken(discardAuthToken);
- authToken = null;
- }
- if (authToken == null || "".equals(authToken)) {
- tokenBirthDate = new Date();
- GetAuthToken getAuthToken = new GetAuthToken();
- getAuthToken.setUserID(getPublisher());
- if (isencrypted )
- {
- if (cryptoProvider==null)
- log.fatal("Credentials are encrypted but no cryptoProvider was defined in the config file!");
- else
- {
- try {
- getAuthToken.setCred(CryptorFactory.getCryptor(this.cryptoProvider).decrypt(getPassword()));
- } catch (Exception ex) {
- log.fatal("Unable to decrypt credentials! sending it as is", ex);
- getAuthToken.setCred(getPassword());
- }
- }
- }
- else
- {
- log.warn("Hey, I couldn't help but notice that your credentials aren't encrypted. Please consider doing so");
- getAuthToken.setCred(getPassword());
- }
- authToken = getUDDINode().getTransport().getUDDISecurityService(endpointURL).getAuthToken(getAuthToken).getAuthInfo();
- }
- return authToken;
- }
-
- /**
- * This calls a jUDDI implementation specific API call and is used to help
- * configure internode communication between jUDDI servers. This is NOT
- * part of the UDDI specification.<br>
- * Note: this API call should only be used with secure ports (SSL/TLS)
- * @param node
- * @return
- */
- public NodeDetail saveNode(Node node) {
- NodeDetail nodeDetail = null;
- try {
- log.info("Sending Node " + node.getName() + " info to jUDDI " + getUDDINode().getName());
- SaveNode saveNode = new SaveNode();
- saveNode.setAuthInfo(getAuthToken(node.getSecurityUrl()));
- saveNode.getNode().add(node);
- nodeDetail = getUDDINode().getTransport().getJUDDIApiService(node.getJuddiApiUrl()).saveNode(saveNode);
- } catch (Exception e) {
- log.error("Unable to save node " + node.getName()
- + " ." + e.getMessage(), e);
- } catch (Throwable t) {
- log.error("Unable to save node " + node.getName()
- + " ." + t.getMessage(), t);
- }
- return nodeDetail;
- }
-
- /**
- * This calls a jUDDI implementation specific API call and is used to help
- * configure internode communication between jUDDI servers. This is NOT
- * part of the UDDI specification.<br>
- * Note: this API call should only be used with secure ports (SSL/TLS)
- * @param senderClerk
- * @return
- */
- public ClerkDetail saveClerk(UDDIClerk senderClerk) {
- ClerkDetail clerkDetail = null;
- try {
- log.debug("Sending Clerk " + senderClerk.getName() + " info to jUDDI " + getUDDINode().getName());
- SaveClerk saveClerk = new SaveClerk();
- saveClerk.setAuthInfo(getAuthToken(senderClerk.getUDDINode().getSecurityUrl()));
- saveClerk.getClerk().add(getApiClerk());
- clerkDetail = getUDDINode().getTransport().getJUDDIApiService(senderClerk.getUDDINode().getJuddiApiUrl()).saveClerk(saveClerk);
- } catch (Exception e) {
- log.error("Unable to save clerk " + getName()
- + " ." + e.getMessage(), e);
- } catch (Throwable t) {
- log.error("Unable to save clerk " + getName()
- + " ." + t.getMessage(), t);
- }
- return clerkDetail;
- }
-
- public Clerk getApiClerk() {
- Clerk apiClerk = new Clerk();
- apiClerk.setName(name);
- apiClerk.setNode(uddiNode.getApiNode());
- apiClerk.setPassword(password);
- apiClerk.setPublisher(publisher);
- return apiClerk;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setUDDINode(UDDINode uddiNode) {
- this.uddiNode = uddiNode;
- }
-
- /**
- * This is the username
- * @return
- */
- public String getPublisher() {
- return publisher;
- }
-
- /**
- * This is the username
- * @param publisher
- */
- public void setPublisher(String publisher) {
- this.publisher = publisher;
- }
-
- /**
- * If the password is encrypted, it will be decrypted if possible, otherwise
- * the cipher text will be returned.
- * @return
- */
- public String getPassword() {
- if (isencrypted)
- {
- try {
- return CryptorFactory.getCryptor(cryptoProvider).decrypt(password);
- } catch (Exception ex) {
- log.fatal("Unable to decrypt the password", ex);
- }
- }
- return password;
- }
-
- /**
- * If the password is encrypted, it cipher text is returned, otherwise
- * the clear text will be returned.
- * @return
- */
- public String getRawPassword() {
- return password;
- }
-
- /**
- * Use with caution, don't forget to set the IsEncrypted and Crypto provider
- * @param password
- */
- public void setPassword(String password) {
- this.password = password;
- }
-
- public WSDL[] getWsdls() {
- return wsdls;
- }
-
- public void setWsdls(WSDL[] wsdls) {
- this.wsdls = wsdls;
- }
-
- public void setCryptoProvider(String clazz) {
- this.cryptoProvider = clazz;
- }
-
- public void setIsPasswordEncrypted(boolean option) {
- this.isencrypted = option;
- }
-
- public String getCryptoProvider() {
- return this.cryptoProvider ;
- }
-
- public boolean setIsPasswordEncrypted() {
- return this.isencrypted ;
- }
-
-
- public class WSDL {
-
- private String businessKey;
- private String keyDomain;
- private String fileName;
-
- public String getBusinessKey() {
- return businessKey;
- }
-
- public void setBusinessKey(String businessKey) {
- this.businessKey = businessKey;
- }
-
- public String getFileName() {
- return fileName;
- }
-
- public void setFileName(String fileName) {
- this.fileName = fileName;
- }
-
- public String getKeyDomain() {
- return keyDomain;
- }
-
- public void setKeyDomain(String keyDomain) {
- this.keyDomain = keyDomain;
- }
- }
-
- /**
- *A helper class to create a tModel key generator.<br>
- * Why would I want a key generator? In UDDIv3, you're suppose to specify what you want the keys (unique identifiers) to be, however there's
- * a number of naming rules associated with the keys. Generally, use the FQDN of your business or organization.
- * Optionally, when saving an UDDI entity, you can just leave the key name blank and the server
- * should generate one for you. It's normally a UUID that's not easy to remember. In this case, there's no need to call this method. <br><br>
- * In addition, no changes are made to the UDDI server. You'll have to do that one using code similar to this:
- * <pre>
- * UDDIClerk clerk = ...
- * TModel keygen = UDDIClerk.createKeyGenator("uddi:mydomain.com:keygenerator", "my domain", "en");
- * clerk.register(keygen);
- *
- * @param partitionName think of this as the domain, i.e. juddi.apache.org, but it can really be anything you want. This will become part of the
- * key associated with the tModel generator (uddi:juddi.apache.org:keygenerator)
- * @param DescriptiveName required. max length is 255 char
- * @param DescriptiveNameLanguage optional, max length is 26 char
- * @return a populated tModel entity representing a tModel key generator. No changes are made to any connect UDDI service
- * @since 3.2
- */
- public static TModel createKeyGenator(String partitionName, String DescriptiveName, String DescriptiveNameLanguage) {
- if (partitionName == null || partitionName.length() == 0) {
- throw new IllegalArgumentException();
- }
-
- if (DescriptiveName == null || DescriptiveName.length() == 0) {
- throw new IllegalArgumentException();
- }
- if (!partitionName.startsWith("uddi:")) {
- //throw new IllegalArgumentException("partitionName must have a 'uddi:' prefix");
- partitionName = "uddi:" + partitionName;
-
- }
- if (!partitionName.endsWith(":keygenerator")) {
- //throw new IllegalArgumentException("partitionName must have a ':keygenerator' postfix");
- partitionName = partitionName + ":keygenerator";
- }
- TModel tm = new TModel();
- tm.setName(new Name());
- tm.getName().setValue(DescriptiveName);
- tm.getName().setLang(DescriptiveNameLanguage);
- tm.setCategoryBag(new CategoryBag());
- KeyedReference kr = new KeyedReference();
- kr.setTModelKey(UDDIConstants.KEY_GENERATOR_TMODEL);
- kr.setKeyName(UDDIConstants.KEY_GENERATOR);
- kr.setKeyValue(UDDIConstants.KEY_GENERATOR_VALUE);
- tm.getCategoryBag().getKeyedReference().add(kr);
- OverviewDoc overviewDoc = new OverviewDoc();
- OverviewURL overviewUrl = new OverviewURL();
- overviewUrl.setUseType("text");
- overviewUrl.setValue("http://uddi.org/pubs/uddi_v3.htm#keyGen");
- overviewDoc.setOverviewURL(overviewUrl);
- tm.getOverviewDoc().add(overviewDoc);
- tm.setTModelKey(partitionName.toLowerCase());
- return tm;
- }
-
- /**
- * This is a convenience function that will build and return a TModelInstanceInfo
- * as described in the following link that will enable you to tag web services
- * registered in UDDI with some kind of version information.<Br><Br>
- * Article source: <a href="http://www.ibm.com/developerworks/webservices/library/ws-version/">http://www.ibm.com/developerworks/webservices/library/ws-version/</a>
- * <Br><Br>
- *
- * When using this tModel as a tModelInstance, it can be used to describe a
- * version associated with either a service interface, a bindingTemplate
- * service instance. Note: This is a jUDDI specific addon and may not be
- * present in other registries
- *
- * @param version From the article, no specificity is provided on what to use as a value, but
- * we recommend that you use the string representation of major.minor[.build[.revision]].<br>
- * Example
- * <ul>
- * <li>6.1.2.3</li>
- * <li>1.0</li>
- * <li>0.1</li>
- * </ul>
- * @return TModelInstanceInfo populated as described in the article, plus some descriptive information
- */
- public static TModelInstanceInfo createServiceInterfaceVersion(String version, String lang) throws IllegalArgumentException {
- if (version==null)
- throw new IllegalArgumentException();
- TModelInstanceInfo tt = new TModelInstanceInfo();
- tt.setTModelKey(UDDIConstants.VERSION_TMODEL);
- tt.setInstanceDetails(new InstanceDetails());
- tt.getInstanceDetails().setInstanceParms(version);
-
- OverviewDoc doc = new OverviewDoc();
- doc.setOverviewURL(new OverviewURL("http://www.ibm.com/developerworks/webservices/library/ws-version/", "text"));
- doc.getDescription().add(new Description(
- "Describes a version associated with either a service interface, a bindingTemplate service instance.", lang));
- tt.getDescription().add(new Description("Describes a version associated with either a service interface, a bindingTemplate service instance.", lang));
- tt.getInstanceDetails().getOverviewDoc().add(doc);
- return tt;
- }
-
- /**
- * This is a convenience function that will filter a list of binding templates
- * and return a list of bindings matching the specified version number.
- *
- * This implements and expands upon service versioning described in the
- * following link and will enable you to tag web services
- * registered in UDDI with some kind of version information.<Br><Br>
- * Article source: <a href="http://www.ibm.com/developerworks/webservices/library/ws-version/">http://www.ibm.com/developerworks/webservices/library/ws-version/</a>
- * <Br><Br>
- * @see createServiceInterfaceVersion for more information<Br><br>
- *
- * This function operates using tModelInstances that are used to describe a
- * version associated with either a service interface, a bindingTemplate
- * service instance. Note: This is a jUDDI specific addon and may not be
- * present in other registries
- *
- * @param version From the article, no specificity is provided on what to use as a value, but
- * we recommend that you use the string representation of major.minor[.build[.revision]].<br>
- * Example
- * <ul>
- * <li>6.1.2.3</li>
- * <li>1.0</li>
- * <li>0.1</li>
- * </ul>
- * @param version
- * @param bindingTemplate
- * @return a list if binding templates where the version equals ignoring case trimmed equals the version value
- */
- public static Set<BindingTemplate> getBindingByVersion(String version, List<BindingTemplate> bindingTemplate) throws IllegalArgumentException {
- if (version == null) {
- throw new IllegalArgumentException();
- }
- if (bindingTemplate == null) {
- throw new IllegalArgumentException();
- }
- Set<BindingTemplate> ret = new HashSet<BindingTemplate>();
- for (int i = 0; i < bindingTemplate.size(); i++) {
- if (bindingTemplate.get(i).getTModelInstanceDetails() != null) {
- for (int k = 0; k < bindingTemplate.get(i).getTModelInstanceDetails().getTModelInstanceInfo().size(); k++) {
- if (bindingTemplate.get(i).getTModelInstanceDetails().getTModelInstanceInfo().get(k).getTModelKey().equalsIgnoreCase(UDDIConstants.VERSION_TMODEL)) {
- if (bindingTemplate.get(i).getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails() != null) {
- if (bindingTemplate.get(i).getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getInstanceParms() != null) {
- if (bindingTemplate.get(i).getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getInstanceParms().trim().equalsIgnoreCase(version.trim())) {
- ret.add(bindingTemplate.get(i));
- break;
+ /**
+ * Register a service. returns null if not successful
+ */
+ public BusinessEntity register(BusinessEntity business, Node node) {
+
+ if (business.getName().get(0) == null) {
+ log.error("Unable to register business because no Name elements have been added.");
+ return null;
+ }
+ BusinessEntity businessEntity = null;
+ log.info("Registering business " + business.getName().get(0).getValue()
+ + " with key " + business.getBusinessKey());
+ try {
+ SaveBusiness saveBusiness = new SaveBusiness();
+ saveBusiness.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ saveBusiness.getBusinessEntity().add(business);
+ BusinessDetail businessDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveBusiness(saveBusiness);
+ businessEntity = businessDetail.getBusinessEntity().get(0);
+ if (log.isDebugEnabled()) {
+ log.debug("Registering businessEntity " + businessEntity.getName().get(0).getValue() + " completed.");
+ }
+ } catch (Exception e) {
+ log.error("Unable to register business " + business.getName().get(0).getValue()
+ + " ." + e.getMessage(), e);
+ } catch (Throwable t) {
+ log.error("Unable to register business " + business.getName().get(0).getValue()
+ + " ." + t.getMessage(), t);
+ }
+ return businessEntity;
+ }
+
+ public void unRegisterBusiness(String businessKey) {
+ unRegisterBusiness(businessKey, this.getUDDINode().getApiNode());
+ }
+
+ /**
+ * Unregisters the service with specified serviceKey.
+ *
+ * @param service
+ */
+ public void unRegisterBusiness(String businessKey, Node node) {
+ log.info("UnRegistering the business " + businessKey);
+ try {
+ DeleteBusiness deleteBusiness = new DeleteBusiness();
+ deleteBusiness.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ deleteBusiness.getBusinessKey().add(businessKey);
+ getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).deleteBusiness(deleteBusiness);
+ } catch (Exception e) {
+ log.error("Unable to register service " + businessKey
+ + " ." + e.getMessage(), e);
+ }
+ }
+
+ public void unRegisterService(String serviceKey) {
+ unRegisterService(serviceKey, this.getUDDINode().getApiNode());
+ }
+
+ /**
+ * Unregisters the service with specified serviceKey.
+ *
+ * @param service
+ */
+ public void unRegisterService(String serviceKey, Node node) {
+ log.info("UnRegistering the service " + serviceKey);
+ try {
+ DeleteService deleteService = new DeleteService();
+ deleteService.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ deleteService.getServiceKey().add(serviceKey);
+ getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).deleteService(deleteService);
+ } catch (Exception e) {
+ log.error("Unable to register service " + serviceKey
+ + " ." + e.getMessage(), e);
+ }
+ }
+
+ public void unRegisterBinding(String bindingKey) {
+ unRegisterBinding(bindingKey, this.getUDDINode().getApiNode());
+ }
+
+ /**
+ * Unregisters the BindingTemplate with specified bindingKey.
+ *
+ * @param bindingTemplate
+ * @param node
+ */
+ public void unRegisterBinding(String bindingKey, Node node) {
+ log.info("UnRegistering binding key " + bindingKey);
+ try {
+ DeleteBinding deleteBinding = new DeleteBinding();
+ deleteBinding.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ deleteBinding.getBindingKey().add(bindingKey);
+ getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).deleteBinding(deleteBinding);
+ } catch (Exception e) {
+ log.error("Unable to unregister bindingkey " + bindingKey
+ + " ." + e.getMessage(), e);
+ }
+ }
+
+ public void unRegisterTModel(String tModelKey) {
+ unRegisterTModel(tModelKey, this.getUDDINode().getApiNode());
+ }
+
+ /**
+ * Unregisters the BindingTemplate with specified bindingKey.
+ *
+ * @param bindingTemplate
+ * @param node
+ */
+ public void unRegisterTModel(String tModelKey, Node node) {
+ log.info("UnRegistering tModel key " + tModelKey);
+ try {
+ String authToken = getAuthToken(node.getSecurityUrl());
+ DeleteTModel deleteTModel = new DeleteTModel();
+ deleteTModel.setAuthInfo(authToken);
+ deleteTModel.getTModelKey().add(tModelKey);
+ getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).deleteTModel(deleteTModel);
+ } catch (Exception e) {
+ log.error("Unable to unregister tModelkey " + tModelKey
+ + " ." + e.getMessage(), e);
+ }
+ }
+
+ public void unRegisterSubscription(String subscriptionKey) {
+ unRegisterSubscription(subscriptionKey, this.getUDDINode().getApiNode());
+ }
+
+ public void unRegisterSubscription(String subscriptionKey, Node node) {
+ log.info("UnRegistering subscription with key " + subscriptionKey);
+ try {
+ String authToken = getAuthToken(node.getSecurityUrl());
+ DeleteSubscription deleteSubscription = new DeleteSubscription();
+ deleteSubscription.setAuthInfo(authToken);
+ deleteSubscription.getSubscriptionKey().add(subscriptionKey);
+ getUDDINode().getTransport().getUDDISubscriptionService(node.getSubscriptionUrl()).deleteSubscription(deleteSubscription);
+ } catch (Exception e) {
+ log.error("Unable to unregister subscription key " + subscriptionKey
+ + " ." + e.getMessage(), e);
+ }
+ }
+
+ public TModelList findTModel(FindTModel findTModel) throws RemoteException, ConfigurationException, TransportException {
+ return findTModel(findTModel, this.getUDDINode().getApiNode());
+ }
+
+ public TModelList findTModel(FindTModel findTModel, Node node) throws RemoteException,
+ TransportException, ConfigurationException {
+
+ findTModel.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ try {
+ TModelList tModelList = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).findTModel(findTModel);
+ return tModelList;
+ } catch (DispositionReportFaultMessage dr) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
+ checkForErrorInDispositionReport(report, null, null);
+ } catch (SOAPFaultException sfe) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
+ checkForErrorInDispositionReport(report, null, null);
+ } catch (UndeclaredThrowableException ute) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
+ checkForErrorInDispositionReport(report, null, null);
+ }
+ return null;
+ }
+
+ public TModelDetail getTModelDetail(String tModelKey) throws RemoteException, ConfigurationException, TransportException {
+ GetTModelDetail getTModelDetail = new GetTModelDetail();
+ getTModelDetail.getTModelKey().add(tModelKey);
+ return getTModelDetail(getTModelDetail);
+ }
+
+ public TModelDetail getTModelDetail(GetTModelDetail getTModelDetail) throws RemoteException, ConfigurationException, TransportException {
+ return getTModelDetail(getTModelDetail, this.getUDDINode().getApiNode());
+ }
+
+ public TModelDetail getTModelDetail(GetTModelDetail getTModelDetail, Node node) throws RemoteException,
+ TransportException, ConfigurationException {
+
+ getTModelDetail.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ try {
+ TModelDetail tModelDetail = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getTModelDetail(getTModelDetail);
+ return tModelDetail;
+ } catch (DispositionReportFaultMessage dr) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
+ checkForErrorInDispositionReport(report, null, null);
+ } catch (SOAPFaultException sfe) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
+ checkForErrorInDispositionReport(report, null, null);
+ } catch (UndeclaredThrowableException ute) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
+ checkForErrorInDispositionReport(report, null, null);
+ }
+ return null;
+ }
+
+ public BusinessService findService(String serviceKey) throws RemoteException,
+ TransportException, ConfigurationException {
+ return findService(serviceKey, this.getUDDINode().getApiNode());
+ }
+
+ public BusinessService findService(String serviceKey, Node node) throws RemoteException,
+ TransportException, ConfigurationException {
+ GetServiceDetail getServiceDetail = new GetServiceDetail();
+ getServiceDetail.getServiceKey().add(serviceKey);
+ getServiceDetail.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ try {
+ ServiceDetail sd = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getServiceDetail(getServiceDetail);
+ List<BusinessService> businessServiceList = sd.getBusinessService();
+ if (businessServiceList.size() == 0) {
+ throw new ConfigurationException("Could not find Service with key=" + serviceKey);
+ }
+ return businessServiceList.get(0);
+ } catch (DispositionReportFaultMessage dr) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, serviceKey);
+ } catch (SOAPFaultException sfe) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, serviceKey);
+ } catch (UndeclaredThrowableException ute) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, serviceKey);
+ }
+ return null;
+ }
+
+ public BindingTemplate findServiceBinding(String bindingKey) throws DispositionReportFaultMessage, RemoteException,
+ TransportException, ConfigurationException {
+ return findServiceBinding(bindingKey, this.getUDDINode().getApiNode());
+ }
+
+ public BindingTemplate findServiceBinding(String bindingKey, Node node) throws DispositionReportFaultMessage, RemoteException,
+ TransportException, ConfigurationException {
+ GetBindingDetail getBindingDetail = new GetBindingDetail();
+ getBindingDetail.getBindingKey().add(bindingKey);
+ getBindingDetail.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ try {
+ BindingDetail bd = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getBindingDetail(getBindingDetail);
+ List<BindingTemplate> bindingTemplateList = bd.getBindingTemplate();
+ if (bindingTemplateList.size() == 0) {
+ throw new ConfigurationException("Could not find ServiceBinding with key=" + bindingKey);
+ }
+ return bindingTemplateList.get(0);
+ } catch (DispositionReportFaultMessage dr) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, bindingKey);
+ } catch (SOAPFaultException sfe) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, bindingKey);
+ } catch (UndeclaredThrowableException ute) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, bindingKey);
+ }
+ return null;
+ }
+
+ public BusinessEntity findBusiness(String businessKey) throws RemoteException,
+ TransportException, ConfigurationException {
+ return findBusiness(businessKey, this.getUDDINode().getApiNode());
+ }
+
+ /**
+ * Looks up the BusinessEntiry in the registry, will return null if is
+ * not found.
+ *
+ * @param businessKey - the key we are looking for
+ * @param node - the node which is going to be queried
+ * @return BusinessEntity is found, or null if not found.
+ * @throws RemoteException
+ * @throws TransportException
+ * @throws ConfigurationException
+ */
+ public BusinessEntity findBusiness(String businessKey, Node node) throws RemoteException,
+ TransportException, ConfigurationException {
+ GetBusinessDetail getBusinessDetail = new GetBusinessDetail();
+ getBusinessDetail.getBusinessKey().add(businessKey);
+ getBusinessDetail.setAuthInfo(node.getSecurityUrl());
+ try {
+ BusinessDetail bd = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getBusinessDetail(getBusinessDetail);
+ return bd.getBusinessEntity().get(0);
+ } catch (DispositionReportFaultMessage dr) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
+ } catch (SOAPFaultException sfe) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
+ } catch (UndeclaredThrowableException ute) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
+ }
+ return null;
+ }
+
+ /**
+ * Looks up the BusinessEntiry in the registry, will return null if is
+ * not found.
+ *
+ * @param businessKey - the key we are looking for
+ * @param node - the node which is going to be queried
+ * @return BusinessEntity is found, or null if not found.
+ * @throws RemoteException
+ * @throws TransportException
+ * @throws ConfigurationException
+ */
+ public RelatedBusinessesList findRelatedBusinesses(String businessKey, Node node) throws RemoteException,
+ TransportException, ConfigurationException {
+ FindRelatedBusinesses findRelatedBusinesses = new FindRelatedBusinesses();
+ findRelatedBusinesses.setBusinessKey(businessKey);
+ findRelatedBusinesses.setAuthInfo(node.getSecurityUrl());
+ try {
+ RelatedBusinessesList rbl = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).findRelatedBusinesses(findRelatedBusinesses);
+ return rbl;
+ } catch (DispositionReportFaultMessage dr) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
+ } catch (SOAPFaultException sfe) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
+ } catch (UndeclaredThrowableException ute) {
+ DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute);
+ checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
+ }
+ return null;
+ }
+
+ private void checkForErrorInDispositionReport(DispositionReport report, String Error, String entityKey) {
+
+ if (entityKey != null && report != null && report.countainsErrorCode(DispositionReport.E_INVALID_KEY_PASSED)) {
+ log.info("entityKey " + entityKey + " was not found in the registry");
+ } else {
+ if (report == null) {
+ log.info("Missing DispositionReport");
+ } else {
+ for (Result result : report.getResult()) {
+ log.error(result.getErrInfo().getErrCode() + " " + result.getErrInfo().getValue());
+ }
+ }
+ }
+ }
+
+ /**
+ * Gets an auth token from the uddi server using the uddi auth token
+ * <br>
+ * Notice: never log auth tokens! Treat it like a password
+ *
+ * notes: changed to public to have access from the subscription
+ * callback API 8/20/2013 AO
+ *
+ * @param endpointURL
+ * @return
+ * @throws TransportException
+ * @throws DispositionReportFaultMessage
+ * @throws RemoteException
+ */
+ public String getAuthToken(String endpointURL) throws TransportException, DispositionReportFaultMessage, RemoteException {
+ //if the token is older then 10 minutes discard it, and create a new one.
+ if ((authToken != null && !"".equals(authToken)) && (tokenBirthDate != null && System.currentTimeMillis() > tokenBirthDate.getTime() + 600000)) {
+ DiscardAuthToken discardAuthToken = new DiscardAuthToken();
+ discardAuthToken.setAuthInfo(authToken);
+ getUDDINode().getTransport().getUDDISecurityService(endpointURL).discardAuthToken(discardAuthToken);
+ authToken = null;
+ }
+ if (authToken == null || "".equals(authToken)) {
+ tokenBirthDate = new Date();
+ GetAuthToken getAuthToken = new GetAuthToken();
+ getAuthToken.setUserID(getPublisher());
+ if (isencrypted) {
+ if (cryptoProvider == null) {
+ log.fatal("Credentials are encrypted but no cryptoProvider was defined in the config file!");
+ } else {
+ try {
+ getAuthToken.setCred(CryptorFactory.getCryptor(this.cryptoProvider).decrypt(getPassword()));
+ } catch (Exception ex) {
+ log.fatal("Unable to decrypt credentials! sending it as is", ex);
+ getAuthToken.setCred(getPassword());
+ }
+ }
+ } else {
+ log.warn("Hey, I couldn't help but notice that your credentials aren't encrypted. Please consider doing so");
+ getAuthToken.setCred(getPassword());
+ }
+ authToken = getUDDINode().getTransport().getUDDISecurityService(endpointURL).getAuthToken(getAuthToken).getAuthInfo();
+ }
+ return authToken;
+ }
+
+ /**
+ * This calls a jUDDI implementation specific API call and is used to
+ * help configure internode communication between jUDDI servers. This is
+ * NOT part of the UDDI specification.<br>
+ * Note: this API call should only be used with secure ports (SSL/TLS)
+ *
+ * @param node
+ * @return
+ */
+ public NodeDetail saveNode(Node node) {
+ NodeDetail nodeDetail = null;
+ try {
+ log.info("Sending Node " + node.getName() + " info to jUDDI " + getUDDINode().getName());
+ SaveNodeInfo saveNode = new SaveNodeInfo();
+ saveNode.setAuthInfo(getAuthToken(node.getSecurityUrl()));
+ saveNode.getNode().add(node);
+ nodeDetail = getUDDINode().getTransport().getJUDDIApiService(node.getJuddiApiUrl()).saveNode(saveNode);
+ } catch (Exception e) {
+ log.error("Unable to save node " + node.getName()
+ + " ." + e.getMessage(), e);
+ } catch (Throwable t) {
+ log.error("Unable to save node " + node.getName()
+ + " ." + t.getMessage(), t);
+ }
+ return nodeDetail;
+ }
+
+ /**
+ * This calls a jUDDI implementation specific API call and is used to
+ * help configure internode communication between jUDDI servers. This is
+ * NOT part of the UDDI specification.<br>
+ * Note: this API call should only be used with secure ports (SSL/TLS)
+ *
+ * @param senderClerk
+ * @return
+ */
+ public ClerkDetail saveClerk(UDDIClerk senderClerk) {
+ ClerkDetail clerkDetail = null;
+ try {
+ log.debug("Sending Clerk " + senderClerk.getName() + " info to jUDDI " + getUDDINode().getName());
+ SaveClerkInfo saveClerk = new SaveClerkInfo();
+ saveClerk.setAuthInfo(getAuthToken(senderClerk.getUDDINode().getSecurityUrl()));
+ saveClerk.getClerk().add(getApiClerk());
+ clerkDetail = getUDDINode().getTransport().getJUDDIApiService(senderClerk.getUDDINode().getJuddiApiUrl()).saveClerk(saveClerk);
+ } catch (Exception e) {
+ log.error("Unable to save clerk " + getName()
+ + " ." + e.getMessage(), e);
+ } catch (Throwable t) {
+ log.error("Unable to save clerk " + getName()
+ + " ." + t.getMessage(), t);
+ }
+ return clerkDetail;
+ }
+
+ public Clerk getApiClerk() {
+ Clerk apiClerk = new Clerk();
+ apiClerk.setName(name);
+ apiClerk.setNode(uddiNode.getApiNode());
+ apiClerk.setPassword(password);
+ apiClerk.setPublisher(publisher);
+ return apiClerk;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setUDDINode(UDDINode uddiNode) {
+ this.uddiNode = uddiNode;
+ }
+
+ /**
+ * This is the username
+ *
+ * @return
+ */
+ public String getPublisher() {
+ return publisher;
+ }
+
+ /**
+ * This is the username
+ *
+ * @param publisher
+ */
+ public void setPublisher(String publisher) {
+ this.publisher = publisher;
+ }
+
+ /**
+ * If the password is encrypted, it will be decrypted if possible,
+ * otherwise the cipher text will be returned.
+ *
+ * @return
+ */
+ public String getPassword() {
+ if (isencrypted) {
+ try {
+ return CryptorFactory.getCryptor(cryptoProvider).decrypt(password);
+ } catch (Exception ex) {
+ log.fatal("Unable to decrypt the password", ex);
+ }
+ }
+ return password;
+ }
+
+ /**
+ * If the password is encrypted, it cipher text is returned, otherwise
+ * the clear text will be returned.
+ *
+ * @return
+ */
+ public String getRawPassword() {
+ return password;
+ }
+
+ /**
+ * Use with caution, don't forget to set the IsEncrypted and Crypto
+ * provider
+ *
+ * @param password
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public WSDL[] getWsdls() {
+ return wsdls;
+ }
+
+ public void setWsdls(WSDL[] wsdls) {
+ this.wsdls = wsdls;
+ }
+
+ public void setCryptoProvider(String clazz) {
+ this.cryptoProvider = clazz;
+ }
+
+ public void setIsPasswordEncrypted(boolean option) {
+ this.isencrypted = option;
+ }
+
+ public String getCryptoProvider() {
+ return this.cryptoProvider;
+ }
+
+ public boolean setIsPasswordEncrypted() {
+ return this.isencrypted;
+ }
+
+ public class WSDL {
+
+ private String businessKey;
+ private String keyDomain;
+ private String fileName;
+
+ public String getBusinessKey() {
+ return businessKey;
+ }
+
+ public void setBusinessKey(String businessKey) {
+ this.businessKey = businessKey;
+ }
+
+ public String getFileName() {
+ return fileName;
+ }
+
+ public void setFileName(String fileName) {
+ this.fileName = fileName;
+ }
+
+ public String getKeyDomain() {
+ return keyDomain;
+ }
+
+ public void setKeyDomain(String keyDomain) {
+ this.keyDomain = keyDomain;
+ }
+ }
+
+ /**
+ * A helper class to create a tModel key generator.<br>
+ * Why would I want a key generator? In UDDIv3, you're suppose to
+ * specify what you want the keys (unique identifiers) to be, however
+ * there's a number of naming rules associated with the keys. Generally,
+ * use the FQDN of your business or organization. Optionally, when
+ * saving an UDDI entity, you can just leave the key name blank and the
+ * server should generate one for you. It's normally a UUID that's not
+ * easy to remember. In this case, there's no need to call this method.
+ * <br><br>
+ * In addition, no changes are made to the UDDI server. You'll have to
+ * do that one using code similar to this:
+ * <pre>
+ * UDDIClerk clerk = ...
+ * TModel keygen = UDDIClerk.createKeyGenator("uddi:mydomain.com:keygenerator", "my domain", "en");
+ * clerk.register(keygen);
+ *
+ * @param partitionName think of this as the domain, i.e. juddi.apache.org, but it can really be anything you want. This will become part of the
+ * key associated with the tModel generator (uddi:juddi.apache.org:keygenerator)
+ * @param DescriptiveName required. max length is 255 char
+ * @param DescriptiveNameLanguage optional, max length is 26 char
+ * @return a populated tModel entity representing a tModel key
+ * generator. No changes are made to any connect UDDI service
+ * @since 3.2
+ */
[... 516 lines stripped ...]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org