/// <summary> /// Constructs the serviceKey based on the bindingKeyFormat specified in the properties. When no /// businessKeyFormat is specific the default format of uddi:${keyDomain}:${businessName} is used. The businessName /// property needs to be set properties. /// </summary> /// <param name="properties"></param> /// <returns></returns> public static String getBusinessKey(Properties properties) { String businessKey = properties.getProperty(Property.BUSINESS_KEY); if (businessKey == null) { String keyFormat = properties.getProperty(Property.BUSINESS_KEY_FORMAT, DEFAULT_BUSINESS_KEY_FORMAT); businessKey = TokenResolver.replaceTokens(keyFormat, properties).ToLower(); } return businessKey; }
/// <summary> /// Constructs the serviceKey based on the bindingKeyFormat specified in the properties. When no /// businessKeyFormat is specific the default format of uddi:${keyDomain}:${businessName} is used. The businessName /// property needs to be set properties. /// </summary> /// <param name="properties"></param> /// <returns></returns> public static String getBusinessKey(Properties properties) { String businessKey = properties.getProperty(Property.BUSINESS_KEY); if (businessKey == null) { String keyFormat = properties.getProperty(Property.BUSINESS_KEY_FORMAT, DEFAULT_BUSINESS_KEY_FORMAT); businessKey = TokenResolver.replaceTokens(keyFormat, properties).ToLower(); } return(businessKey); }
/** * Constructs the bindingKey based on the bindingKeyFormat specified in the properties. When no * bindingKeyFormat is specific the default format of uddi:${keyDomain}:${nodeName}-${serviceName}-{portName} is used. * * @param properties * @param serviceName * @param portName * @return the bindingKey */ public static String getBindingKey(Properties properties, QName serviceName, String portName, Uri bindingUrl) { Properties tempProperties = new Properties(); tempProperties.putAll(properties); tempProperties.put("serviceName", serviceName.getLocalPart()); tempProperties.put("portName", portName); int port = bindingUrl.Port; if (port < 0) { if ("http".Equals(bindingUrl.Scheme, StringComparison.CurrentCultureIgnoreCase)) { port = 80; } else if ("https".Equals(bindingUrl.Scheme)) { port = 443; } } if (!tempProperties.containsKey("serverPort")) tempProperties.put("serverPort", port.ToString()); //Constructing the binding Key String keyFormat = properties.getProperty(Property.BINDING_KEY_FORMAT, DEFAULT_BINDING_KEY_FORMAT); String bindingKey = TokenResolver.replaceTokens(keyFormat, tempProperties).ToLower(); return bindingKey; }
/** * Constructs the bindingKey based on the bindingKeyFormat specified in the properties. When no * bindingKeyFormat is specific the default format of uddi:${keyDomain}:${nodeName}-${serviceName}-{portName} is used. * * @param properties * @param serviceName * @param portName * @return the bindingKey */ public static String getBindingKey(Properties properties, QName serviceName, String portName, Uri bindingUrl) { Properties tempProperties = new Properties(); tempProperties.putAll(properties); tempProperties.put("serviceName", serviceName.getLocalPart()); tempProperties.put("portName", portName); int port = bindingUrl.Port; if (port < 0) { if ("http".Equals(bindingUrl.Scheme, StringComparison.CurrentCultureIgnoreCase)) { port = 80; } else if ("https".Equals(bindingUrl.Scheme)) { port = 443; } } if (!tempProperties.containsKey("serverPort")) { tempProperties.put("serverPort", port.ToString()); } //Constructing the binding Key String keyFormat = properties.getProperty(Property.BINDING_KEY_FORMAT, DEFAULT_BINDING_KEY_FORMAT); String bindingKey = TokenResolver.replaceTokens(keyFormat, tempProperties).ToLower(); return(bindingKey); }
public static String getSubscriptionKey(Properties properties) { String keyFormat = properties.getProperty(Property.SUBSCRIPTION_KEY_FORMAT, DEFAULT_SUBSCRIPTION_KEY_FORMAT); String subscriptionKey = TokenResolver.replaceTokens(keyFormat, properties).ToLower(); return(subscriptionKey); }
/// <summary> /// Constructs the serviceKey based on the serviceKeyFormat specified in the properties. When no ///serviceKeyFormat is specific the default format of uddi:${keyDomain}:${serviceName} is used. /// </summary> /// <param name="properties"></param> /// <param name="serviceName"></param> /// <returns></returns> public static String getServiceKey(Properties properties, String serviceName) { Properties tempProperties = new Properties(); tempProperties.putAll(properties); tempProperties.put("serviceName", serviceName); //Constructing the serviceKey String keyFormat = tempProperties.getProperty(Property.SERVICE_KEY_FORMAT, DEFAULT_SERVICE_KEY_FORMAT); String serviceKey = TokenResolver.replaceTokens(keyFormat, tempProperties).ToLower(); return(serviceKey); }
/// <summary> /// /// Required Properties are: businessName, for example: 'Apache' nodeName, /// for example: 'uddi.example.org_80' keyDomain, for example: /// juddi.apache.org /// /// Optional Properties are: lang: for example: 'nl' /// /// </summary> /// <param name="clerk">can be null if register/unregister methods are not used.</param> /// <param name="urlLocalizer">A reference to an custom</param> /// <param name="properties">required values keyDomain, businessKey, nodeName</param> /// <exception cref="ConfigurationException"></exception> public WSDL2UDDI(UDDIClerk clerk, URLLocalizer urlLocalizer, Properties properties) { if (properties == null) throw new ArgumentNullException("properties"); this.clerk = clerk; this.urlLocalizer = urlLocalizer; this.properties = properties; if (clerk != null) { if (!properties.containsKey("keyDomain")) { throw new ConfigurationErrorsException("Property keyDomain is a required property when using WSDL2UDDI."); } if (!properties.containsKey("businessKey") && !properties.containsKey("businessName")) { throw new ConfigurationErrorsException("Either property businessKey, or businessName, is a required property when using WSDL2UDDI."); } if (!properties.containsKey("nodeName")) { if (properties.containsKey("serverName") && properties.containsKey("serverPort")) { String nodeName = properties.getProperty("serverName") + "_" + properties.getProperty("serverPort"); properties.setProperty("nodeName", nodeName); } else { throw new ConfigurationErrorsException("Property nodeName is not defined and is a required property when using WSDL2UDDI."); } } } //Obtaining values from the properties this.keyDomainURI = "uddi:" + properties.getProperty("keyDomain") + ":"; if (properties.containsKey(Property.BUSINESS_KEY)) { this.businessKey = properties.getProperty(Property.BUSINESS_KEY); } else { //using the BusinessKey Template, and the businessName to construct the key this.businessKey = UDDIKeyConvention.getBusinessKey(properties); } this.lang = properties.getProperty(Property.LANG, Property.DEFAULT_LANG); }
/// <summary> /// Constructs the serviceKey based on the serviceKeyFormat specified in the properties. When no ///serviceKeyFormat is specific the default format of uddi:${keyDomain}:${serviceName} is used. /// </summary> /// <param name="properties"></param> /// <param name="serviceName"></param> /// <returns></returns> public static String getServiceKey(Properties properties, String serviceName) { Properties tempProperties = new Properties(); tempProperties.putAll(properties); tempProperties.put("serviceName", serviceName); //Constructing the serviceKey String keyFormat = tempProperties.getProperty(Property.SERVICE_KEY_FORMAT, DEFAULT_SERVICE_KEY_FORMAT); String serviceKey = TokenResolver.replaceTokens(keyFormat, tempProperties).ToLower(); return serviceKey; }
public static String getSubscriptionKey(Properties properties) { String keyFormat = properties.getProperty(Property.SUBSCRIPTION_KEY_FORMAT, DEFAULT_SUBSCRIPTION_KEY_FORMAT); String subscriptionKey = TokenResolver.replaceTokens(keyFormat, properties).ToLower(); return subscriptionKey; }